diff options
author | James Edward Gray II <james@grayproductions.net> | 2015-02-24 18:58:14 -0600 |
---|---|---|
committer | James Edward Gray II <james@grayproductions.net> | 2015-02-24 18:58:14 -0600 |
commit | b5e48298b84f36c47efea4bbb8dd450375679401 (patch) | |
tree | 56df6d857022ec31b087bacf1f594fcd8c12b6e8 | |
parent | 80968e9d323ae4b3456eecb5b26346a3acdeea32 (diff) | |
parent | 08b993bf87edb47e8812edd527e423cd58a0e0c0 (diff) | |
download | highline-b5e48298b84f36c47efea4bbb8dd450375679401.tar.gz |
Merge pull request #134 from abinoam/issue_129_fixv1.7.1
Some fixes for Rubinius and dropping of 1.8 support
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | Changelog.md | 12 | ||||
-rw-r--r-- | Gemfile | 1 | ||||
-rw-r--r-- | INSTALL | 4 | ||||
-rw-r--r-- | README.rdoc | 4 | ||||
-rw-r--r-- | highline.gemspec | 1 | ||||
-rw-r--r-- | lib/highline/menu.rb | 2 | ||||
-rwxr-xr-x | lib/highline/question.rb | 2 | ||||
-rwxr-xr-x | lib/highline/system_extensions.rb | 12 | ||||
-rw-r--r-- | lib/highline/version.rb | 2 | ||||
-rwxr-xr-x | test/tc_highline.rb | 12 | ||||
-rwxr-xr-x | test/tc_style.rb | 2 |
12 files changed, 43 insertions, 13 deletions
diff --git a/.travis.yml b/.travis.yml index fc52a58..87c2844 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ language: ruby sudo: false script: "bundle exec rake test" rvm: - - 1.8.7 - 1.9.3 - 2.0.0 - 2.1.5 @@ -14,4 +13,3 @@ notifications: matrix: allow_failures: - rvm: rbx-2 - - rvm: 1.8.7 diff --git a/Changelog.md b/Changelog.md index 8148e80..9a58217 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,18 @@ Below is a complete listing of changes for each revision of HighLine. +### 1.7.1 / 2015-02-24 + +#### Enhancements +* Add travis CI configuration (Eli Young (@elyscape), #130) +* Add Rubinius to Build Matrix with Allowed Failure (Brandon Fish +(bjfish), #132) +* Make some adjustments on tests (Abinoam Marques Jr., #133, #134) +* Drop support for Ruby 1.8 (Abinoam Marques Jr., #134) + +#### Bug fixes +* Fix IO.console.winsize returning reversed column and line values (Fission Xuiptz (@fissionxuiptz)), #131) + ### 1.7.0 / 2015-02-18 #### Bug fixes @@ -6,5 +6,4 @@ gem "rdoc", :require => false group(:development, :tests) do gem "code_statistics", :require => false gem "test-unit", :require => false - gem "io-console", :platforms => :ruby_18 end @@ -3,6 +3,10 @@ RubyGems is the preferred easy install method for HighLine. However, you can install HighLine manually as described below. +== Requirements + +HighLine from version >= 1.7.0 requires ruby >= 1.9.3 + == Installing the Gem HighLine is intended to be installed via the diff --git a/README.rdoc b/README.rdoc index 1ba0e55..cbf9ee9 100644 --- a/README.rdoc +++ b/README.rdoc @@ -59,6 +59,10 @@ Menus: For more examples see the examples/ directory of this project. +== Requirements + +HighLine from version >= 1.7.0 requires ruby >= 1.9.3 + == Installing See the INSTALL file for instructions. diff --git a/highline.gemspec b/highline.gemspec index 2a3d691..9523c0f 100644 --- a/highline.gemspec +++ b/highline.gemspec @@ -33,4 +33,5 @@ minutes of work. END_DESC spec.add_development_dependency "code_statistics" + spec.required_ruby_version = '>= 1.9.3' end diff --git a/lib/highline/menu.rb b/lib/highline/menu.rb index 636c1e4..44c41b7 100644 --- a/lib/highline/menu.rb +++ b/lib/highline/menu.rb @@ -345,7 +345,7 @@ class HighLine # Allows Menu to behave as a String, just like Question. Returns the # _layout_ to be rendered, which is used by HighLine.say(). # - def to_str( ) + def to_s( ) case @layout when :list '<%= if @header.nil? then '' else "#{@header}:\n" end %>' + diff --git a/lib/highline/question.rb b/lib/highline/question.rb index 10a32dc..fa8445a 100755 --- a/lib/highline/question.rb +++ b/lib/highline/question.rb @@ -441,7 +441,7 @@ class HighLine end # Stringifies the question to be asked. - def to_str( ) + def to_s @question end diff --git a/lib/highline/system_extensions.rb b/lib/highline/system_extensions.rb index 850b043..888d348 100755 --- a/lib/highline/system_extensions.rb +++ b/lib/highline/system_extensions.rb @@ -6,7 +6,6 @@ # This is Free Software. See LICENSE and COPYING for details. require "highline/compatibility" -require "io/console" class HighLine module SystemExtensions @@ -224,9 +223,14 @@ class HighLine # A Unix savvy method using stty to fetch the console columns, and rows. # ... stty does not work in JRuby def terminal_size - if (winsize = IO.console.winsize.reverse rescue nil) - winsize - elsif /solaris/ =~ RUBY_PLATFORM and + begin + require "io/console" + winsize = IO.console.winsize rescue nil + return winsize if winsize + rescue LoadError + end + + if /solaris/ =~ RUBY_PLATFORM and `stty` =~ /\brows = (\d+).*\bcolumns = (\d+)/ [$2, $1].map { |c| x.to_i } elsif `stty size` =~ /^(\d+)\s(\d+)$/ diff --git a/lib/highline/version.rb b/lib/highline/version.rb index 7105c20..d01247e 100644 --- a/lib/highline/version.rb +++ b/lib/highline/version.rb @@ -1,4 +1,4 @@ class HighLine # The version of the installed library. - VERSION = "1.7.0".freeze + VERSION = "1.7.1".freeze end diff --git a/test/tc_highline.rb b/test/tc_highline.rb index 5c91e20..cdda30a 100755 --- a/test/tc_highline.rb +++ b/test/tc_highline.rb @@ -249,9 +249,17 @@ class TestHighLine < Test::Unit::TestCase end def test_readline_mode + # Rubinius seems to be ignoring Readline input + # and output assignments. This ruins testing. + # but it doesn't mean readline is not working + # properly on rubinius. + + return if RUBY_ENGINE == "rbx" + # Creating Tempfiles here because Readline.input # and Readline.output only accepts a File object # as argument (not any duck type as StringIO) + temp_stdin = Tempfile.new "temp_stdin" temp_stdout = Tempfile.new "temp_stdout" @@ -927,7 +935,7 @@ class TestHighLine < Test::Unit::TestCase q.echo = false end - refute_equal("password", answer) + assert_not_equal("password", answer) assert_equal("passwor", answer) end @@ -939,7 +947,7 @@ class TestHighLine < Test::Unit::TestCase q.echo = false end - refute_equal("maçã", answer) + assert_not_equal("maçã", answer) assert_equal("maç", answer) end diff --git a/test/tc_style.rb b/test/tc_style.rb index 0e33c77..13eeead 100755 --- a/test/tc_style.rb +++ b/test/tc_style.rb @@ -569,7 +569,7 @@ class TestStyle < Test::Unit::TestCase bright_style = @style1.bright light_style = @style1.light - refute_equal bright_style, light_style + assert_not_equal bright_style, light_style assert_equal :bright_foo, bright_style.name assert_equal :light_foo, light_style.name assert_equal bright_style.code, light_style.code |