Skip to content

Commit

Permalink
Drop Ruby 2.5 support
Browse files Browse the repository at this point in the history
Because it has reached EOL for more than 1.5 years and it won't be
supported by the next reline version either.
  • Loading branch information
st0012 authored and hsbt committed Nov 17, 2022
1 parent 51f23c5 commit 210a4a5
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 19 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,10 @@ jobs:
- '3.0'
- '2.7'
- '2.6'
- '2.5'
- head
- truffleruby-head
os: [ubuntu-latest]
with_latest_reline: [true, false]
exclude:
- ruby: '2.5'
os: ubuntu-latest
with_latest_reline: true
fail-fast: false
runs-on: ${{ matrix.os }}
env:
Expand Down
2 changes: 1 addition & 1 deletion irb.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 1 addition & 5 deletions lib/irb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,7 @@ def handle_exception(exc)

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
Expand Down
6 changes: 3 additions & 3 deletions test/irb/test_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def test_eval_input_with_exception
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 `<main>'\n/,
Expand Down Expand Up @@ -523,7 +523,7 @@ def test_eval_input_with_invalid_byte_sequence_exception
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 `<main>'\n/,
Expand Down Expand Up @@ -560,7 +560,7 @@ def test_eval_input_with_long_exception
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/,
Expand Down
3 changes: 0 additions & 3 deletions test/irb/test_ruby_lex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,6 @@ def test_symbols
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()),
Expand Down
3 changes: 1 addition & 2 deletions test/lib/core_assertions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,7 @@ def assert_join_threads(threads, message = nil)
if !errs.empty?
msg = "exceptions on #{errs.length} threads:\n" +
errs.map {|t, err|
"#{t.inspect}:\n" +
RUBY_VERSION >= "2.5.0" ? err.full_message(highlight: false, order: :top) : err.message
"#{t.inspect}:\n" + err.full_message(highlight: false, order: :top)
}.join("\n---\n")
if message
msg = "#{message}\n#{msg}"
Expand Down

0 comments on commit 210a4a5

Please sign in to comment.