Skip to content

Commit 0cfb880

Browse files
authored
Merge pull request #1108 from amatsuda/ruby25
Bring Ruby 2.5 and 2.6 support back
2 parents 8558b1e + 6d2cfd9 commit 0cfb880

File tree

11 files changed

+60
-52
lines changed

11 files changed

+60
-52
lines changed

.github/workflows/stable.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on: [push, pull_request]
55
jobs:
66
tests:
77
runs-on: ubuntu-latest
8+
89
env:
910
BUNDLE_WITHOUT: "benchmark"
1011
JRUBY_OPTS: "--debug"
@@ -13,6 +14,8 @@ jobs:
1314

1415
matrix:
1516
ruby-version:
17+
- '2.5'
18+
- '2.6'
1619
- '2.7'
1720
- '3.0'
1821
- '3.1'
@@ -24,11 +27,12 @@ jobs:
2427
steps:
2528
- uses: actions/checkout@v4
2629

27-
- run: rm Gemfile.lock
30+
- run: rm Gemfile.lock && rm test_projects/rails/rspec_rails/Gemfile.lock
2831

2932
- uses: ruby/setup-ruby@v1
3033
with:
3134
ruby-version: ${{ matrix.ruby-version }}
35+
rubygems: ${{ (matrix.ruby_version < '2.6' && '3.3.26') || 'default' }}
3236
bundler-cache: true
3337

3438
- name: Run Rubocop

.rubocop.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ AllCops:
1010
- "tmp/**/*"
1111
- "vendor/bundle/**/*"
1212
- "vendor/bundle/**/.*"
13-
TargetRubyVersion: 2.7
13+
TargetRubyVersion: 2.5
1414
NewCops: enable
1515
# we might wanna adopt rspec and rake but it's a bit annoying for now
1616
SuggestExtensions: false
@@ -239,6 +239,9 @@ Style/DocumentDynamicEvalDefinition:
239239
Style/EndlessMethod:
240240
Enabled: true
241241

242+
Style/EnvHome:
243+
Enabled: false
244+
242245
Style/ExplicitBlockArgument:
243246
# capturing as a proc has a performance hit, so is a case by case choice
244247
Enabled: false

Gemfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ group :development do
1515
gem "activesupport", "~> 6.1"
1616
gem "aruba"
1717
gem "capybara"
18-
gem "rackup"
18+
if RUBY_VERSION < "2.7"
19+
gem "rack", "< 3"
20+
else
21+
gem "rackup"
22+
end
1923
gem "cucumber"
2024
gem "minitest"
2125
gem "rake"

Gemfile.lock

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ PATH
1717
GEM
1818
remote: https://rubygems.org/
1919
specs:
20-
activesupport (6.1.7.7)
20+
activesupport (6.1.7.8)
2121
concurrent-ruby (~> 1.0, >= 1.0.2)
2222
i18n (>= 1.6, < 2)
2323
minitest (>= 5.1)
2424
tzinfo (~> 2.0)
2525
zeitwerk (~> 2.3)
26-
addressable (2.8.6)
27-
public_suffix (>= 2.0.2, < 6.0)
26+
addressable (2.8.7)
27+
public_suffix (>= 2.0.2, < 7.0)
2828
aruba (2.2.0)
2929
bundler (>= 1.17, < 3.0)
3030
contracts (>= 0.16.0, < 0.18.0)
@@ -33,9 +33,9 @@ GEM
3333
thor (~> 1.0)
3434
ast (2.4.2)
3535
benchmark-ips (2.13.0)
36-
bigdecimal (3.1.7)
37-
bigdecimal (3.1.7-java)
38-
builder (3.2.4)
36+
bigdecimal (3.1.8)
37+
bigdecimal (3.1.8-java)
38+
builder (3.3.0)
3939
capybara (3.40.0)
4040
addressable
4141
matrix
@@ -46,7 +46,7 @@ GEM
4646
regexp_parser (>= 1.5, < 3.0)
4747
xpath (~> 3.2)
4848
coderay (1.1.3)
49-
concurrent-ruby (1.3.3)
49+
concurrent-ruby (1.3.4)
5050
contracts (0.17)
5151
cucumber (9.2.0)
5252
builder (~> 3.2)
@@ -61,40 +61,40 @@ GEM
6161
multi_test (~> 1.1)
6262
sys-uname (~> 1.2)
6363
cucumber-ci-environment (10.0.1)
64-
cucumber-core (13.0.2)
64+
cucumber-core (13.0.3)
6565
cucumber-gherkin (>= 27, < 28)
6666
cucumber-messages (>= 20, < 23)
6767
cucumber-tag-expressions (> 5, < 7)
6868
cucumber-cucumber-expressions (17.1.0)
6969
bigdecimal
7070
cucumber-gherkin (27.0.0)
7171
cucumber-messages (>= 19.1.4, < 23)
72-
cucumber-html-formatter (21.3.1)
73-
cucumber-messages (> 19, < 25)
72+
cucumber-html-formatter (21.7.0)
73+
cucumber-messages (> 19, < 27)
7474
cucumber-messages (22.0.0)
7575
cucumber-tag-expressions (6.1.0)
7676
diff-lcs (1.5.1)
77-
docile (1.4.0)
78-
ffi (1.16.3)
79-
ffi (1.16.3-java)
80-
i18n (1.14.4)
77+
docile (1.4.1)
78+
ffi (1.17.0)
79+
ffi (1.17.0-java)
80+
i18n (1.14.5)
8181
concurrent-ruby (~> 1.0)
8282
json (2.7.2)
8383
json (2.7.2-java)
8484
language_server-protocol (3.17.0.3)
8585
matrix (0.4.2)
86-
method_source (1.0.0)
86+
method_source (1.1.0)
8787
mini_mime (1.1.5)
8888
mini_portile2 (2.8.7)
89-
minitest (5.24.0)
89+
minitest (5.25.1)
9090
multi_test (1.1.0)
91-
nokogiri (1.16.6)
91+
nokogiri (1.16.7)
9292
mini_portile2 (~> 2.8.2)
9393
racc (~> 1.4)
94-
nokogiri (1.16.6-java)
94+
nokogiri (1.16.7-java)
9595
racc (~> 1.4)
96-
parallel (1.25.1)
97-
parser (3.3.3.0)
96+
parallel (1.26.3)
97+
parser (3.3.4.2)
9898
ast (~> 2.4.1)
9999
racc
100100
power_assert (2.0.3)
@@ -105,10 +105,10 @@ GEM
105105
coderay (~> 1.1)
106106
method_source (~> 1.0)
107107
spoon (~> 0.0)
108-
public_suffix (5.0.5)
109-
racc (1.8.0)
110-
racc (1.8.0-java)
111-
rack (3.0.10)
108+
public_suffix (6.0.1)
109+
racc (1.8.1)
110+
racc (1.8.1-java)
111+
rack (3.1.7)
112112
rack-test (2.1.0)
113113
rack (>= 1.3)
114114
rackup (2.1.0)
@@ -117,33 +117,33 @@ GEM
117117
rainbow (3.1.1)
118118
rake (13.2.1)
119119
regexp_parser (2.9.2)
120-
rexml (3.3.0)
120+
rexml (3.3.6)
121121
strscan
122122
rspec (3.13.0)
123123
rspec-core (~> 3.13.0)
124124
rspec-expectations (~> 3.13.0)
125125
rspec-mocks (~> 3.13.0)
126126
rspec-core (3.13.0)
127127
rspec-support (~> 3.13.0)
128-
rspec-expectations (3.13.0)
128+
rspec-expectations (3.13.2)
129129
diff-lcs (>= 1.2.0, < 2.0)
130130
rspec-support (~> 3.13.0)
131-
rspec-mocks (3.13.0)
131+
rspec-mocks (3.13.1)
132132
diff-lcs (>= 1.2.0, < 2.0)
133133
rspec-support (~> 3.13.0)
134134
rspec-support (3.13.1)
135-
rubocop (1.64.1)
135+
rubocop (1.65.1)
136136
json (~> 2.3)
137137
language_server-protocol (>= 3.17.0)
138138
parallel (~> 1.10)
139139
parser (>= 3.3.0.2)
140140
rainbow (>= 2.2.2, < 4.0)
141-
regexp_parser (>= 1.8, < 3.0)
141+
regexp_parser (>= 2.4, < 3.0)
142142
rexml (>= 3.2.5, < 4.0)
143143
rubocop-ast (>= 1.31.1, < 2.0)
144144
ruby-progressbar (~> 1.7)
145145
unicode-display_width (>= 2.4.0, < 3.0)
146-
rubocop-ast (1.31.3)
146+
rubocop-ast (1.32.1)
147147
parser (>= 3.3.1.0)
148148
ruby-progressbar (1.13.0)
149149
simplecov-html (0.12.3)
@@ -152,11 +152,11 @@ GEM
152152
ffi
153153
strscan (3.1.0)
154154
strscan (3.1.0-java)
155-
sys-uname (1.2.3)
155+
sys-uname (1.3.0)
156156
ffi (~> 1.1)
157-
test-unit (3.6.1)
157+
test-unit (3.6.2)
158158
power_assert
159-
thor (1.3.1)
159+
thor (1.3.2)
160160
tzinfo (2.0.6)
161161
concurrent-ruby (~> 1.0)
162162
unicode-display_width (2.5.0)
@@ -168,7 +168,7 @@ GEM
168168
websocket-extensions (0.1.5)
169169
xpath (3.2.0)
170170
nokogiri (~> 1.8)
171-
zeitwerk (2.6.13)
171+
zeitwerk (2.6.17)
172172

173173
PLATFORMS
174174
java
@@ -195,4 +195,4 @@ DEPENDENCIES
195195
webrick
196196

197197
BUNDLED WITH
198-
2.4.20
198+
2.3.12

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ SimpleCov.formatter = SimpleCov::Formatter::JSONFormatter
889889

890890
## Ruby version compatibility
891891

892-
SimpleCov is built in [Continuous Integration] on Ruby 2.7+ as well as JRuby 9.3+.
892+
SimpleCov is built in [Continuous Integration] on Ruby 2.5+ as well as JRuby 9.2+.
893893

894894
Note for JRuby => You need to pass JRUBY_OPTS="--debug" or create .jrubyrc and add debug.fullTrace=true
895895

lib/simplecov.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,9 @@ def start_coverage_measurement
347347
end
348348

349349
def start_coverage_with_criteria
350-
start_arguments = coverage_criteria.to_h do |criterion|
350+
start_arguments = coverage_criteria.map do |criterion|
351351
[lookup_corresponding_ruby_coverage_name(criterion), true]
352-
end
352+
end.to_h
353353

354354
start_arguments[:eval] = true if coverage_for_eval_enabled?
355355

lib/simplecov/configuration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def minimum_coverage_by_file(coverage = nil)
344344
def refuse_coverage_drop(*criteria)
345345
criteria = coverage_criteria if criteria.empty?
346346

347-
maximum_coverage_drop(criteria.to_h { |c| [c, 0] })
347+
maximum_coverage_drop(criteria.map { |c| [c, 0] }.to_h)
348348
end
349349

350350
#

lib/simplecov/load_global_config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
require "etc"
4-
home_dir = Dir.home || File.expand_path("~") || Etc.getpwuid.dir || (ENV.fetch("USER", nil) && File.expand_path("~#{ENV.fetch('USER', nil)}"))
4+
home_dir = (ENV.fetch("HOME", nil) && File.expand_path("~")) || Etc.getpwuid.dir || (ENV.fetch("USER", nil) && File.expand_path("~#{ENV.fetch('USER', nil)}"))
55
if home_dir
66
global_config_path = File.join(home_dir, ".simplecov")
77
load global_config_path if File.exist?(global_config_path)

simplecov.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Gem::Specification.new do |gem|
3333
"rubygems_mfa_required" => "true"
3434
}
3535

36-
gem.required_ruby_version = ">= 2.7.0"
36+
gem.required_ruby_version = ">= 2.5.0"
3737

3838
gem.add_dependency "docile", "~> 1.1"
3939
gem.add_dependency "simplecov-html", "~> 0.11"

test_projects/rails/rspec_rails/Gemfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ else
1313
gem "sqlite3", "~> 1.4"
1414
end
1515

16-
gem "nokogiri", "~> 1.13.10"
17-
1816
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
19-
gem "rails", "~> 6.1.4"
17+
gem "rails", "~> 6.1.0"
2018
# Use Puma as the app server
2119
gem "puma", "~> 5.0"
2220
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
@@ -41,7 +39,7 @@ end
4139

4240
group :test do
4341
# Adds support for Capybara system testing and selenium driver
44-
gem "capybara", ">= 3.36.0"
42+
gem "capybara", ">= 3.26"
4543
# 'selenium-webdriver' and 'webdrivers' did not work with Ruby 3.0 at the
4644
# moment this file was updated. Since they are not needed to run
4745
# SimpleCov's specs, they have been commented out

0 commit comments

Comments
 (0)