Skip to content

Commit cd529a4

Browse files
committed
Remove support for ruby-3.0
1 parent 0b60ecf commit cd529a4

File tree

12 files changed

+23
-34
lines changed

12 files changed

+23
-34
lines changed

.github/workflows/ci.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
ruby: [ruby-3.0, ruby-3.1, ruby-3.2, ruby-3.3]
22+
ruby: [ruby-3.1, ruby-3.2, ruby-3.3]
2323
os: [ubuntu-latest]
2424
steps:
2525
- uses: actions/checkout@v4
@@ -35,7 +35,7 @@ jobs:
3535
strategy:
3636
fail-fast: false
3737
matrix:
38-
ruby: [ruby-3.0, ruby-3.1, ruby-3.2, ruby-3.3]
38+
ruby: [ruby-3.1, ruby-3.2, ruby-3.3]
3939
os: [ubuntu-latest]
4040
steps:
4141
- uses: actions/checkout@v4
@@ -53,7 +53,7 @@ jobs:
5353
strategy:
5454
fail-fast: false
5555
matrix:
56-
ruby: [ruby-3.0, ruby-3.1, ruby-3.2, ruby-3.3]
56+
ruby: [ruby-3.1, ruby-3.2, ruby-3.3]
5757
os: [ubuntu-latest]
5858
steps:
5959
- uses: actions/checkout@v4
@@ -69,7 +69,7 @@ jobs:
6969
strategy:
7070
fail-fast: false
7171
matrix:
72-
ruby: [ruby-3.0, ruby-3.1, ruby-3.2, ruby-3.3]
72+
ruby: [ruby-3.1, ruby-3.2, ruby-3.3]
7373
os: [ubuntu-latest]
7474
steps:
7575
- uses: actions/checkout@v4
@@ -85,7 +85,7 @@ jobs:
8585
strategy:
8686
fail-fast: false
8787
matrix:
88-
ruby: [ruby-3.0, ruby-3.1, ruby-3.2, ruby-3.3]
88+
ruby: [ruby-3.1, ruby-3.2, ruby-3.3]
8989
os: [ubuntu-latest]
9090
steps:
9191
- uses: actions/checkout@v4

Changelog.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# v0.6.14 2024-06-10
2+
3+
[#369](https://github.com/mbj/unparser/pull/369)
4+
5+
* Remove support for ruby-3.0, its EOL.
6+
17
# v0.6.13 2024-02-01
28

39
[#361](https://github.com/mbj/unparser/pull/361)

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The following constraints apply:
1010

1111
* No support for macruby extensions
1212
* Only support for the [modern AST](https://github.com/whitequark/parser/#usage) format
13-
* Only support for Ruby >= 3.0
13+
* Only support for Ruby >= 3.1
1414

1515
Notable Users:
1616

lib/unparser/emitter/match_pattern.rb

+1-10
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,11 @@ class MatchPattern < self
99

1010
children :target, :pattern
1111

12-
# Modern ast format emits `match_pattern`
13-
# node on single line pre 3.0, but 3.0+ uses `match_pattern_p`
14-
SYMBOL =
15-
if RUBY_VERSION < '3.0'
16-
' in '
17-
else
18-
' => '
19-
end
20-
2112
private
2213

2314
def dispatch
2415
visit(target)
25-
write(SYMBOL)
16+
write(' => ')
2617
visit(pattern)
2718
end
2819
end # MatchPattern

scripts/devloop.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
while inotifywait lib/**/*.rb test/**/*.rb spec/**/*.rb Gemfile unparser.gemspec; do
2-
bundle exec rspec spec/unit -fd --fail-fast --order default \
2+
bundle exec rspec spec/unit -fd --fail-fast --order defined \
33
&& bundle exec ./bin/parser-round-trip-test \
44
&& bundle exec mutant run --zombie --since HEAD~1 --fail-fast -- 'Unparser*' \
55
&& bundle exec rubocop

spec/unit/unparser_spec.rb

-8
Original file line numberDiff line numberDiff line change
@@ -417,14 +417,6 @@ def noop
417417
)
418418
end
419419

420-
if RUBY_VERSION < '3.0.'
421-
excludes.concat(
422-
%w[
423-
test/corpus/literal/since/30.rb
424-
]
425-
)
426-
end
427-
428420
excludes.flat_map { |file| ['--ignore', file] }
429421
end
430422

test/corpus/literal/lambda.rb

+3
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@
1111
}
1212
->(a, b; c) {
1313
}
14+
-> {
15+
_1 + _2
16+
}

test/corpus/literal/pattern.rb

+4
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@
3939
else
4040
end
4141
1 in [a]
42+
1 => [a]
43+
1 => [*]
44+
1 in [*, 42, *]
45+
1 in [*, a, *foo]

test/corpus/literal/range.rb

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
1..2
33
(1...)
44
1...2
5+
(..1)

test/corpus/literal/since/27.rb

-4
This file was deleted.

test/corpus/literal/since/30.rb

-4
This file was deleted.

unparser.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
2323

2424
gem.metadata['rubygems_mfa_required'] = 'true'
2525

26-
gem.required_ruby_version = '>= 3.0'
26+
gem.required_ruby_version = '>= 3.1'
2727

2828
gem.add_dependency('diff-lcs', '~> 1.3')
2929
gem.add_dependency('parser', '>= 3.3.0')

0 commit comments

Comments
 (0)