exchange 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -6
- data/README.rdoc +1 -1
- data/html.html +1 -0
- data/iso4217.yml +418 -256
- data/iso4217_country_map.yml +493 -0
- data/lib/exchange.rb +1 -1
- data/lib/exchange/base.rb +1 -1
- data/lib/exchange/cache/configuration.rb +32 -1
- data/lib/exchange/cache/memcached.rb +8 -0
- data/lib/exchange/cache/redis.rb +9 -1
- data/lib/exchange/configurable.rb +6 -1
- data/lib/exchange/core_extensions/float/error_safe.rb +1 -1
- data/lib/exchange/core_extensions/numeric/conversability.rb +1 -5
- data/lib/exchange/{iso_4217.rb → iso.rb} +71 -30
- data/lib/exchange/money.rb +12 -7
- data/lib/exchange/typecasting.rb +5 -5
- data/spec/exchange/cache/configuration_spec.rb +38 -0
- data/spec/exchange/cache/memcached_spec.rb +10 -0
- data/spec/exchange/core_extensions/numeric/conversability_spec.rb +3 -3
- data/spec/exchange/iso_spec.rb +795 -0
- data/spec/exchange/money_spec.rb +32 -13
- metadata +77 -93
- data/spec/exchange/iso_4217_spec.rb +0 -233
@@ -0,0 +1,493 @@
|
|
1
|
+
---
|
2
|
+
AF: :afn
|
3
|
+
AFG: :afn
|
4
|
+
AL: :all
|
5
|
+
ALB: :all
|
6
|
+
DZ: :dzd
|
7
|
+
DZA: :dzd
|
8
|
+
AS: :usd
|
9
|
+
ASM: :usd
|
10
|
+
AD: :eur
|
11
|
+
AND: :eur
|
12
|
+
AO: :aoa
|
13
|
+
AGO: :aoa
|
14
|
+
AI: :xcd
|
15
|
+
AIA: :xcd
|
16
|
+
AG: :xcd
|
17
|
+
ATG: :xcd
|
18
|
+
AR: :ars
|
19
|
+
ARG: :ars
|
20
|
+
AM: :amd
|
21
|
+
ARM: :amd
|
22
|
+
AW: :awg
|
23
|
+
ABW: :awg
|
24
|
+
AU: :aud
|
25
|
+
AUS: :aud
|
26
|
+
AT: :eur
|
27
|
+
AUT: :eur
|
28
|
+
AZ: :azn
|
29
|
+
AZE: :azn
|
30
|
+
BS: :bsd
|
31
|
+
BHS: :bsd
|
32
|
+
BH: :bhd
|
33
|
+
BHR: :bhd
|
34
|
+
BD: :bdt
|
35
|
+
BGD: :bdt
|
36
|
+
BB: :bbd
|
37
|
+
BRB: :bbd
|
38
|
+
BY: :byr
|
39
|
+
BLR: :byr
|
40
|
+
BE: :eur
|
41
|
+
BEL: :eur
|
42
|
+
BZ: :bzd
|
43
|
+
BLZ: :bzd
|
44
|
+
BJ: :xof
|
45
|
+
BEN: :xof
|
46
|
+
BM: :bmd
|
47
|
+
BMU: :bmd
|
48
|
+
BT: :btn
|
49
|
+
BTN: :btn
|
50
|
+
BO: :bov
|
51
|
+
BOL: :bov
|
52
|
+
BQ: :usd
|
53
|
+
BES: :usd
|
54
|
+
BA: :bam
|
55
|
+
BIH: :bam
|
56
|
+
BW: :bwp
|
57
|
+
BWA: :bwp
|
58
|
+
BV: :nok
|
59
|
+
BVT: :nok
|
60
|
+
BR: :brl
|
61
|
+
BRA: :brl
|
62
|
+
IO: :usd
|
63
|
+
IOT: :usd
|
64
|
+
BN: :bnd
|
65
|
+
BRN: :bnd
|
66
|
+
BG: :bgn
|
67
|
+
BGR: :bgn
|
68
|
+
BF: :xof
|
69
|
+
BFA: :xof
|
70
|
+
BI: :bif
|
71
|
+
BDI: :bif
|
72
|
+
KH: :khr
|
73
|
+
KHM: :khr
|
74
|
+
CM: :xaf
|
75
|
+
CMR: :xaf
|
76
|
+
CA: :cad
|
77
|
+
CAN: :cad
|
78
|
+
CV: :cve
|
79
|
+
CPV: :cve
|
80
|
+
KY: :kyd
|
81
|
+
CYM: :kyd
|
82
|
+
CF: :xaf
|
83
|
+
CAF: :xaf
|
84
|
+
TD: :xaf
|
85
|
+
TCD: :xaf
|
86
|
+
CL: :clf
|
87
|
+
CHL: :clf
|
88
|
+
CN: :cny
|
89
|
+
CHN: :cny
|
90
|
+
CX: :aud
|
91
|
+
CXR: :aud
|
92
|
+
CC: :aud
|
93
|
+
CCK: :aud
|
94
|
+
CO: :cou
|
95
|
+
COL: :cou
|
96
|
+
KM: :kmf
|
97
|
+
COM: :kmf
|
98
|
+
CG: :xaf
|
99
|
+
COG: :xaf
|
100
|
+
CD: :cdf
|
101
|
+
COD: :cdf
|
102
|
+
CK: :nzd
|
103
|
+
COK: :nzd
|
104
|
+
CR: :crc
|
105
|
+
CRI: :crc
|
106
|
+
HR: :hrk
|
107
|
+
HRV: :hrk
|
108
|
+
CU: :cuc
|
109
|
+
CUB: :cuc
|
110
|
+
CW: :ang
|
111
|
+
CUW: :ang
|
112
|
+
CY: :eur
|
113
|
+
CYP: :eur
|
114
|
+
CZ: :czk
|
115
|
+
CZE: :czk
|
116
|
+
CI: :xof
|
117
|
+
CIV: :xof
|
118
|
+
DK: :dkk
|
119
|
+
DNK: :dkk
|
120
|
+
DJ: :djf
|
121
|
+
DJI: :djf
|
122
|
+
DM: :xcd
|
123
|
+
DMA: :xcd
|
124
|
+
DO: :dop
|
125
|
+
DOM: :dop
|
126
|
+
EC: :usd
|
127
|
+
ECU: :usd
|
128
|
+
EG: :egp
|
129
|
+
EGY: :egp
|
130
|
+
SV: :usd
|
131
|
+
SLV: :usd
|
132
|
+
GQ: :xaf
|
133
|
+
GNQ: :xaf
|
134
|
+
ER: :ern
|
135
|
+
ERI: :ern
|
136
|
+
EE: :eur
|
137
|
+
EST: :eur
|
138
|
+
ET: :etb
|
139
|
+
ETH: :etb
|
140
|
+
FK: :fkp
|
141
|
+
FLK: :fkp
|
142
|
+
FO: :dkk
|
143
|
+
FRO: :dkk
|
144
|
+
FJ: :fjd
|
145
|
+
FJI: :fjd
|
146
|
+
FI: :eur
|
147
|
+
FIN: :eur
|
148
|
+
FR: :eur
|
149
|
+
FRA: :eur
|
150
|
+
GF: :eur
|
151
|
+
GUF: :eur
|
152
|
+
PF: :xpf
|
153
|
+
PYF: :xpf
|
154
|
+
TF: :eur
|
155
|
+
ATF: :eur
|
156
|
+
GA: :xaf
|
157
|
+
GAB: :xaf
|
158
|
+
GM: :gmd
|
159
|
+
GMB: :gmd
|
160
|
+
GE: :gel
|
161
|
+
GEO: :gel
|
162
|
+
DE: :eur
|
163
|
+
DEU: :eur
|
164
|
+
GH: :ghs
|
165
|
+
GHA: :ghs
|
166
|
+
GI: :gip
|
167
|
+
GIB: :gip
|
168
|
+
GR: :eur
|
169
|
+
GRC: :eur
|
170
|
+
GL: :dkk
|
171
|
+
GRL: :dkk
|
172
|
+
GD: :xcd
|
173
|
+
GRD: :xcd
|
174
|
+
GP: :eur
|
175
|
+
GLP: :eur
|
176
|
+
GU: :usd
|
177
|
+
GUM: :usd
|
178
|
+
GT: :gtq
|
179
|
+
GTM: :gtq
|
180
|
+
GG: :gbp
|
181
|
+
GGY: :gbp
|
182
|
+
GN: :gnf
|
183
|
+
GIN: :gnf
|
184
|
+
GW: :xof
|
185
|
+
GNB: :xof
|
186
|
+
GY: :gyd
|
187
|
+
GUY: :gyd
|
188
|
+
HT: :usd
|
189
|
+
HTI: :usd
|
190
|
+
HM: :aud
|
191
|
+
HMD: :aud
|
192
|
+
VA: :eur
|
193
|
+
VAT: :eur
|
194
|
+
HN: :hnl
|
195
|
+
HND: :hnl
|
196
|
+
HK: :hkd
|
197
|
+
HKG: :hkd
|
198
|
+
HU: :huf
|
199
|
+
HUN: :huf
|
200
|
+
IS: :isk
|
201
|
+
ISL: :isk
|
202
|
+
IN: :inr
|
203
|
+
IND: :inr
|
204
|
+
ID: :idr
|
205
|
+
IDN: :idr
|
206
|
+
IR: :irr
|
207
|
+
IRN: :irr
|
208
|
+
IQ: :iqd
|
209
|
+
IRQ: :iqd
|
210
|
+
IE: :eur
|
211
|
+
IRL: :eur
|
212
|
+
IM: :gbp
|
213
|
+
IMN: :gbp
|
214
|
+
IL: :ils
|
215
|
+
ISR: :ils
|
216
|
+
IT: :eur
|
217
|
+
ITA: :eur
|
218
|
+
JM: :jmd
|
219
|
+
JAM: :jmd
|
220
|
+
JP: :jpy
|
221
|
+
JPN: :jpy
|
222
|
+
JE: :gbp
|
223
|
+
JEY: :gbp
|
224
|
+
JO: :jod
|
225
|
+
JOR: :jod
|
226
|
+
KZ: :kzt
|
227
|
+
KAZ: :kzt
|
228
|
+
KE: :kes
|
229
|
+
KEN: :kes
|
230
|
+
KI: :aud
|
231
|
+
KIR: :aud
|
232
|
+
KP: :kpw
|
233
|
+
PRK: :kpw
|
234
|
+
KR: :krw
|
235
|
+
KOR: :krw
|
236
|
+
KW: :kwd
|
237
|
+
KWT: :kwd
|
238
|
+
KG: :kgs
|
239
|
+
KGZ: :kgs
|
240
|
+
LA: :lak
|
241
|
+
LAO: :lak
|
242
|
+
LV: :lvl
|
243
|
+
LVA: :lvl
|
244
|
+
LB: :lbp
|
245
|
+
LBN: :lbp
|
246
|
+
LS: :zar
|
247
|
+
LSO: :zar
|
248
|
+
LR: :lrd
|
249
|
+
LBR: :lrd
|
250
|
+
LY: :lyd
|
251
|
+
LBY: :lyd
|
252
|
+
LI: :chf
|
253
|
+
LIE: :chf
|
254
|
+
LT: :ltl
|
255
|
+
LTU: :ltl
|
256
|
+
LU: :eur
|
257
|
+
LUX: :eur
|
258
|
+
MO: :mop
|
259
|
+
MAC: :mop
|
260
|
+
MK: :mkd
|
261
|
+
MKD: :mkd
|
262
|
+
MG: :mga
|
263
|
+
MDG: :mga
|
264
|
+
MW: :mwk
|
265
|
+
MWI: :mwk
|
266
|
+
MY: :myr
|
267
|
+
MYS: :myr
|
268
|
+
MV: :mvr
|
269
|
+
MDV: :mvr
|
270
|
+
ML: :xof
|
271
|
+
MLI: :xof
|
272
|
+
MT: :eur
|
273
|
+
MLT: :eur
|
274
|
+
MH: :usd
|
275
|
+
MHL: :usd
|
276
|
+
MQ: :eur
|
277
|
+
MTQ: :eur
|
278
|
+
MR: :mro
|
279
|
+
MRT: :mro
|
280
|
+
MU: :mur
|
281
|
+
MUS: :mur
|
282
|
+
YT: :eur
|
283
|
+
MYT: :eur
|
284
|
+
MX: :mxn
|
285
|
+
MEX: :mxn
|
286
|
+
FM: :usd
|
287
|
+
FSM: :usd
|
288
|
+
MD: :mdl
|
289
|
+
MDA: :mdl
|
290
|
+
MC: :eur
|
291
|
+
MCO: :eur
|
292
|
+
MN: :mnt
|
293
|
+
MNG: :mnt
|
294
|
+
ME: :eur
|
295
|
+
MNE: :eur
|
296
|
+
MS: :xcd
|
297
|
+
MSR: :xcd
|
298
|
+
MA: :mad
|
299
|
+
MAR: :mad
|
300
|
+
MZ: :mzn
|
301
|
+
MOZ: :mzn
|
302
|
+
MM: :mmk
|
303
|
+
MMR: :mmk
|
304
|
+
NA: :zar
|
305
|
+
NAM: :zar
|
306
|
+
NR: :aud
|
307
|
+
NRU: :aud
|
308
|
+
NP: :npr
|
309
|
+
NPL: :npr
|
310
|
+
NL: :eur
|
311
|
+
NLD: :eur
|
312
|
+
NC: :xpf
|
313
|
+
NCL: :xpf
|
314
|
+
NZ: :nzd
|
315
|
+
NZL: :nzd
|
316
|
+
NI: :nio
|
317
|
+
NIC: :nio
|
318
|
+
NE: :xof
|
319
|
+
NER: :xof
|
320
|
+
NG: :ngn
|
321
|
+
NGA: :ngn
|
322
|
+
NU: :nzd
|
323
|
+
NIU: :nzd
|
324
|
+
NF: :aud
|
325
|
+
NFK: :aud
|
326
|
+
MP: :usd
|
327
|
+
MNP: :usd
|
328
|
+
'NO': :nok
|
329
|
+
NOR: :nok
|
330
|
+
OM: :omr
|
331
|
+
OMN: :omr
|
332
|
+
PK: :pkr
|
333
|
+
PAK: :pkr
|
334
|
+
PW: :usd
|
335
|
+
PLW: :usd
|
336
|
+
PA: :usd
|
337
|
+
PAN: :usd
|
338
|
+
PG: :pgk
|
339
|
+
PNG: :pgk
|
340
|
+
PY: :pyg
|
341
|
+
PRY: :pyg
|
342
|
+
PE: :pen
|
343
|
+
PER: :pen
|
344
|
+
PH: :php
|
345
|
+
PHL: :php
|
346
|
+
PN: :nzd
|
347
|
+
PCN: :nzd
|
348
|
+
PL: :pln
|
349
|
+
POL: :pln
|
350
|
+
PT: :eur
|
351
|
+
PRT: :eur
|
352
|
+
PR: :usd
|
353
|
+
PRI: :usd
|
354
|
+
QA: :qar
|
355
|
+
QAT: :qar
|
356
|
+
RO: :ron
|
357
|
+
ROU: :ron
|
358
|
+
RU: :rub
|
359
|
+
RUS: :rub
|
360
|
+
RW: :rwf
|
361
|
+
RWA: :rwf
|
362
|
+
RE: :eur
|
363
|
+
REU: :eur
|
364
|
+
BL: :eur
|
365
|
+
BLM: :eur
|
366
|
+
SH: :shp
|
367
|
+
SHN: :shp
|
368
|
+
KN: :xcd
|
369
|
+
KNA: :xcd
|
370
|
+
LC: :xcd
|
371
|
+
LCA: :xcd
|
372
|
+
MF: :eur
|
373
|
+
MAF: :eur
|
374
|
+
PM: :eur
|
375
|
+
SPM: :eur
|
376
|
+
VC: :xcd
|
377
|
+
VCT: :xcd
|
378
|
+
WS: :wst
|
379
|
+
WSM: :wst
|
380
|
+
SM: :eur
|
381
|
+
SMR: :eur
|
382
|
+
ST: :std
|
383
|
+
STP: :std
|
384
|
+
SA: :sar
|
385
|
+
SAU: :sar
|
386
|
+
SN: :xof
|
387
|
+
SEN: :xof
|
388
|
+
RS: :rsd
|
389
|
+
SRB: :rsd
|
390
|
+
SC: :scr
|
391
|
+
SYC: :scr
|
392
|
+
SL: :sll
|
393
|
+
SLE: :sll
|
394
|
+
SG: :sgd
|
395
|
+
SGP: :sgd
|
396
|
+
SX: :ang
|
397
|
+
SXM: :ang
|
398
|
+
SK: :eur
|
399
|
+
SVK: :eur
|
400
|
+
SI: :eur
|
401
|
+
SVN: :eur
|
402
|
+
SB: :sbd
|
403
|
+
SLB: :sbd
|
404
|
+
SO: :sos
|
405
|
+
SOM: :sos
|
406
|
+
ZA: :zar
|
407
|
+
ZAF: :zar
|
408
|
+
SS: :ssp
|
409
|
+
SSD: :ssp
|
410
|
+
ES: :eur
|
411
|
+
ESP: :eur
|
412
|
+
LK: :lkr
|
413
|
+
LKA: :lkr
|
414
|
+
SD: :sdg
|
415
|
+
SDN: :sdg
|
416
|
+
SR: :srd
|
417
|
+
SUR: :srd
|
418
|
+
SJ: :nok
|
419
|
+
SJM: :nok
|
420
|
+
SZ: :szl
|
421
|
+
SWZ: :szl
|
422
|
+
SE: :sek
|
423
|
+
SWE: :sek
|
424
|
+
CH: :chf
|
425
|
+
CHE: :chf
|
426
|
+
SY: :syp
|
427
|
+
SYR: :syp
|
428
|
+
TW: :twd
|
429
|
+
TWN: :twd
|
430
|
+
TJ: :tjs
|
431
|
+
TJK: :tjs
|
432
|
+
TZ: :tzs
|
433
|
+
TZA: :tzs
|
434
|
+
TH: :thb
|
435
|
+
THA: :thb
|
436
|
+
TL: :usd
|
437
|
+
TLS: :usd
|
438
|
+
TG: :xof
|
439
|
+
TGO: :xof
|
440
|
+
TK: :nzd
|
441
|
+
TKL: :nzd
|
442
|
+
TO: :top
|
443
|
+
TON: :top
|
444
|
+
TT: :ttd
|
445
|
+
TTO: :ttd
|
446
|
+
TN: :tnd
|
447
|
+
TUN: :tnd
|
448
|
+
TR: :try
|
449
|
+
TUR: :try
|
450
|
+
TM: :tmt
|
451
|
+
TKM: :tmt
|
452
|
+
TC: :usd
|
453
|
+
TCA: :usd
|
454
|
+
TV: :aud
|
455
|
+
TUV: :aud
|
456
|
+
UG: :ugx
|
457
|
+
UGA: :ugx
|
458
|
+
UA: :uah
|
459
|
+
UKR: :uah
|
460
|
+
AE: :aed
|
461
|
+
ARE: :aed
|
462
|
+
GB: :gbp
|
463
|
+
GBR: :gbp
|
464
|
+
US: :usd
|
465
|
+
USA: :usd
|
466
|
+
UM: :usd
|
467
|
+
UMI: :usd
|
468
|
+
UY: :uyu
|
469
|
+
URY: :uyu
|
470
|
+
UZ: :uzs
|
471
|
+
UZB: :uzs
|
472
|
+
VU: :vuv
|
473
|
+
VUT: :vuv
|
474
|
+
VE: :vef
|
475
|
+
VEN: :vef
|
476
|
+
VN: :vnd
|
477
|
+
VNM: :vnd
|
478
|
+
VG: :usd
|
479
|
+
VGB: :usd
|
480
|
+
VI: :usd
|
481
|
+
VIR: :usd
|
482
|
+
WF: :xpf
|
483
|
+
WLF: :xpf
|
484
|
+
EH: :mad
|
485
|
+
ESH: :mad
|
486
|
+
YE: :yer
|
487
|
+
YEM: :yer
|
488
|
+
ZM: :zmk
|
489
|
+
ZMB: :zmk
|
490
|
+
ZW: :zwl
|
491
|
+
ZWE: :zwl
|
492
|
+
AX: :eur
|
493
|
+
ALA: :eur
|