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

Pull in upstream changes #1

Open
wants to merge 122 commits into
base: master
Choose a base branch
from
Open

Pull in upstream changes #1

wants to merge 122 commits into from

Conversation

artfuldodger
Copy link

No description provided.

archanasingh and others added 30 commits April 11, 2017 20:15
Money.disallow_currency_conversion!
Money.new(0, 'USD') == Money.new(0, 'AUD') # => true

This is consistent with the already existing

Money.new(0, 'USD').eql? Money.new(0, 'AUD') # => true
Allow comparing cross currency when both are zero
* Adjusted attribute name in readme text

* Adjusted value of the attributes that were edited

* Adjusted attributes names in help text
* add Chinese Yuan Offshore (CNH)

* add disambiguate symbol for CNH
There’s no reason to perform coercion here since since the result isn’t
saved and Money#amounts_from_splits doesn’t perform coercion either.

See RubyMoney#725
Steps to reproduce the bug:
1. start a new ruby console
2. require 'money'; Money.zero(:usd); Money.zero

You will see the error
Fixes a vulnerability in older yard versions
mtmail and others added 30 commits August 17, 2018 22:53
I see no reason for locking at patch version and non-semver.
* Add Bitcoin Cash

Adding in Bitcoin cash to this gem to be useful for anyone using the gem and wishing to have all of the same advantages as any other currency.

* Update AUTHORS

* Update currency_non_iso.json

* added more test coverage
…ounts

Disallow initializing Money with non-finite amounts
* Add documentation for rounding mode.

Based on comments from RubyMoney#707

* Clarify the role of `infinite_precision` and how the `round` method works.
* Remove version constraint on Bundler gem

* Ensure Bundler is installed on CI agents

* Ensure Bundler version 1.17.3 is installed

For compatibility with legacy Ruby releases

* Pin i18n to v1.2 on Ruby 2.0, 2.1 and 2.2

* Loosen constraints on i18n gem

* Loosen constraints on Bundler version

We can remove this once we've stopped supporting legacy versions of
Ruby.
This leads to an error when attempting to allocate a zero value, and the
zero value is the first argument in parts.

Example:

```
[1] pry(main)> Money.new(100, "USD").allocate([1, 1, 0])
=> [#<Money fractional:50 currency:USD>, #<Money fractional:50 currency:USD>, #<Money fractional:0 currency:USD>]

[2] pry(main)> Money.new(100, "USD").allocate([0, 1, 1])
ZeroDivisionError: divided by 0

[3] pry(main)> Money.new(100, "USD").allocate([1, 1, 0.0])
=> [#<Money fractional:50 currency:USD>, #<Money fractional:50 currency:USD>, #<Money fractional:0 currency:USD>]

[4] pry(main)> Money.new(100, "USD").allocate([0.0, 1, 1])
FloatDomainError: NaN
```
* extract currency table concerns to own class
* remove thread safety things since they are causing more trouble
  than they are worth for us
* extract custom error classes
* also removes the strange initializing behavior in favor of something
  more straightforward
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.