summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbinoam P. Marques Jr <abinoam@gmail.com>2017-06-29 23:30:51 -0300
committerAbinoam P. Marques Jr <abinoam@gmail.com>2017-06-29 23:30:51 -0300
commit059b00733a84d623aa4b8524d2811cf4a5067391 (patch)
tree0b85dbc95ab9fe169a88dd4dab7ed1ccce10fad5
parentcac18ffe5905853e469213f2d0f3cb5085659e99 (diff)
downloadhighline-059b00733a84d623aa4b8524d2811cf4a5067391.tar.gz
Replace $terminal to HighLine.default_instance
-rw-r--r--examples/asking_for_arrays.rb2
-rw-r--r--examples/basic_usage.rb2
-rw-r--r--examples/get_character.rb2
-rw-r--r--examples/limit.rb2
-rw-r--r--examples/menus.rb2
-rw-r--r--examples/overwrite.rb2
-rw-r--r--examples/page_and_wrap.rb4
-rw-r--r--examples/password.rb2
-rw-r--r--examples/repeat_entry.rb2
-rw-r--r--lib/highline/simulate.rb2
-rw-r--r--test/acceptance/acceptance.rb2
11 files changed, 12 insertions, 12 deletions
diff --git a/examples/asking_for_arrays.rb b/examples/asking_for_arrays.rb
index fa05a3e..42c3268 100644
--- a/examples/asking_for_arrays.rb
+++ b/examples/asking_for_arrays.rb
@@ -9,7 +9,7 @@ require "rubygems"
require "highline/import"
require "pp"
-puts "Using: #{$terminal.terminal.class}"
+puts "Using: #{HighLine.default_instance.class}"
puts
grades = ask( "Enter test scores (or a blank line to quit):",
diff --git a/examples/basic_usage.rb b/examples/basic_usage.rb
index 126c64a..62e3ccb 100644
--- a/examples/basic_usage.rb
+++ b/examples/basic_usage.rb
@@ -9,7 +9,7 @@ require "rubygems"
require "highline/import"
require "yaml"
-puts "Using: #{$terminal.terminal.class}"
+puts "Using: #{HighLine.default_instance.terminal.class}"
puts
contacts = [ ]
diff --git a/examples/get_character.rb b/examples/get_character.rb
index 48e4dba..c0a666f 100644
--- a/examples/get_character.rb
+++ b/examples/get_character.rb
@@ -3,7 +3,7 @@
require "rubygems"
require "highline/import"
-puts "Using: #{$terminal.terminal.class}"
+puts "Using: #{HighLine.default_instance.terminal.class}"
puts
choices = "ynaq"
diff --git a/examples/limit.rb b/examples/limit.rb
index 6d25cef..6115580 100644
--- a/examples/limit.rb
+++ b/examples/limit.rb
@@ -8,7 +8,7 @@
require "rubygems"
require "highline/import"
-puts "Using: #{$terminal.terminal.class}"
+puts "Using: #{HighLine.default_instance.terminal.class}"
puts
text = ask("Enter text (max 10 chars): ") { |q| q.limit = 10 }
diff --git a/examples/menus.rb b/examples/menus.rb
index c925c07..258c1ca 100644
--- a/examples/menus.rb
+++ b/examples/menus.rb
@@ -3,7 +3,7 @@
require "rubygems"
require "highline/import"
-puts "Using: #{$terminal.terminal.class}"
+puts "Using: #{HighLine.default_instance.terminal.class}"
puts
# The old way, using ask() and say()...
diff --git a/examples/overwrite.rb b/examples/overwrite.rb
index 83d51a5..f3c9754 100644
--- a/examples/overwrite.rb
+++ b/examples/overwrite.rb
@@ -8,7 +8,7 @@
require 'rubygems'
require 'highline/import'
-puts "Using: #{$terminal.terminal.class}"
+puts "Using: #{HighLine.default_instance.terminal.class}"
puts
prompt = "here is your password:"
diff --git a/examples/page_and_wrap.rb b/examples/page_and_wrap.rb
index 25cd6ef..24dd52d 100644
--- a/examples/page_and_wrap.rb
+++ b/examples/page_and_wrap.rb
@@ -8,8 +8,8 @@
require "rubygems"
require "highline/import"
-$terminal.wrap_at = 80
-$terminal.page_at = 22
+HighLine.default_instance.wrap_at = 80
+HighLine.default_instance.page_at = 22
say(<<END)
THE UNITED STATES CONSTITUTION
diff --git a/examples/password.rb b/examples/password.rb
index a9e591a..698829d 100644
--- a/examples/password.rb
+++ b/examples/password.rb
@@ -3,7 +3,7 @@
require "rubygems"
require "highline/import"
-puts "Using: #{$terminal.terminal.class}"
+puts "Using: #{HighLine.default_instance.terminal.class}"
puts
pass = ask("Enter your password: ") { |q| q.echo = false }
diff --git a/examples/repeat_entry.rb b/examples/repeat_entry.rb
index 553b7a6..5e67f7d 100644
--- a/examples/repeat_entry.rb
+++ b/examples/repeat_entry.rb
@@ -3,7 +3,7 @@
require "rubygems"
require "highline/import"
-puts "Using: #{$terminal.terminal.class}"
+puts "Using: #{HighLine.default_instance.terminal.class}"
puts
tounge_twister = ask("... try saying that three times fast") do |q|
diff --git a/lib/highline/simulate.rb b/lib/highline/simulate.rb
index 152979b..c1ee6df 100644
--- a/lib/highline/simulate.rb
+++ b/lib/highline/simulate.rb
@@ -44,7 +44,7 @@ class HighLine
end
# A wrapper method that temporarily replaces the Highline
- # instance in $terminal with an instance of this object
+ # instance in HighLine.default_instance with an instance of this object
# for the duration of the block
#
# @param strings [String] preloaded string buffer that
diff --git a/test/acceptance/acceptance.rb b/test/acceptance/acceptance.rb
index edef458..5ba6784 100644
--- a/test/acceptance/acceptance.rb
+++ b/test/acceptance/acceptance.rb
@@ -35,7 +35,7 @@ james@grayproductions.net
=== HighLine Acceptance Tests Report
Date: #{Time.now.utc}
HighLine::VERSION: #{HighLine::VERSION}
-Terminal: #{$terminal.terminal.class}
+Terminal: #{HighLine.default_instance.terminal.class}
RUBY_DESCRIPTION: #{RUBY_DESCRIPTION rescue 'not available'}
Readline::VERSION: #{Readline::VERSION rescue 'not availabe'}
ENV['SHELL']: #{ENV['SHELL']}