From 923c1aaed7a5707d5c358627aad37f29e7738143 Mon Sep 17 00:00:00 2001 From: st0012 Date: Mon, 25 Jul 2022 23:35:25 +0100 Subject: [PATCH] Drop Ruby 2.5 support Because it has reached EOL for more than 1.5 years and it won't be supported by the next reline version either. --- lib/irb.rb | 6 +----- lib/irb/irb.gemspec | 2 +- test/irb/test_context.rb | 6 +++--- test/irb/test_ruby_lex.rb | 3 --- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/lib/irb.rb b/lib/irb.rb index 04009664ef..ab5702c9f2 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -598,11 +598,7 @@ module IRB if exc.backtrace order = nil - if '2.5.0' == RUBY_VERSION - # Exception#full_message doesn't have keyword arguments. - message = exc.full_message # the same of (highlight: true, order: bottom) - order = :bottom - elsif '2.5.1' <= RUBY_VERSION && RUBY_VERSION < '3.0.0' + if RUBY_VERSION < '3.0.0' if STDOUT.tty? message = exc.full_message(order: :bottom) order = :bottom diff --git a/lib/irb/irb.gemspec b/lib/irb/irb.gemspec index d443938043..c3e8a4dc58 100644 --- a/lib/irb/irb.gemspec +++ b/lib/irb/irb.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.required_ruby_version = Gem::Requirement.new(">= 2.5") + spec.required_ruby_version = Gem::Requirement.new(">= 2.6") spec.add_dependency "reline", ">= 0.3.0" end diff --git a/test/irb/test_context.rb b/test/irb/test_context.rb index e127ba7599..4d256a73a2 100644 --- a/test/irb/test_context.rb +++ b/test/irb/test_context.rb @@ -492,7 +492,7 @@ module TestIRB irb.eval_input end assert_empty err - if '2.5.0' <= RUBY_VERSION && RUBY_VERSION < '3.0.0' && STDOUT.tty? + if RUBY_VERSION < '3.0.0' && STDOUT.tty? expected = [ :*, /Traceback \(most recent call last\):\n/, :*, /\t 2: from \(irb\):1:in `
'\n/, @@ -523,7 +523,7 @@ module TestIRB irb.eval_input end assert_empty err - if '2.5.0' <= RUBY_VERSION && RUBY_VERSION < '3.0.0' && STDOUT.tty? + if RUBY_VERSION < '3.0.0' && STDOUT.tty? expected = [ :*, /Traceback \(most recent call last\):\n/, :*, /\t 2: from \(irb\):1:in `
'\n/, @@ -560,7 +560,7 @@ module TestIRB irb.eval_input end assert_empty err - if '2.5.0' <= RUBY_VERSION && RUBY_VERSION < '3.0.0' && STDOUT.tty? + if RUBY_VERSION < '3.0.0' && STDOUT.tty? expected = [ :*, /Traceback \(most recent call last\):\n/, :*, /\t... \d+ levels...\n/, diff --git a/test/irb/test_ruby_lex.rb b/test/irb/test_ruby_lex.rb index 2b16e2e9a1..fa68a4632c 100644 --- a/test/irb/test_ruby_lex.rb +++ b/test/irb/test_ruby_lex.rb @@ -181,9 +181,6 @@ module TestIRB end def test_endless_range_at_end_of_line - if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.6.0') - pend 'Endless range is available in 2.6.0 or later' - end input_with_prompt = [ PromptRow.new('001:0: :> ', %q(a = 3..)), PromptRow.new('002:0: :* ', %q()),