Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Replace deprecated BigDecimal.new() calls with BigDecimal() #62

Merged
merged 2 commits into from
Feb 12, 2019

Conversation

rmacklin
Copy link
Contributor

After upgrading to ruby 2.6.1, our application started logging this warning:

warning: BigDecimal.new is deprecated; use BigDecimal() method instead.

which was being emitted from roxml-4.0.0/lib/roxml/definition.rb:179:

BigDecimal.new(v) unless v.blank?

So, in this PR I've replaced the deprecated BigDecimal.new invocations with invoking the BigDecimal method as recommended.

This fixes this error:
```
Your bundle is locked to psych (3.0.0), but that version could not be
found in any of the sources listed in your Gemfile. If you haven't
changed sources, that means the author of psych (3.0.0) has removed it.
You'll need to update your bundle to a version other than psych (3.0.0)
that hasn't been removed in order to install.
```
which happened because psych 3.0.0 was yanked from rubygems:
https://rubygems.org/gems/psych/versions
After upgrading to ruby 2.6.1, our application started logging this
warning:
```
warning: BigDecimal.new is deprecated; use BigDecimal() method instead.
```
which was being emitted from roxml-4.0.0/lib/roxml/definition.rb:179

So, in this commit I've replaced the deprecated `BigDecimal.new`
invocations with invoking the `BigDecimal` method as recommended.
@rmacklin rmacklin force-pushed the fix-BigDecimal-deprecation branch from 865e3fa to 7fceacc Compare February 11, 2019 23:44
@rmacklin
Copy link
Contributor Author

The only Travis failure is in the ruby-head build:

Could not find 'bundler' (1.16.0) required by your /home/travis/build/Empact/roxml/Gemfile.lock. (Gem::GemNotFoundException)

This seems unrelated, and the other builds passed. That said, it might be a good idea to test this gem against more recent ruby versions (potentially replacing the ruby 2.2 and 2.3 builds with ruby 2.5 and 2.6), but we can leave that for another PR.

@lostapathy lostapathy merged commit 0d6fd8e into Empact:master Feb 12, 2019
@lostapathy
Copy link
Collaborator

Thanks! I will work on another PR to get the ruby versions in .travis.yml up to date.

@rmacklin
Copy link
Contributor Author

Thanks for merging this @lostapathy! I added a comment on your PR to update .travis.yml (#63).

Are you able to publish a new patch version with this change?

@rmacklin rmacklin deleted the fix-BigDecimal-deprecation branch February 12, 2019 19:41
@rmacklin rmacklin restored the fix-BigDecimal-deprecation branch February 12, 2019 19:41
@lostapathy
Copy link
Collaborator

sorry @rmacklin I do not have access to cut and push a new gem version. We'll have to wait for @Empact for that.

@rmacklin
Copy link
Contributor Author

Gotcha, thanks.

@rmacklin rmacklin deleted the fix-BigDecimal-deprecation branch June 9, 2020 20:25
@rmacklin rmacklin restored the fix-BigDecimal-deprecation branch June 9, 2020 22:55
@rmacklin rmacklin deleted the fix-BigDecimal-deprecation branch June 30, 2020 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants