minting 1.9.7 → 2.1.0

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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +298 -122
  3. data/Rakefile +2 -7
  4. data/doc/agents/api_review-2026-06-15.md +1 -1
  5. data/doc/agents/copilot-instructions.md +2 -2
  6. data/doc/agents/expired/copilot-instructions.md +2 -2
  7. data/doc/agents/expired/gemini_gem_evaluation.md +2 -2
  8. data/lib/minting/aliases.rb +22 -0
  9. data/lib/minting/currency/currency.rb +77 -94
  10. data/lib/minting/currency/registry.rb +134 -0
  11. data/lib/minting/currency/rounding.rb +47 -0
  12. data/lib/minting/data/crypto-currencies.yaml +126 -0
  13. data/lib/minting/mint/i18n.rb +79 -29
  14. data/lib/minting/mint/mint.rb +1 -26
  15. data/lib/minting/mint/registry/crypto.rb +59 -0
  16. data/lib/minting/mint/registry/registration.rb +1 -2
  17. data/lib/minting/mint/registry/registry.rb +9 -11
  18. data/lib/minting/mint/registry/symbols.rb +37 -30
  19. data/lib/minting/mint.rb +3 -2
  20. data/lib/minting/money/allocation/allocation.rb +2 -2
  21. data/lib/minting/money/allocation/split.rb +2 -2
  22. data/lib/minting/money/arithmetics/operators.rb +10 -13
  23. data/lib/minting/money/clamp.rb +6 -6
  24. data/lib/minting/money/coercion.rb +1 -1
  25. data/lib/minting/money/comparable.rb +3 -3
  26. data/lib/minting/money/constructors.rb +3 -42
  27. data/lib/minting/money/conversion.rb +22 -18
  28. data/lib/minting/money/format/format.rb +100 -0
  29. data/lib/minting/money/format/formatter.rb +110 -0
  30. data/lib/minting/money/format/to_s.rb +20 -102
  31. data/lib/minting/money/format/validator.rb +34 -0
  32. data/lib/minting/money/money.rb +25 -9
  33. data/lib/minting/money/parse.rb +127 -0
  34. data/lib/minting/money/rounding.rb +26 -0
  35. data/lib/minting/version.rb +1 -1
  36. data/lib/minting.rb +17 -8
  37. metadata +12 -31
  38. data/doc/Mint/Currency.html +0 -2032
  39. data/doc/Mint/Money.html +0 -5139
  40. data/doc/Mint/RangeStepPatch.html +0 -277
  41. data/doc/Mint/Registry.html +0 -863
  42. data/doc/Mint/Rounding.html +0 -506
  43. data/doc/Mint/UnknownCurrency.html +0 -138
  44. data/doc/Mint.html +0 -931
  45. data/doc/Minting.html +0 -142
  46. data/doc/Numeric.html +0 -479
  47. data/doc/String.html +0 -241
  48. data/doc/_index.html +0 -206
  49. data/doc/class_list.html +0 -54
  50. data/doc/css/common.css +0 -1
  51. data/doc/css/full_list.css +0 -206
  52. data/doc/css/style.css +0 -1089
  53. data/doc/file.README.html +0 -291
  54. data/doc/file_list.html +0 -59
  55. data/doc/frames.html +0 -22
  56. data/doc/index.html +0 -291
  57. data/doc/js/app.js +0 -801
  58. data/doc/js/full_list.js +0 -334
  59. data/doc/js/jquery.js +0 -4
  60. data/doc/method_list.html +0 -758
  61. data/doc/top-level-namespace.html +0 -135
  62. data/lib/minting/mint/aliases.rb +0 -16
  63. data/lib/minting/mint/parser/parser.rb +0 -97
  64. data/lib/minting/mint/parser/separators.rb +0 -41
  65. data/lib/minting/mint/rounding.rb +0 -65
  66. data/lib/minting/money/format/formatting.rb +0 -130
@@ -1,277 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>
7
- Module: Mint::RangeStepPatch
8
-
9
- &mdash; Documentation by YARD 0.9.44
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="../css/style.css" type="text/css">
14
-
15
- <link rel="stylesheet" href="../css/common.css" type="text/css">
16
-
17
- <script type="text/javascript">
18
- pathId = "Mint::RangeStepPatch";
19
- relpath = '../';
20
- </script>
21
-
22
-
23
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
-
25
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
-
27
-
28
- </head>
29
- <body>
30
- <div id="main_progress" aria-hidden="true"></div>
31
-
32
- <div class="nav_wrap">
33
- <iframe id="nav" src="../class_list.html?1"></iframe>
34
- <div id="resizer"></div>
35
- </div>
36
-
37
- <div id="main" tabindex="-1">
38
- <div id="header">
39
- <div id="menu">
40
-
41
- <a href="../_index.html">Index (R)</a> &raquo;
42
- <span class='title'><span class='object_link'><a href="../Mint.html" title="Mint (module)">Mint</a></span></span>
43
- &raquo;
44
- <span class="title">RangeStepPatch</span>
45
-
46
- </div>
47
-
48
- <div id="search">
49
-
50
- <a class="full_list_link" id="class_list_link"
51
- href="../class_list.html">
52
-
53
- <svg width="24" height="24">
54
- <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
55
- <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
56
- <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
57
- </svg>
58
- </a>
59
-
60
- </div>
61
- <div class="clear"></div>
62
- </div>
63
-
64
- <div id="content"><h1>Module: Mint::RangeStepPatch
65
-
66
-
67
- <span class="private note title">Private</span>
68
- </h1>
69
- <div class="box_info">
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
- <dl>
82
- <dt>Defined in:</dt>
83
- <dd>lib/minting/mint/dsl/range.rb
84
- </dd>
85
- </dl>
86
-
87
- </div>
88
-
89
- <h2>Overview</h2><div class="docstring">
90
- <div class="discussion">
91
- <p class="note private">
92
- <strong>This module is part of a private API.</strong>
93
- You should avoid using this module if possible, as it may be removed or be changed in the future.
94
- </p>
95
- <p>Ruby &lt; 4.0's Range#step calls rb_to_int on non-Numeric step arguments,
96
- which raises TypeError for Money objects. Ruby 4.0+ uses arithmetic
97
- iteration (+ / &lt;=&gt;) for non-numeric steps natively, so this patch is
98
- only needed on older Rubies.</p>
99
-
100
- </div>
101
- </div>
102
- <div class="tags">
103
-
104
-
105
- </div>
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
- <h2>
114
- Instance Method Summary
115
- <small><a href="#" class="summary_toggle">collapse</a></small>
116
- </h2>
117
-
118
- <ul class="summary">
119
-
120
- <li class="public ">
121
- <span class="summary_signature">
122
-
123
- <a href="#step-instance_method" title="#step (instance method)">#<strong>step</strong>(step_size = nil, &amp;block) &#x21d2; self, Enumerator </a>
124
-
125
-
126
-
127
- </span>
128
-
129
-
130
-
131
-
132
-
133
-
134
- <span class="private note title">private</span>
135
-
136
-
137
- <span class="summary_desc"><div class='inline'><p>Iterates over the range using a Money step value.</p></div></span>
138
-
139
- </li>
140
-
141
-
142
- </ul>
143
-
144
-
145
-
146
-
147
-
148
- <div id="instance_method_details" class="method_details_list">
149
- <h2>Instance Method Details</h2>
150
-
151
-
152
- <div class="method_details first">
153
- <h3 class="signature first" id="step-instance_method">
154
-
155
- #<strong>step</strong>(step_size = nil, &amp;block) &#x21d2; <tt>self</tt>, <tt>Enumerator</tt>
156
-
157
-
158
-
159
-
160
-
161
- </h3><div class="docstring">
162
- <div class="discussion">
163
- <p class="note private">
164
- <strong>This method is part of a private API.</strong>
165
- You should avoid using this method if possible, as it may be removed or be changed in the future.
166
- </p>
167
- <p>Iterates over the range using a Money step value.
168
- Overrides Range#step to handle Mint::Money step sizes on Ruby &lt; 4.0.</p>
169
-
170
- </div>
171
- </div>
172
- <div class="tags">
173
- <p class="tag_title">Parameters:</p>
174
- <ul class="param">
175
-
176
- <li>
177
-
178
- <span class='name'>step_size</span>
179
-
180
-
181
- <span class='type'>(<tt><span class='object_link'><a href="Money.html" title="Mint::Money (class)">Mint::Money</a></span></tt>, <tt>nil</tt>)</span>
182
-
183
-
184
- <em class="default">(defaults to: <tt>nil</tt>)</em>
185
-
186
-
187
- &mdash;
188
- <div class='inline'><p>step amount</p></div>
189
-
190
- </li>
191
-
192
- </ul>
193
-
194
- <p class="tag_title">Returns:</p>
195
- <ul class="return">
196
-
197
- <li>
198
-
199
-
200
- <span class='type'>(<tt>self</tt>, <tt>Enumerator</tt>)</span>
201
-
202
-
203
-
204
- &mdash;
205
- <div class='inline'><p>self if block given, Enumerator otherwise</p></div>
206
-
207
- </li>
208
-
209
- </ul>
210
- <p class="tag_title">Raises:</p>
211
- <ul class="raise">
212
-
213
- <li>
214
-
215
-
216
- <span class='type'>(<tt>TypeError</tt>)</span>
217
-
218
-
219
-
220
- </li>
221
-
222
- </ul>
223
-
224
- </div><table class="source_code">
225
- <tr>
226
- <td>
227
- <pre class="lines">
228
-
229
-
230
- 17
231
- 18
232
- 19
233
- 20
234
- 21
235
- 22
236
- 23
237
- 24
238
- 25
239
- 26
240
- 27
241
- 28
242
- 29</pre>
243
- </td>
244
- <td>
245
- <pre class="code"><span class="info file"># File 'lib/minting/mint/dsl/range.rb', line 17</span>
246
-
247
- <span class='kw'>def</span> <span class='id identifier rubyid_step'>step</span><span class='lparen'>(</span><span class='id identifier rubyid_step_size'>step_size</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
248
- <span class='kw'>return</span> <span class='kw'>super</span> <span class='kw'>unless</span> <span class='id identifier rubyid_step_size'>step_size</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../Mint.html" title="Mint (module)">Mint</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Money.html" title="Mint::Money (class)">Money</a></span></span><span class='rparen'>)</span>
249
-
250
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>TypeError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>can&#39;t iterate from NilClass</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_begin'>begin</span>
251
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>step can&#39;t be 0</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_step_size'>step_size</span><span class='period'>.</span><span class='id identifier rubyid_zero?'>zero?</span>
252
-
253
- <span class='kw'>if</span> <span class='id identifier rubyid_block'>block</span>
254
- <span class='id identifier rubyid_each_money_step'>each_money_step</span><span class='lparen'>(</span><span class='id identifier rubyid_step_size'>step_size</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
255
- <span class='kw'>self</span>
256
- <span class='kw'>else</span>
257
- <span class='const'>Enumerator</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_yielder'>yielder</span><span class='op'>|</span> <span class='id identifier rubyid_each_money_step'>each_money_step</span><span class='lparen'>(</span><span class='id identifier rubyid_step_size'>step_size</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='id identifier rubyid_yielder'>yielder</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_value'>value</span> <span class='rbrace'>}</span> <span class='rbrace'>}</span>
258
- <span class='kw'>end</span>
259
- <span class='kw'>end</span></pre>
260
- </td>
261
- </tr>
262
- </table>
263
- </div>
264
-
265
- </div>
266
-
267
- </div>
268
-
269
- <div id="footer">
270
- Generated on Wed Jul 1 01:11:52 2026 by
271
- <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
272
- 0.9.44 (ruby-4.0.5).
273
- </div>
274
-
275
- </div>
276
- </body>
277
- </html>