minting 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/Rakefile +8 -1
- data/lib/minting/data/currencies.yaml +359 -117
- data/lib/minting/mint/currency.rb +6 -4
- data/lib/minting/mint/registry.rb +53 -15
- data/lib/minting/money/allocation.rb +20 -2
- data/lib/minting/money/arithmetics.rb +37 -2
- data/lib/minting/money/coercion.rb +14 -3
- data/lib/minting/money/comparable.rb +9 -12
- data/lib/minting/money/conversion.rb +24 -1
- data/lib/minting/money/formatting.rb +3 -1
- data/lib/minting/money/money.rb +22 -14
- data/lib/minting/version.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ef2574a0bffcbccb882faba1a839ef37369e047b23becf1ce405d2c1b883322a
|
|
4
|
+
data.tar.gz: 19ec197c01ceb083a2f6dcf2c6898b38f80ba7679749154b74b3d9fb2f2ffeda
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e8680da52ba5417cbe89f2c36615247fa1cc7302088c7d087aa782b6d1958bcd124a38f2b1027cd164810f9f04b02974cf8ac68cb61047d204c9189bf1943a6d
|
|
7
|
+
data.tar.gz: e85e786f6cb1f98b10e75742097651013e9fe57ddad4896a70fd85b836709e2eecfe26d0f0854b05423f931b1b5fc17b46dfa63c0e25f1a86ffa024de3748d05
|
data/README.md
CHANGED
|
@@ -105,15 +105,15 @@ ten.allocate([1, 2, 3]) #=> [[USD 1.67], [USD 3.33], [USD 5.00]]
|
|
|
105
105
|
|
|
106
106
|
## API notes
|
|
107
107
|
|
|
108
|
-
**Module names** — Require the `minting` gem; the public API lives under `Mint
|
|
108
|
+
**Module names** — Require the `minting` gem; the public API lives under `Mint`.
|
|
109
109
|
|
|
110
|
-
**Exact amounts** — Amounts are stored as `Rational` and rounded to the currency subunit.
|
|
110
|
+
**Exact amounts** — Amounts are stored as `Rational` and rounded to the currency subunit.
|
|
111
111
|
|
|
112
112
|
**Refinements** — `10.dollars` and similar helpers require `using Mint` in the current scope (see Usage above).
|
|
113
113
|
|
|
114
114
|
**Division** — `money / 5` returns new `Money`; `money / other_money` returns a numeric ratio, not money.
|
|
115
115
|
|
|
116
|
-
**Zero equality** — `Mint.money(0, 'USD') == Mint.money(0, 'EUR')` is intentionally `true`. Non-zero amounts must match currency and value.
|
|
116
|
+
**Zero equality** — Any zero amount is considered equal across currencies and to numeric zero `Mint.money(0, 'USD') == Mint.money(0, 'EUR')` is intentionally `true`. Non-zero amounts must match currency and value.
|
|
117
117
|
|
|
118
118
|
**Custom currencies** — `Mint.register_currency` returns the existing entry if the code is already registered; use `register_currency!` to detect duplicates.
|
|
119
119
|
|
data/Rakefile
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
require 'bundler/gem_tasks'
|
|
2
2
|
require 'rubocop/rake_task'
|
|
3
3
|
require 'rake/testtask'
|
|
4
|
+
require 'yard'
|
|
4
5
|
|
|
5
|
-
CLOBBER.include %w[tmp]
|
|
6
|
+
CLOBBER.include %w[doc tmp .yardoc]
|
|
6
7
|
|
|
7
8
|
Rake::TestTask.new(:test) do |t|
|
|
8
9
|
t.libs << 'test'
|
|
@@ -39,4 +40,10 @@ task 'bench:all' => ['bench', 'bench:performance']
|
|
|
39
40
|
|
|
40
41
|
RuboCop::RakeTask.new(:cop)
|
|
41
42
|
|
|
43
|
+
YARD::Rake::YardocTask.new do |t|
|
|
44
|
+
t.files = ['lib/**/*.rb'] # optional
|
|
45
|
+
t.options = [] # optional
|
|
46
|
+
t.stats_options = ['--list-undoc'] # optional
|
|
47
|
+
end
|
|
48
|
+
|
|
42
49
|
task default: :test
|