country_currency 0.1.0 → 0.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 +7 -7
- data/README.md +2 -0
- data/lib/country_currency/country_currency.rb +13 -0
- data/lib/country_currency/version.rb +1 -1
- metadata +58 -54
- data/VERSION +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dc801208aa60f49c25b7896337aeca7e131f2cff61a58246c4e024fac2523948
|
4
|
+
data.tar.gz: 29775e974c687b39d6e5f6bff94ead86291073beb11dd7b22f90f4c2f89df411
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b8b09eb836a7d0d5ba46ecf6838fedbfbb4b7639373856d2d47e59649a32fa545fc2d2db66ca3995aa6ab76fbfd04e084728084b2e0cb6e1fb37f0f36f543831
|
7
|
+
data.tar.gz: e8e42fc7012f52a96c306b5aca076b7990346857604924d0547ab456f6690970b76f49bb39e455e851b10f7f271c36e29af240889acd9fc09213c083cc680dd2
|
data/README.md
CHANGED
@@ -37,6 +37,19 @@ module CountryCurrency # :nodoc:
|
|
37
37
|
instance
|
38
38
|
end
|
39
39
|
|
40
|
+
def find_by_currency(code, &fallback)
|
41
|
+
# Only use for currency data
|
42
|
+
fallback ||= DEFAULT_FALLBACK
|
43
|
+
|
44
|
+
code = code.to_s.upcase
|
45
|
+
instance = all.select { |c| c.currency == code }.first
|
46
|
+
|
47
|
+
return fallback.call "No ISO 3166-1 codes could be found searching with currency '#{code}'." if instance.nil?
|
48
|
+
|
49
|
+
instance
|
50
|
+
end
|
51
|
+
|
52
|
+
|
40
53
|
def search_by_name(str, &fallback)
|
41
54
|
fallback ||= DEFAULT_FALLBACK
|
42
55
|
|
metadata
CHANGED
@@ -1,63 +1,70 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: country_currency
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
7
|
-
-
|
6
|
+
authors:
|
7
|
+
- Néstor Coppi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2018-04-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
15
14
|
name: rake
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
version: "12"
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '12'
|
22
20
|
type: :runtime
|
23
|
-
version_requirements: *id001
|
24
|
-
- !ruby/object:Gem::Dependency
|
25
|
-
name: tzinfo
|
26
21
|
prerelease: false
|
27
|
-
|
28
|
-
requirements:
|
29
|
-
- - ~>
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
version:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '12'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: tzinfo
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1'
|
32
34
|
type: :runtime
|
33
|
-
version_requirements: *id002
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
name: test-unit
|
36
35
|
prerelease: false
|
37
|
-
|
38
|
-
requirements:
|
39
|
-
- - ~>
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: test-unit
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.2'
|
42
48
|
type: :development
|
43
|
-
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.2'
|
44
55
|
description: ISO country code and currency library
|
45
56
|
email: nestorcoppi@gmail.com
|
46
57
|
executables: []
|
47
|
-
|
48
58
|
extensions: []
|
49
|
-
|
50
59
|
extra_rdoc_files: []
|
51
|
-
|
52
|
-
|
53
|
-
- .travis.yml
|
60
|
+
files:
|
61
|
+
- ".travis.yml"
|
54
62
|
- CHANGELOG.md
|
55
63
|
- Gemfile
|
56
64
|
- Gemfile.lock
|
57
65
|
- Manifest.txt
|
58
66
|
- README.md
|
59
67
|
- Rakefile
|
60
|
-
- VERSION
|
61
68
|
- country_currency.gemspec
|
62
69
|
- lib/country_currency.rb
|
63
70
|
- lib/country_currency/calling.rb
|
@@ -75,30 +82,27 @@ files:
|
|
75
82
|
- rakelib/iso_3166_1.rb.erb
|
76
83
|
- test/country_currency_test.rb
|
77
84
|
homepage: http://github.com/sequre/country_currency
|
78
|
-
licenses:
|
85
|
+
licenses:
|
79
86
|
- MIT
|
80
87
|
metadata: {}
|
81
|
-
|
82
88
|
post_install_message:
|
83
89
|
rdoc_options: []
|
84
|
-
|
85
|
-
require_paths:
|
90
|
+
require_paths:
|
86
91
|
- lib
|
87
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
-
requirements:
|
89
|
-
-
|
90
|
-
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
92
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
96
102
|
requirements: []
|
97
|
-
|
98
103
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.6
|
104
|
+
rubygems_version: 2.7.6
|
100
105
|
signing_key:
|
101
106
|
specification_version: 4
|
102
107
|
summary: Provides ISO 3166-1 country codes/names and ISO 4217 currencies.
|
103
108
|
test_files: []
|
104
|
-
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.7.8
|