Skip to content

Commit

Permalink
Drop ruby 2.4 support (#731)
Browse files Browse the repository at this point in the history
Take the chance to enable new cops that only work on ruby 2.5 and above.
  • Loading branch information
deivid-rodriguez committed Oct 9, 2020
1 parent 4eabcaa commit e744069
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 74 deletions.
26 changes: 3 additions & 23 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

strategy:
matrix:
version: [2.4.9, 2.5.7, 2.6.5, 2.7.0]
version: [2.5.7, 2.6.5, 2.7.0]
line_editor: [libedit, readline]
compiler: [clang, gcc]

Expand All @@ -31,13 +31,13 @@ jobs:
- name: Save coverage
run: mv coverage/.resultset.json coverage/${{ matrix.version }}-${{ matrix.line_editor }}-${{ matrix.compiler }}.json
if: startsWith(matrix.version, '2.4') || startsWith(matrix.version, '2.5')
if: startsWith(matrix.version, '2.5')

- uses: actions/upload-artifact@v1
with:
name: coverage-${{ matrix.version }}-${{ matrix.line_editor }}-${{ matrix.compiler }}
path: coverage/${{ matrix.version }}-${{ matrix.line_editor }}-${{ matrix.compiler }}.json
if: startsWith(matrix.version, '2.4') || startsWith(matrix.version, '2.5')
if: startsWith(matrix.version, '2.5')

timeout-minutes: 15

Expand All @@ -51,26 +51,6 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: actions/download-artifact@v1
with:
name: coverage-2.4.9-libedit-clang
path: coverage

- uses: actions/download-artifact@v1
with:
name: coverage-2.4.9-libedit-gcc
path: coverage

- uses: actions/download-artifact@v1
with:
name: coverage-2.4.9-readline-clang
path: coverage

- uses: actions/download-artifact@v1
with:
name: coverage-2.4.9-readline-gcc
path: coverage

- uses: actions/download-artifact@v1
with:
name: coverage-2.5.7-libedit-clang
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
version: [2.4.9, 2.5.7, 2.6.5, 2.7.0, head]
version: [2.5.7, 2.6.5, 2.7.0, head]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ AllCops:

DisabledByDefault: true

TargetRubyVersion: 2.4
TargetRubyVersion: 2.5

Layout/AccessModifierIndentation:
Enabled: true
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Removed

* Support for MRI 2.4. Byebug no longer installs on this platform.

## [11.1.3] - 2020-04-23

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ more][Tidelift for enterprise].

## Requirements

* _Required_: MRI 2.4.0 or higher.
* _Required_: MRI 2.5.0 or higher.
* _Recommended_: MRI 2.6.4 or higher (MRI 2.6.0 to 2.6.3 contain a regression
causing unbalanced call/return events in some cases, breaking the `next` command).

Expand Down
8 changes: 3 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ task "release:rubygem_push" => "chandler:push"
if Gem.win_platform?
desc "Activates DevKit"
task :devkit do
begin
require "devkit"
rescue LoadError
abort "Failed to load DevKit required for compilation"
end
require "devkit"
rescue LoadError
abort "Failed to load DevKit required for compilation"
end

task compile: :devkit
Expand Down
2 changes: 1 addition & 1 deletion byebug.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Gem::Specification.new do |s|
can build on. It provides breakpoint handling and bindings for stack frames
among other things and it comes with an easy to use command line interface."

s.required_ruby_version = ">= 2.4.0"
s.required_ruby_version = ">= 2.5.0"

s.files = Dir["lib/**/*.rb", "lib/**/*.yml", "ext/**/*.[ch]", "LICENSE"]
s.bindir = "exe"
Expand Down
1 change: 0 additions & 1 deletion docker/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module Docker
#
class Manager
VERSIONS = %w[
2.4.9
2.5.7
2.6.5
2.7.0
Expand Down
10 changes: 4 additions & 6 deletions lib/byebug/helpers/parse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ def syntax_valid?(code)
return true unless code

without_stderr do
begin
RubyVM::InstructionSequence.compile(code)
true
rescue SyntaxError
false
end
RubyVM::InstructionSequence.compile(code)
true
rescue SyntaxError
false
end
end

Expand Down
36 changes: 6 additions & 30 deletions test/commands/break_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,61 +43,37 @@ def program
def test_break_with_instance_method_stops_at_correct_place
enter "break #{example_class}#b", "cont"

if RUBY_VERSION >= "2.5.0"
debug_code(program) { assert_location example_path, 13 }
else
debug_code(program) { assert_location example_path, 12 }
end
debug_code(program) { assert_location example_path, 13 }
end

def test_break_with_namespaced_instance_method_stops_at_correct_place
enter "break Byebug::#{example_class}#b", "cont"

if RUBY_VERSION >= "2.5.0"
debug_code(program) { assert_location example_path, 13 }
else
debug_code(program) { assert_location example_path, 12 }
end
debug_code(program) { assert_location example_path, 13 }
end

def test_break_with_class_method_stops_at_correct_place
enter "break #{example_class}.a", "cont"

if RUBY_VERSION >= "2.5.0"
debug_code(program) { assert_location example_path, 7 }
else
debug_code(program) { assert_location example_path, 6 }
end
debug_code(program) { assert_location example_path, 7 }
end

def test_break_with_namespaced_class_method_stops_at_correct_place
enter "break Byebug::#{example_class}.a", "cont"

if RUBY_VERSION >= "2.5.0"
debug_code(program) { assert_location example_path, 7 }
else
debug_code(program) { assert_location example_path, 6 }
end
debug_code(program) { assert_location example_path, 7 }
end

def test_break_with_module_method_stops_at_correct_place
enter "break #{example_module}.c", "cont"

if RUBY_VERSION >= "2.5.0"
debug_code(program) { assert_location(example_path, 19) }
else
debug_code(program) { assert_location(example_path, 18) }
end
debug_code(program) { assert_location(example_path, 19) }
end

def test_break_with_namespaced_module_method_stops_at_correct_place
enter "break Byebug::#{example_module}.c", "cont"

if RUBY_VERSION >= "2.5.0"
debug_code(program) { assert_location example_path, 19 }
else
debug_code(program) { assert_location example_path, 18 }
end
debug_code(program) { assert_location example_path, 19 }
end

def test_break_with_a_method_does_not_stop_at_blocks_in_the_method
Expand Down
6 changes: 1 addition & 5 deletions test/commands/debug_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ def test_subdebugger_stops_at_correct_point_when_invoked_through_byebug_call
def test_subdebugger_stops_at_correct_point_when_invoked_from_breakpoint
enter "break #{example_class}.a", "debug #{example_class}.a"

if RUBY_VERSION >= "2.5.0"
debug_code(program) { assert_equal 7, frame.line }
else
debug_code(program) { assert_equal 6, frame.line }
end
debug_code(program) { assert_equal 7, frame.line }
end

def test_subdebugger_goes_back_to_previous_debugger_after_continue
Expand Down

0 comments on commit e744069

Please sign in to comment.