Skip to content

Commit afea507

Browse files
committed
Drop EOL Ruby versions (< 3.1)
1 parent 6045632 commit afea507

File tree

11 files changed

+16
-23
lines changed

11 files changed

+16
-23
lines changed

.github/workflows/eslint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Node
2020
uses: actions/setup-node@v4
2121
with:
22-
node-version: '18'
22+
node-version: '22'
2323
- name: Install node dependencies
2424
run: pnpm install
2525
- name: Run JavaScript linter

.github/workflows/javascript.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Set up Node
2525
uses: actions/setup-node@v4
2626
with:
27-
node-version: '18'
27+
node-version: '22'
2828
- name: Install node dependencies
2929
run: pnpm install
3030
- name: Run tests

.github/workflows/ruby.yml

+1-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3']
18+
ruby-version: ['3.1', '3.2', '3.3']
1919
gemfile: [rails_6.1, rails_7.0, rails_7.1, rails_7.2, rails_8.0]
2020
channel: ['stable']
2121

@@ -40,14 +40,6 @@ jobs:
4040
channel: 'experimental'
4141

4242
exclude:
43-
- ruby-version: '2.7'
44-
gemfile: rails_7.2
45-
- ruby-version: '2.7'
46-
gemfile: rails_8.0
47-
- ruby-version: '3.0'
48-
gemfile: rails_7.2
49-
- ruby-version: '3.0'
50-
gemfile: rails_8.0
5143
- ruby-version: '3.1'
5244
gemfile: rails_8.0
5345
- ruby-version: '3.2'

.rubocop.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require:
77

88
AllCops:
99
TargetRailsVersion: 6.1
10-
TargetRubyVersion: 2.7
10+
TargetRubyVersion: 3.1
1111
NewCops: enable
1212
DisplayStyleGuide: true
1313
ExtraDetails: true

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- `data-validate` => `data-csv-validate`
99
* [FEATURE] Use data attributes instead of `jQuery.data()`
1010
* [FEATURE] Drop Internet Explorer and other older browsers support
11+
* [FEATURE] Drop Ruby < 3.1
1112
* [ENHANCEMENT] Update QUnit to 2.23.0
1213

1314
## 22.3.0 / 2024-11-12

Rakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace :test do
1616
desc %(Test Ruby code)
1717
Rake::TestTask.new(:ruby) do |test|
1818
test.libs << 'lib' << 'test'
19-
test.test_files = Dir.glob("#{__dir__}/test/**/test_*.rb").sort
19+
test.test_files = Dir.glob("#{__dir__}/test/**/test_*.rb")
2020
test.warning = false
2121
end
2222

client_side_validations.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
2525
spec.require_paths = ['lib']
2626

2727
spec.platform = Gem::Platform::RUBY
28-
spec.required_ruby_version = '>= 2.7'
28+
spec.required_ruby_version = '>= 3.1'
2929

3030
spec.add_dependency 'js_regex', '~> 3.7'
3131
spec.add_dependency 'rails', '>= 6.1'

lib/client_side_validations/action_view/form_builder.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def collection_select(method, collection, value_method, text_method, options = {
7373
super
7474
end
7575

76-
def fields_for(record_name, record_object = nil, fields_options = {}, &block)
76+
def fields_for(record_name, record_object = nil, fields_options = {}, &)
7777
if record_object.is_a?(Hash) && record_object.extractable_options?
7878
fields_options = record_object
7979
record_object = nil
@@ -106,7 +106,7 @@ def radio_button(method, tag_value, options = {})
106106
super
107107
end
108108

109-
def select(method, choices = nil, options = {}, html_options = {}, &block)
109+
def select(method, choices = nil, options = {}, html_options = {}, &)
110110
build_validation_options(method, html_options.merge(name: options[:name]))
111111
html_options.delete(:validate)
112112
super

lib/client_side_validations/action_view/form_helper.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ def apply_csv_form_for_options!(record, object, options)
4848
end
4949
end
5050

51-
def fields_for(record_name, record_object = nil, options = {}, &block)
51+
def fields_for(record_name, record_object = nil, options = {}, &)
5252
# Order matters here. Rails mutates the `options` object
5353
builder = instantiate_builder(record_name, record_object, options)
54-
output = capture(builder, &block)
54+
output = capture(builder, &)
5555

5656
build_bound_validators! options
5757

lib/client_side_validations/action_view/form_with_helper.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ def check_model(url, model, format, scope)
3131
[url, model, scope]
3232
end
3333

34-
def form_tag_with_validators(scope, model, options, url, &block)
34+
def form_tag_with_validators(scope, model, options, url, &)
3535
@validators = {}
3636

3737
builder = instantiate_builder(scope, model, options)
38-
output = capture(builder, &block)
38+
output = capture(builder, &)
3939
options[:multipart] ||= builder.multipart?
4040

4141
build_bound_validators! options

test/action_view/cases/helper.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def snowman(method = nil)
147147
end
148148

149149
def form_field(tag, id: nil, name: nil, type: nil, value: nil, multiple: false, tag_content: nil, custom_name: nil)
150-
txt = +%(<#{tag})
150+
txt = %(<#{tag})
151151

152152
txt << %( name="#{custom_name}") if custom_name
153153
txt << %( type="#{type}") if type
@@ -167,7 +167,7 @@ def form_field(tag, id: nil, name: nil, type: nil, value: nil, multiple: false,
167167
end
168168

169169
def form_for_text(action = 'http://www.example.com', id = nil, html_class = nil, remote = nil, validators = nil, file = nil)
170-
txt = +%(<form action="#{action}" accept-charset="UTF-8" method="post")
170+
txt = %(<form action="#{action}" accept-charset="UTF-8" method="post")
171171

172172
if validators
173173
txt << %( data-client-side-validations="#{CGI.escapeHTML(csv_data_attribute(validators))}")
@@ -196,7 +196,7 @@ def whole_form_for(action = 'http://www.example.com', id = nil, html_class = nil
196196
end
197197

198198
def form_with_text(action = 'http://www.example.com', id = nil, html_class = nil, local = nil, validators = nil, file = nil)
199-
txt = +%(<form action="#{action}" accept-charset="UTF-8" method="post")
199+
txt = %(<form action="#{action}" accept-charset="UTF-8" method="post")
200200

201201
if validators
202202
txt << %( data-client-side-validations="#{CGI.escapeHTML(csv_data_attribute(validators))}")

0 commit comments

Comments
 (0)