From 48d05a6746bfcf193020c26a65b471aa526e1c76 Mon Sep 17 00:00:00 2001 From: Larry Reid Date: Wed, 12 Mar 2025 18:24:19 +0000 Subject: [PATCH] Test Rails 8.0 --- .github/workflows/ruby.yml | 2 +- Rakefile | 4 ++-- gemfiles/8.0.gemfile | 9 +++++++++ lib/bootstrap_form/inputs/check_box.rb | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 gemfiles/8.0.gemfile diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index af6718c8..d5b86537 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -33,7 +33,7 @@ jobs: fail-fast: false matrix: ruby-version: [ '3.4', '3.3', '3.2', 'ruby-head' ] - gemfile: [ '7.2', '7.1', 'edge' ] + gemfile: [ '8.0', '7.2', '7.1', 'edge' ] env: BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile steps: diff --git a/Rakefile b/Rakefile index 456e9006..b8ab3040 100644 --- a/Rakefile +++ b/Rakefile @@ -32,7 +32,6 @@ task default: %i[test rubocop:autocorrect] namespace :test do desc "Run tests for all supported Rails versions, with current Ruby version" task :all do - original_directory = Dir.pwd original_gemfile = ENV["BUNDLE_GEMFILE"] gemfiles = Dir.glob("gemfiles/*.gemfile").reject { |f| File.basename(f) == "common.gemfile" } gemfiles.each do |f| @@ -41,6 +40,7 @@ namespace :test do system("bundle exec rake test") end + original_directory = Dir.pwd Dir.chdir("demo") ENV.delete("BUNDLE_GEMFILE") system("bundle check") || system("bundle install") @@ -48,6 +48,6 @@ namespace :test do ensure original_gemfile.nil? ? ENV.delete("BUNDLE_GEMFILE") : ENV["BUNDLE_GEMFILE"] = original_gemfile - Dir.chdir(original_directory) + Dir.chdir(original_directory) unless original_directory.nil? end end diff --git a/gemfiles/8.0.gemfile b/gemfiles/8.0.gemfile new file mode 100644 index 00000000..656aa94c --- /dev/null +++ b/gemfiles/8.0.gemfile @@ -0,0 +1,9 @@ +gems = "#{__dir__}/common.gemfile" +eval File.read(gems), binding, gems # rubocop: disable Security/Eval + +gem "bigdecimal" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0") +gem "drb" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0") +gem "mutex_m" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0") +gem "rails", "~> 8.0.0" +gem "sprockets-rails", require: "sprockets/railtie" +gem "sqlite3" diff --git a/lib/bootstrap_form/inputs/check_box.rb b/lib/bootstrap_form/inputs/check_box.rb index eb2a2cff..3c44ec6c 100644 --- a/lib/bootstrap_form/inputs/check_box.rb +++ b/lib/bootstrap_form/inputs/check_box.rb @@ -63,7 +63,7 @@ def check_box_value(name, value) # label's `for` attribute needs to match checkbox tag's id, # IE sanitized value, IE # https://github.com/rails/rails/blob/5-0-stable/actionview/lib/action_view/helpers/tags/base.rb#L123-L125 - "#{name}_#{value.to_s.gsub(/\s/, '_').gsub(/[^-[[:word:]]]/, '').mb_chars.downcase}" + "#{name}_#{value.to_s.gsub(/\s/, '_').gsub(/[^-[[:word:]]]/, '').downcase}" end def check_box_classes(name, options)