diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ab97a81..ab6f8e4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,9 +15,8 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@4c56a21280b36d862b5fc31348f463d60bdc55d5 # ruby/setup-ruby@v1 see https://github.com/ruby/setup-ruby/tree/v1 with: - ruby-version: 3.0 + ruby-version: 4.0 - name: Install dependencies run: bundle install - name: Run RuboCop against BASE..HEAD changes run: bundle exec rake rubocop:diff origin/${GITHUB_BASE_REF#*/} - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 34b2639..c12ac70 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,35 +8,20 @@ jobs: fail-fast: false matrix: ruby-version: - - '3.0' - - '3.1' - '3.2' - '3.3' - '3.4' + - '4.0' gemfile: - - gemfiles/Gemfile.rails61 - - gemfiles/Gemfile.rails70 - gemfiles/Gemfile.rails71 - gemfiles/Gemfile.rails72 - gemfiles/Gemfile.rails80 + - gemfiles/Gemfile.rails81 exclude: - # rails 6.1 requires ruby < 3.4 - - ruby-version: '3.4' - gemfile: 'gemfiles/Gemfile.rails61' - # rails 7.0 requires ruby >= 2.7, < 3.4 + # rails 8.1 requires ruby >= 3.2 # https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html - - ruby-version: '3.4' - gemfile: 'gemfiles/Gemfile.rails70' - # rails 7.2 requires ruby >= 3.1 - # https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html - - ruby-version: '3.0' - gemfile: 'gemfiles/Gemfile.rails72' - # rails 8.0 requires ruby >= 3.2 - # https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html - - ruby-version: '3.0' - gemfile: 'gemfiles/Gemfile.rails80' - ruby-version: '3.1' - gemfile: 'gemfiles/Gemfile.rails80' + gemfile: 'gemfiles/Gemfile.rails81' name: Ruby ${{ matrix.ruby-version }} / Bundle ${{ matrix.gemfile }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3ab9213..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: ruby -gemfile: -- gemfiles/Gemfile.rails52 -- gemfiles/Gemfile.rails60 -rvm: -- 2.5 -- 2.6 -- 2.7 -- 3.0 -jobs: - exclude: - - rvm: 3.0 - gemfile: gemfiles/Gemfile.rails52 -sudo: false -cache: bundler -before_install: -- gem update --system -- gem install bundler -script: -- bundle exec rake test -notifications: - slack: - rooms: - secure: ksrYmGtnp2oeGntby/qYoMEvrFh53BGTG1IUDbSpFOSgNjsqZxA0n7tvsbYg9030r7IVCtNFDK50RPjNVrKmkfNXK/xOL1D8qf03EJeeWs7OlEKooFfdU7TGnPMQwlnBmWGbe/gSosoq5XFuLYGUJTkNCOtLk1vorRq+r9fy44rnY1IK0EQbmbyiSk2VjZIiLp6SzjE2HxDrjwYNVB4bCVOp0+87lFXBPjLitXCmZ3gHC5Q++jZiJNZEIcwfqgeEIzCcqRc/Y9q6fEP58phL4N4DA10xBnpsn3kxIJFFmuu5D0J5obImTlEqHSLutafnV2vXwcSBuGz5IAXexGFjozgNDXIYEJUQl0vKCIq/4hLf2Ren2M1Rj6FgdS1DzNG9z/ItvJS1UJruniKI7aOinNsOe4hKTXM/Uc93pztHo0w/u7f+qb39xnHtvG+k+KRikrJ/jNMMg6GVgBu7PuL/gp1uyFac+TDyBIwUR3z/tOTwL8y9gDHqnP4col4WoXzcil/he4A1gs1agUFwdxhPTPnEHV5PKd3mZVd8QaZFsTidSVhFkJzxjhPT6OGgCPDhYYsv2S/J4OYEbUbzdRZCPdtS/zQocnGXtC7shQzc2ACRmFFtYdbIqqDzzERhPJGvg2yvzCMgOtNKjUyOge63zMhQZN04cKL5eR7S4kEnaJc= diff --git a/CHANGELOG.md b/CHANGELOG.md index a1bad18..311f24e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## [Unreleased] -* no unreleased changes * +### Fixed +* Support Rails 8.1, Ruby 4.0 ## 5.0.4 / 2025-10-22 ### Fixed diff --git a/gemfiles/Gemfile.rails61 b/gemfiles/Gemfile.rails61 deleted file mode 100644 index 8fdb206..0000000 --- a/gemfiles/Gemfile.rails61 +++ /dev/null @@ -1,12 +0,0 @@ -source 'https://rubygems.org' - -gemspec path: '..' - -gem 'rails', '~> 6.1.0' - -# Rails 6.1 does not support sqlite3 2.x; it specifies gem "sqlite3", "~> 1.4" -# in lib/active_record/connection_adapters/sqlite3_adapter.rb -gem 'sqlite3', '~> 1.7' - -# Latest concurrent-ruby breaks Rails < 7.1. See https://github.com/rails/rails/issues/54260 -gem 'concurrent-ruby', '1.3.4' diff --git a/gemfiles/Gemfile.rails70 b/gemfiles/Gemfile.rails70 deleted file mode 100644 index a35c58c..0000000 --- a/gemfiles/Gemfile.rails70 +++ /dev/null @@ -1,12 +0,0 @@ -source 'https://rubygems.org' - -gemspec path: '..' - -gem 'rails', '~> 7.0.0' - -# Rails 7.0 does not support sqlite3 2.x; it specifies gem "sqlite3", "~> 1.4" -# in lib/active_record/connection_adapters/sqlite3_adapter.rb -gem 'sqlite3', '~> 1.7' - -# Latest concurrent-ruby breaks Rails < 7.1. See https://github.com/rails/rails/issues/54260 -gem 'concurrent-ruby', '1.3.4' diff --git a/gemfiles/Gemfile.rails81 b/gemfiles/Gemfile.rails81 new file mode 100644 index 0000000..c268b54 --- /dev/null +++ b/gemfiles/Gemfile.rails81 @@ -0,0 +1,5 @@ +source 'https://rubygems.org' + +gemspec path: '..' + +gem 'rails', '~> 8.1.0' diff --git a/ndr_ui.gemspec b/ndr_ui.gemspec index 004b4a3..20dd2c2 100644 --- a/ndr_ui.gemspec +++ b/ndr_ui.gemspec @@ -1,11 +1,6 @@ $LOAD_PATH.push File.expand_path('lib', __dir__) require 'ndr_ui/version' -unless Gem::Version.new(Gem::VERSION) >= Gem::Version.new('3.0.2') - # See https://github.com/rubygems/rubygems/pull/2516 for details - raise 'Please update RubyGems to at least 3.0.2 - lower versions build a broken ndr_ui.gem!' -end - # We list development dependencies for all Rails versions here. # Rails version-specific dependencies can go in the relevant Gemfile. # rubocop:disable Gemspec/DevelopmentDependencies @@ -21,14 +16,14 @@ Gem::Specification.new do |spec| spec.license = 'MIT' spec.files = Dir['{app,config,lib,vendor}/**/*', 'CHANGELOG.md', 'CODE_OF_CONDUCT.md', - 'LICENSE.txt', 'Rakefile', 'README.md'] - ['.travis.yml'] + 'LICENSE.txt', 'Rakefile', 'README.md'] - spec.required_ruby_version = '>= 3.0.0' + spec.required_ruby_version = '>= 3.2.0' spec.add_dependency 'bootstrap', '~> 5.3.3' spec.add_dependency 'dartsass-sprockets' spec.add_dependency 'jquery-rails', '~> 4.6' - spec.add_dependency 'rails', '>= 6.1', '< 8.1' + spec.add_dependency 'rails', '>= 7.1', '< 8.2' spec.add_dependency 'sprockets', '>= 4.0' spec.add_dependency 'sprockets-rails', '>= 3.0.0' @@ -37,21 +32,8 @@ Gem::Specification.new do |spec| # cf. gemfiles/Gemfile.rails70 spec.add_development_dependency 'sqlite3' - # Workaround build issue on GitHub Actions with ruby <= 3.1 when installing sass-embedded - # gem version 1.81.0: NoMethodError: undefined method `parse' for # - # https://bugs.ruby-lang.org/issues/19371 - spec.add_development_dependency 'psych', '< 5' - - # Workaround build issue on GitHub Actions with ruby <= 3.1 when installing sass-embedded - # Versions 1.77.0 and above require ruby >= 3.2 for packaged x86_64-linux binaries - # but say they're compatible with ruby 3.1. - # 1.76.0 has a bug that was fixed in 1.77.1, which we can't use yet. - # https://github.com/sass/dart-sass/issues/2239 - spec.add_development_dependency 'sass-embedded', '~> 1.75.0' if RUBY_VERSION.start_with?('3.1') # rubocop:disable Gemspec/RubyVersionGlobalsUsage - - spec.add_development_dependency 'mocha', '~> 2.0' + spec.add_development_dependency 'mocha', '~> 3.0' spec.add_development_dependency 'ndr_dev_support', '>= 6.0' - spec.add_development_dependency 'net-smtp' spec.add_development_dependency 'pry' spec.add_development_dependency 'puma' spec.add_development_dependency 'rake' diff --git a/test/test_helper.rb b/test/test_helper.rb index fe8b739..ea7b975 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -15,11 +15,11 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } # Load fixtures from the engine -if ActiveSupport::TestCase.respond_to?(:fixture_path=) - ActiveSupport::TestCase.fixture_path = File.expand_path('../fixtures', __FILE__) - ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path - ActiveSupport::TestCase.fixtures :all -end +fixtures_dir = File.expand_path('fixtures', __dir__) +ActiveSupport::TestCase.fixture_paths << fixtures_dir # Rails >= 7.1 +ActionDispatch::IntegrationTest.fixture_paths << fixtures_dir +ActiveSupport::TestCase.file_fixture_path = "#{fixtures_dir}/files" +ActiveSupport::TestCase.fixtures :all # Include all capybara + poltergeist config ENV['INTEGRATION_DRIVER'] ||= 'chrome_headless'