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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 413050b3b4caedd31fbf379ea859a5646436f42c
4
- data.tar.gz: f1e8ee5ed01e7dd343405188bbdf3ebcc05b982f
3
+ metadata.gz: 67a9d385307745d02b767274aee516047cb78b5a
4
+ data.tar.gz: 3b8b13157ccfd11d968398179aad26218f8d440e
5
5
  SHA512:
6
- metadata.gz: 77340d6e00213e6ff14f8bcd9a91a5ea5bae8650babeeb98c3965d80684549ea8e8acf0c775f6858d40423a0665597650a044455472db967ba4c24b161b85ce7
7
- data.tar.gz: a3f8a5a6957c45f32886dccab2e28c2bce4c9046c2416df6b5012c80fff9b5dc3c865386c0ce855b2002bec829a00c645b9fec8fbe8a6dc873036d5ba0245a44
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.2
1
+ 0.7.3
@@ -69,7 +69,7 @@ class IsoCountryCodes
69
69
  class DEU < Code #:nodoc:
70
70
  self.iban = 'DE'
71
71
  end
72
- class GGC < Code #:nodoc:
72
+ class GGY < Code #:nodoc:
73
73
  self.iban = 'GB'
74
74
  end
75
75
  class GIB < Code #:nodoc:
@@ -23,11 +23,11 @@ class IsoCountryCodes # :nodoc:
23
23
  end
24
24
 
25
25
  if code.match(/^\d{3}$/)
26
- instance = all.select { |c| c.numeric == code }.first
26
+ instance = all.find { |c| c.numeric == code }
27
27
  elsif code.match(/^[A-Z]{2}$/)
28
- instance = all.select { |c| c.alpha2 == code }.first
28
+ instance = all.find { |c| c.alpha2 == code }
29
29
  elsif code.match(/^[A-Z]{3}$/)
30
- instance = all.select { |c| c.alpha3 == code }.first
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.2
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-09-17 00:00:00.000000000 Z
11
+ date: 2015-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler