Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Please revert/remove/fix the conditional inclusion of bigdecimal in gemspec #1085

Closed
tagliala opened this issue Mar 13, 2024 · 0 comments · Fixed by #1087
Closed

Please revert/remove/fix the conditional inclusion of bigdecimal in gemspec #1085

tagliala opened this issue Mar 13, 2024 · 0 comments · Fixed by #1087

Comments

@tagliala
Copy link
Contributor

s.add_dependency "bigdecimal", "~> 3.1" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('6.19.0')

  • This is checking for Ruby version > 6.19, but I guess it wanted to check for money version itself.
  • (IIRC) It is not a good practice to add conditionals in the gemspec, since this will be also evaluated on rubygems.org, regardless of RUBY version
  • Removing the conditional works for all specified ruby versions, back to Ruby 2.3. It will install bigdecimal 1.4.4 and work
$ rake
~/.rvm/rubies/ruby-2.3.8/bin/ruby -w -I/~/.rvm/gems/ruby-2.3.8/gems/rspec-core-3.13.0/lib:/~/.rvm/gems/ruby-2.3.8/gems/rspec-support-3.13.1/lib /~/.rvm/gems/ruby-2.3.8/gems/rspec-core-3.13.0/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}

Randomized with seed 16175
..................................................................................................................................................................................................................................................................[WARNING] Using :ruby format when importing rates is potentially unsafe and might lead to remote code execution via Marshal.load deserializer. Consider using safe alternatives such as :json and :yaml.
..................../~/dev/money/spec/rates_store/memory_spec.rb:59: warning: instance variable @index not initialized
/~/dev/money/spec/rates_store/memory_spec.rb:59: warning: instance variable @index not initialized
........................................................................................................................................................................................................................................

Finished in 0.15704 seconds (files took 0.42982 seconds to load)
510 examples, 0 failures

Randomized with seed 16175

tagliala added a commit to tagliala/money that referenced this issue Mar 13, 2024
- bigdecimal installs and works fine on all supported ruby versions
- The condition was checking for ruby version to be greater than 6.19,
  which will not happen soon
- The condition is also evaluated on `rubygems`, and it is not correct

Close RubyMoney#1085
tagliala added a commit to tagliala/money that referenced this issue Mar 13, 2024
- bigdecimal installs and works fine on all supported ruby versions
- The condition was checking for ruby version to be greater than 6.19,
  which will not happen soon
- The condition is also evaluated on `rubygems`, and it is not correct

Close RubyMoney#1085
tagliala added a commit to tagliala/money that referenced this issue Mar 13, 2024
- bigdecimal installs and works fine on all supported ruby versions
- The condition was checking for ruby version to be greater than 6.19,
  which will not happen soon
- The condition is also evaluated on `rubygems`, and it is not correct

Close RubyMoney#1085
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant