Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fail-fast: false
matrix:
activesupport: ['6.1', '7.0', '7.1', '7.2']
ruby: ['3.1', '3.2', '3.3']
ruby: ['3.1', '3.2', '3.3', '3.4']
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.3
3.4.2
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ group :development, :test do
gem 'simplecov', '~> 0.16'
end

# Required for combination of old activesupport (< 7.1) and new ruby (> 3.3)
gem 'base64'
gem 'bigdecimal'

if (version = ENV['ACTIVESUPPORT'])
gem 'activesupport', "~> #{version}.0"
end
2 changes: 1 addition & 1 deletion ja2r.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.homepage = 'https://github.com/mkon/ja2r'
s.summary = 'Simple JSON-API to ruby object conversion'
s.license = 'MIT'
s.required_ruby_version = '>= 3.1', '< 3.4'
s.required_ruby_version = '>= 3.1', '< 3.5'

s.files = Dir['{app,config,db,lib}/**/*', 'LICENSE', 'README.md']

Expand Down
2 changes: 2 additions & 0 deletions lib/ja2r.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'logger' # Required for combination of old activesupport (< 7.1) and new ruby (> 3.3)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if someone uses old activesupport with new ruby they should require logger themself. It's not our dependency so we cannot require it.

Copy link
Contributor Author

@klausmeyer klausmeyer Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree.

I'm just adding this here to have the test matrix pass in that combination.

This happens when I remove it:

[ kmeyer at AM-FVFHF184Q05N in ja2r ] ruby-3.4.2@ja2r (branch:ruby-3.4*)
» ruby -v
ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [arm64-darwin24]
[ kmeyer at AM-FVFHF184Q05N in ja2r ] ruby-3.4.2@ja2r (branch:ruby-3.4*)
» bundle list | grep activesupport
  * activesupport (6.1.7.10)
[ kmeyer at AM-FVFHF184Q05N in ja2r ] ruby-3.4.2@ja2r (branch:ruby-3.4*)
» bundle exec rspec

An error occurred while loading spec_helper.
Failure/Error: require 'active_support'

NameError:
  uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger
# /Users/kmeyer/.rvm/gems/ruby-3.4.2@ja2r/gems/activesupport-6.1.7.10/lib/active_support/logger_thread_safe_level.rb:16:in '<module:LoggerThreadSafeLevel>'
# /Users/kmeyer/.rvm/gems/ruby-3.4.2@ja2r/gems/activesupport-6.1.7.10/lib/active_support/logger_thread_safe_level.rb:9:in '<module:ActiveSupport>'
# /Users/kmeyer/.rvm/gems/ruby-3.4.2@ja2r/gems/activesupport-6.1.7.10/lib/active_support/logger_thread_safe_level.rb:8:in '<top (required)>'
# /Users/kmeyer/.rvm/gems/ruby-3.4.2@ja2r/gems/activesupport-6.1.7.10/lib/active_support/logger_silence.rb:5:in '<top (required)>'
# /Users/kmeyer/.rvm/gems/ruby-3.4.2@ja2r/gems/activesupport-6.1.7.10/lib/active_support/logger.rb:3:in '<top (required)>'
# /Users/kmeyer/.rvm/gems/ruby-3.4.2@ja2r/gems/activesupport-6.1.7.10/lib/active_support.rb:29:in '<top (required)>'
# ./lib/ja2r.rb:1:in '<top (required)>'
# ./spec/spec_helper.rb:5:in '<top (required)>'
No examples found.

Finished in 0.00002 seconds (files took 0.12414 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

Do you have another idea how to solve it? Should we blacklist some combinations in the test-matrix or maybe drop old active-support versions?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can maybe put it in the Gemfile (above gemspec), then it should be required automatically.
Alternatively just put the require in the spec helper also above Bundler.require

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright. I've added it to the Gemfile. With just requiring it manually it printed a warning as the gem will no longer be part of the default gems starting from Ruby 3.5


require 'active_support'
require 'active_support/core_ext/array'
require 'active_support/core_ext/hash'
Expand Down