From de356752f1cb41f8caac74581d0f5a1f550453ce Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Wed, 2 Sep 2015 18:56:17 +0900 Subject: [PATCH 1/7] dropped case condition of Ruby 1.8 --- lib/rake/alt_system.rb | 70 +++--------------------------------- lib/rake/testtask.rb | 11 +----- test/test_rake_functional.rb | 2 +- 3 files changed, 6 insertions(+), 77 deletions(-) diff --git a/lib/rake/alt_system.rb b/lib/rake/alt_system.rb index aa7b7791b..359236b8d 100644 --- a/lib/rake/alt_system.rb +++ b/lib/rake/alt_system.rb @@ -41,70 +41,8 @@ def define_module_function(name, &block) end end - if WINDOWS && RUBY_VERSION < "1.9.0" - RUNNABLE_EXTS = %w[com exe bat cmd] - RUNNABLE_PATTERN = %r!\.(#{RUNNABLE_EXTS.join('|')})\Z!i - - define_module_function :kernel_system, &Kernel.method(:system) - define_module_function :kernel_backticks, &Kernel.method(:'`') - - module_function - - def repair_command(cmd) - "call " + ( - if cmd =~ %r!\A\s*\".*?\"! - # already quoted - cmd - elsif match = cmd.match(%r!\A\s*(\S+)!) - if match[1] =~ %r!/! - # avoid x/y.bat interpretation as x with option /y - %Q!"#{match[1]}"! + match.post_match - else - # a shell command will fail if quoted - cmd - end - else - # empty or whitespace - cmd - end - ) - end - - def find_runnable(file) - if file =~ RUNNABLE_PATTERN - file - else - RUNNABLE_EXTS.each { |ext| - test = "#{file}.#{ext}" - return test if File.exist?(test) - } - nil - end - end - - def system(cmd, *args) - repaired = ( - if args.empty? - [repair_command(cmd)] - elsif runnable = find_runnable(cmd) - [File.expand_path(runnable), *args] - else - # non-existent file - [cmd, *args] - end - ) - kernel_system(*repaired) - end - - def backticks(cmd) - kernel_backticks(repair_command(cmd)) - end - - define_module_function :'`', &method(:backticks) - else - # Non-Windows or ruby-1.9+: same as Kernel versions - define_module_function :system, &Kernel.method(:system) - define_module_function :backticks, &Kernel.method(:'`') - define_module_function :'`', &Kernel.method(:'`') - end + # Non-Windows or ruby-1.9+: same as Kernel versions + define_module_function :system, &Kernel.method(:system) + define_module_function :backticks, &Kernel.method(:'`') + define_module_function :'`', &Kernel.method(:'`') end diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index 5cae95c5d..d0e0614be 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -150,15 +150,6 @@ def file_list # :nodoc: end end - def fix # :nodoc: - case ruby_version - when '1.8.2' - "\"#{find_file 'rake/ruby182_test_unit_fix'}\"" - else - nil - end || '' - end - def ruby_version # :nodoc: RUBY_VERSION end @@ -168,7 +159,7 @@ def run_code # :nodoc: when :direct "-e \"ARGV.each{|f| require f}\"" when :testrb - "-S testrb #{fix}" + "-S testrb" when :rake "#{rake_include_arg} \"#{rake_loader}\"" end diff --git a/test/test_rake_functional.rb b/test/test_rake_functional.rb index bf7ba92f7..25bf50782 100644 --- a/test/test_rake_functional.rb +++ b/test/test_rake_functional.rb @@ -476,7 +476,7 @@ def test_stand_alone_filelist # predicate function can be used to skip tests or assertions as # needed. def uncertain_exit_status? - RUBY_VERSION < "1.9" || defined?(JRUBY_VERSION) + defined?(JRUBY_VERSION) end end From c4230471d60e5dd518f7cd2e8291169ba78af1e5 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 14 Nov 2015 20:45:59 +0900 Subject: [PATCH 2/7] removed tests for Ruby 1.8 --- test/test_rake_test_task.rb | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/test/test_rake_test_task.rb b/test/test_rake_test_task.rb index 5c4be797c..57adb3ede 100644 --- a/test/test_rake_test_task.rb +++ b/test/test_rake_test_task.rb @@ -115,26 +115,6 @@ def test_run_code_rake_default_gem end end - def test_run_code_testrb_ruby_1_8_2 - test_task = Rake::TestTask.new do |t| - t.loader = :testrb - end - - def test_task.ruby_version() '1.8.2' end - - assert_match(/^-S testrb +".*"$/, test_task.run_code) - end - - def test_run_code_testrb_ruby_1_8_6 - test_task = Rake::TestTask.new do |t| - t.loader = :testrb - end - - def test_task.ruby_version() '1.8.6' end - - assert_match(/^-S testrb +$/, test_task.run_code) - end - def test_test_files_equals tt = Rake::TestTask.new do |t| t.test_files = FileList['a.rb', 'b.rb'] From b9db1f2c00a2a50c3a00ca0044ec76db8259d25e Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 14 Nov 2015 20:49:05 +0900 Subject: [PATCH 3/7] bumped required ruby version --- Rakefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index 375ca8805..20eb3d449 100644 --- a/Rakefile +++ b/Rakefile @@ -25,7 +25,7 @@ hoe = Hoe.spec 'rake' do developer 'Eric Hodel', 'drbrain@segment7.net' developer 'Jim Weirich', '' - require_ruby_version '>= 1.8.7' + require_ruby_version '>= 1.9.3' require_rubygems_version '>= 1.3.2' dependency 'minitest', '~> 5.0', :developer @@ -78,4 +78,3 @@ begin rescue LoadError warn 'run `rake newb` to install rdoc' end - From bfa25de6300589b40c7ab801a8e4cd1b74c5280b Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 14 Nov 2015 20:59:30 +0900 Subject: [PATCH 4/7] removed Ruby 1.8.7 from travis --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6230b9ec9..7662bc73f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,6 @@ notifications: email: - drbrain@segment7.net rvm: - - 1.8.7 - 1.9.3 - 2.0.0 - 2.1.8 From 966a7ed42501424b38446eacfb56bd2c15b7379f Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 8 Jan 2016 10:35:22 +0900 Subject: [PATCH 5/7] removed ruby 1.8 workaround --- Manifest.txt | 1 - lib/rake/ruby182_test_unit_fix.rb | 29 ----------------------------- 2 files changed, 30 deletions(-) delete mode 100644 lib/rake/ruby182_test_unit_fix.rb diff --git a/Manifest.txt b/Manifest.txt index a7829c97b..a9153909a 100644 --- a/Manifest.txt +++ b/Manifest.txt @@ -94,7 +94,6 @@ lib/rake/pseudo_status.rb lib/rake/rake_module.rb lib/rake/rake_test_loader.rb lib/rake/rdoctask.rb -lib/rake/ruby182_test_unit_fix.rb lib/rake/rule_recursion_overflow_error.rb lib/rake/runtest.rb lib/rake/scope.rb diff --git a/lib/rake/ruby182_test_unit_fix.rb b/lib/rake/ruby182_test_unit_fix.rb deleted file mode 100644 index 40b30a6fd..000000000 --- a/lib/rake/ruby182_test_unit_fix.rb +++ /dev/null @@ -1,29 +0,0 @@ -# TODO: Remove in rake 11 - -# Local Rake override to fix bug in Ruby 0.8.2 -module Test # :nodoc: - # Local Rake override to fix bug in Ruby 0.8.2 - module Unit # :nodoc: - # Local Rake override to fix bug in Ruby 0.8.2 - module Collector # :nodoc: - # Local Rake override to fix bug in Ruby 0.8.2 - class Dir # :nodoc: - undef collect_file - def collect_file(name, suites, already_gathered) # :nodoc: - dir = File.dirname(File.expand_path(name)) - $:.unshift(dir) unless $:.first == dir - if @req - @req.require(name) - else - require(name) - end - find_test_cases(already_gathered).each do |t| - add_suite(suites, t.suite) - end - ensure - $:.delete_at $:.rindex(dir) - end - end - end - end -end From ccfc7a43fecbbf6ee496f015b2dec18a495fcf69 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Thu, 14 Jan 2016 08:58:19 +0900 Subject: [PATCH 6/7] removed workaround for Ruby 1.8 --- Manifest.txt | 1 - lib/rake.rb | 1 - lib/rake/ext/time.rb | 18 ------------------ 3 files changed, 20 deletions(-) delete mode 100644 lib/rake/ext/time.rb diff --git a/Manifest.txt b/Manifest.txt index a9153909a..4c612d3c6 100644 --- a/Manifest.txt +++ b/Manifest.txt @@ -71,7 +71,6 @@ lib/rake/ext/core.rb lib/rake/ext/module.rb lib/rake/ext/pathname.rb lib/rake/ext/string.rb -lib/rake/ext/time.rb lib/rake/file_creation_task.rb lib/rake/file_list.rb lib/rake/file_task.rb diff --git a/lib/rake.rb b/lib/rake.rb index e1f559f8f..51359741d 100644 --- a/lib/rake.rb +++ b/lib/rake.rb @@ -40,7 +40,6 @@ module Rake require 'rake/ext/module' require 'rake/ext/string' -require 'rake/ext/time' require 'rake/win32' diff --git a/lib/rake/ext/time.rb b/lib/rake/ext/time.rb deleted file mode 100644 index 3c206e4dd..000000000 --- a/lib/rake/ext/time.rb +++ /dev/null @@ -1,18 +0,0 @@ -#-- -# Extensions to time to allow comparisons with early and late time classes. - -require 'rake/early_time' -require 'rake/late_time' - -if RUBY_VERSION < "1.9" - class Time # :nodoc: all - alias rake_original_time_compare :<=> - def <=>(other) - if Rake::EarlyTime === other || Rake::LateTime === other - - other.<=>(self) - else - rake_original_time_compare(other) - end - end - end -end From 7f100cf72bb5ba45b4ee9dafd46c883f0b57eefb Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Thu, 14 Jan 2016 14:07:17 +0900 Subject: [PATCH 7/7] JRuby tests is fragile --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 7662bc73f..e41820f4d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,5 +24,6 @@ rvm: script: ruby -Ilib bin/rake matrix: allow_failures: + - rvm: jruby-1.7.20 - rvm: jruby-9.0.4.0 - rvm: jruby-head