diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index e7bc6554..0a1b1a25 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -32,7 +32,7 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: [ '3.4', '3.3', '3.2', 'ruby-head' ] + ruby-version: [ '4.0', '3.4', '3.3', '3.2', 'ruby-head' ] gemfile: [ '8.1', '8.0', '7.2', 'edge' ] exclude: - ruby-version: 3.2 diff --git a/gemfiles/8.0.gemfile b/gemfiles/8.0.gemfile index 32cf900d..adbc130f 100644 --- a/gemfiles/8.0.gemfile +++ b/gemfiles/8.0.gemfile @@ -8,3 +8,4 @@ gem "mutex_m" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0") gem "propshaft" gem "rails", "~> 8.0.1" gem "sqlite3" +gem "json", "~> 2.21" diff --git a/lib/bootstrap_form.rb b/lib/bootstrap_form.rb index 5109147c..f98b1b7d 100644 --- a/lib/bootstrap_form.rb +++ b/lib/bootstrap_form.rb @@ -32,11 +32,10 @@ def deprecator end mattr_accessor :field_error_proc - # rubocop:disable Style/ClassVars + # rubocop:disable-next Style/ClassVars @@field_error_proc = proc do |html_tag, _instance_tag| html_tag end - # rubocop:enable Style/ClassVars end require "bootstrap_form/engine" if defined?(Rails) diff --git a/lib/bootstrap_form/inputs/collection_select.rb b/lib/bootstrap_form/inputs/collection_select.rb index c43091eb..38ad4bc1 100644 --- a/lib/bootstrap_form/inputs/collection_select.rb +++ b/lib/bootstrap_form/inputs/collection_select.rb @@ -8,7 +8,7 @@ module CollectionSelect included do # Disabling Metrics/ParameterLists because the upstream Rails method has the same parameters - # rubocop:disable Metrics/ParameterLists + # rubocop:disable-next Metrics/ParameterLists def collection_select_with_bootstrap(method, collection, value_method, text_method, options={}, html_options={}) html_options = html_options.reverse_merge(control_class: "form-select") form_group_builder(method, options, html_options) do @@ -17,7 +17,6 @@ def collection_select_with_bootstrap(method, collection, value_method, text_meth end end end - # rubocop:enable Metrics/ParameterLists bootstrap_alias :collection_select end diff --git a/lib/bootstrap_form/inputs/grouped_collection_select.rb b/lib/bootstrap_form/inputs/grouped_collection_select.rb index ab80d841..e0ba9948 100644 --- a/lib/bootstrap_form/inputs/grouped_collection_select.rb +++ b/lib/bootstrap_form/inputs/grouped_collection_select.rb @@ -8,7 +8,7 @@ module GroupedCollectionSelect included do # Disabling Metrics/ParameterLists because the upstream Rails method has the same parameters - # rubocop:disable Metrics/ParameterLists + # rubocop:disable-next Metrics/ParameterLists def grouped_collection_select_with_bootstrap(method, collection, group_method, group_label_method, option_key_method, option_value_method, options={}, html_options={}) @@ -21,7 +21,6 @@ def grouped_collection_select_with_bootstrap(method, collection, group_method, end end end - # rubocop:enable Metrics/ParameterLists bootstrap_alias :grouped_collection_select end diff --git a/lib/bootstrap_form/inputs/inputs_collection.rb b/lib/bootstrap_form/inputs/inputs_collection.rb index 9d742255..b1a57149 100644 --- a/lib/bootstrap_form/inputs/inputs_collection.rb +++ b/lib/bootstrap_form/inputs/inputs_collection.rb @@ -32,7 +32,7 @@ def group_label_class(field_layout) end # FIXME: Find a way to reduce the parameter list size - # rubocop:disable Metrics/ParameterLists + # rubocop:disable-next Metrics/ParameterLists def form_group_collection_input_options(options, text, obj, index, input_value, collection) input_options = options.merge(label: text.respond_to?(:call) ? text.call(obj) : obj.send(text)) if (checked = input_options[:checked]) @@ -46,7 +46,6 @@ def form_group_collection_input_options(options, text, obj, index, input_value, input_options.except!(:class) input_options end - # rubocop:enable Metrics/ParameterLists def form_group_collection_input_checked?(checked, obj, input_value) checked == input_value || Array(checked).try(:include?, input_value) || diff --git a/test/test_helper.rb b/test/test_helper.rb index da0547aa..aa9c3c47 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -2,7 +2,7 @@ ENV["RAILS_ENV"] ||= "test" -puts "BUNDLE_GEMFILE: #{ENV.fetch('BUNDLE_GEMFILE', nil)}" # rubocop:disable Rails/Output +puts "BUNDLE_GEMFILE: #{ENV.fetch('BUNDLE_GEMFILE', nil)}" require "warning" mail_gem_path = Gem::Specification.find_by_name("mail").full_gem_path