iso_country_codes 0.7.2 → 0.7.3
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/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/lib/iso_country_codes/iso_13616_1.rb +1 -1
- data/lib/iso_country_codes/iso_country_codes.rb +3 -3
- data/test/iso_country_codes_test.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 67a9d385307745d02b767274aee516047cb78b5a
|
|
4
|
+
data.tar.gz: 3b8b13157ccfd11d968398179aad26218f8d440e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6c248455491a115c6fc6efae257ecc85d6a0b49dde88bb6b9bb89073aea4d10db406dfdc9fab778dbecd82c74f0b75bb580b2b97dad01933ca95ffabef771732
|
|
7
|
+
data.tar.gz: ec24c8e0ba962899129814f8f6652f9d64664e69efd609dec5fef8f99ff25b5dbd50942bdf3065b1c891bf39b17a041e02c565ca5595fbaff339a337f84484c6
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
## Unreleased
|
|
2
2
|
|
|
3
|
+
* Fixed country code for Guernsey IBAN entry. Also removes `nil` entry from
|
|
4
|
+
`IsoCountryCodes::Code.all` and `IsoCountryCodes::Code.for_select` methods.
|
|
5
|
+
|
|
6
|
+
## 0.7.2 - 2015-09-17
|
|
7
|
+
|
|
3
8
|
* Fixed RegExp error in `search_by_name` (see #21)
|
|
4
9
|
* Moved Cyprus from Asia to Europe
|
|
5
10
|
* Added IBAN codes for British Crown Dependencies
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.7.
|
|
1
|
+
0.7.3
|
|
@@ -23,11 +23,11 @@ class IsoCountryCodes # :nodoc:
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
if code.match(/^\d{3}$/)
|
|
26
|
-
instance = all.
|
|
26
|
+
instance = all.find { |c| c.numeric == code }
|
|
27
27
|
elsif code.match(/^[A-Z]{2}$/)
|
|
28
|
-
instance = all.
|
|
28
|
+
instance = all.find { |c| c.alpha2 == code }
|
|
29
29
|
elsif code.match(/^[A-Z]{3}$/)
|
|
30
|
-
instance = all.
|
|
30
|
+
instance = all.find { |c| c.alpha3 == code }
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
return fallback.call "No ISO 3166-1 code could be found for '#{code}'." if instance.nil?
|
|
@@ -258,6 +258,11 @@ class TestIsoCountryCodes < Test::Unit::TestCase
|
|
|
258
258
|
assert_equal IsoCountryCodes::Code.for_select.length, IsoCountryCodes::Code.all.length
|
|
259
259
|
end
|
|
260
260
|
|
|
261
|
+
def test_all
|
|
262
|
+
assert IsoCountryCodes::Code.all.is_a?(Array)
|
|
263
|
+
refute_includes IsoCountryCodes::Code.all.map(&:name), nil
|
|
264
|
+
end
|
|
265
|
+
|
|
261
266
|
def test_for_select_value_attribute
|
|
262
267
|
assert_equal IsoCountryCodes::Code.for_select(:alpha3)[0][1].length, 3
|
|
263
268
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: iso_country_codes
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex Rabarts
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-12-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|