diff --git a/Gemfile b/Gemfile index 6e8075b..691118b 100644 --- a/Gemfile +++ b/Gemfile @@ -27,18 +27,24 @@ group :development, :test do gem 'railties' # running documentation generation tasks and rspec tasks gem 'rake' - # Used for Sql Lite Db - gem 'sqlite3', '~> 1.7' # provides a complete suite of testing facilities supporting TDD, BDD, mocking, and benchmarking. gem "minitest" gem 'rspec-rails' # defines time zones for activesupport. Must be explicit since it is normally implicit with activerecord gem 'tzinfo' + + rails_version = ENV['RAILS_VERSION'].to_s[/\d+(?:\.\d+){0,2}/] + sqlite3_requirements = if rails_version && rails_version.split('.').first.to_i < 8 + ['~> 1.4'] + else + ['>= 2.1', '< 3.0'] + end + gem 'sqlite3', *sqlite3_requirements end group :test do # Test the 'Metasploit::Concern.run' shared example - gem 'aruba' + gem 'aruba', '~> 2.3' # Test the 'Metasploit::Concern.run' shared example gem 'cucumber' # add matchers from shoulda, such as validates_presence_of, which are useful for testing validations diff --git a/lib/metasploit/concern/version.rb b/lib/metasploit/concern/version.rb index 3359962..4d2371c 100644 --- a/lib/metasploit/concern/version.rb +++ b/lib/metasploit/concern/version.rb @@ -1,7 +1,7 @@ module Metasploit module Concern # VERSION is managed by GemRelease - VERSION = '5.0.5' + VERSION = '5.0.6' # @return [String] # diff --git a/metasploit-concern.gemspec b/metasploit-concern.gemspec index 3ac2493..d3f0c87 100644 --- a/metasploit-concern.gemspec +++ b/metasploit-concern.gemspec @@ -26,10 +26,13 @@ Gem::Specification.new do |s| # uses ActiveSupport.on_load to include concerns # it is only defined in version 3.0.0 and newer - s.add_runtime_dependency 'activemodel', '~> 7.0' - s.add_runtime_dependency 'activesupport', '~> 7.0' + # Rails 8.0 upgrade: widened from '~> 7.0' (which means >= 7.0, < 8.0) to + # '>= 7.0', '< 8.1' so this gem resolves with both Rails 7.x and 8.0. + # The old pessimistic constraint hard-blocked Bundler from pulling Rails 8. + s.add_runtime_dependency 'activemodel', '>= 7.0', '< 8.1' + s.add_runtime_dependency 'activesupport', '>= 7.0', '< 8.1' # for engine - s.add_runtime_dependency 'railties', '~> 7.0' + s.add_runtime_dependency 'railties', '>= 7.0', '< 8.1' s.add_runtime_dependency 'zeitwerk' # Standard libraries: https://www.ruby-lang.org/en/news/2023/12/25/ruby-3-3-0-released/ diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index 790d85e..664c7ac 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -44,8 +44,6 @@ class Application < Rails::Application config.paths.add 'app/concerns', autoload: true - config.autoloader = :zeitwerk - initializer :metasploit_concern_test_reloading, before: :setup_main_autoloader do Rails.autoloaders.each do |loader| loader.enable_reloading