iso_country_codes 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -1
- data/History.txt +4 -0
- data/VERSION +1 -1
- data/lib/iso_country_codes/iso_country_codes.rb +1 -1
- data/test/iso_country_codes_test.rb +7 -0
- metadata +2 -2
data/.gitignore
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
iso_country_codes-*.gem
|
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.2
|
@@ -33,7 +33,7 @@ class IsoCountryCodes # :nodoc:
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def search_by_name(str)
|
36
|
-
instances = all.select { |c| c.name.upcase == str }
|
36
|
+
instances = all.select { |c| c.name.upcase == str.upcase }
|
37
37
|
instances = all.select { |c| c.name.match(/^#{str}/i) } if instances.empty?
|
38
38
|
instances = all.select { |c| c.name.match(/#{str}/i) } if instances.empty?
|
39
39
|
|
@@ -71,6 +71,13 @@ class TestIsoCountryCodes < Test::Unit::TestCase
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
+
def test_search_by_name_exact_match
|
75
|
+
assert_equal(
|
76
|
+
[IsoCountryCodes::Code::CCK.instance],
|
77
|
+
IsoCountryCodes.search_by_name('Cocos (Keeling) Islands')
|
78
|
+
)
|
79
|
+
end
|
80
|
+
|
74
81
|
def test_search_by_currency_lowercase
|
75
82
|
assert_equal([
|
76
83
|
IsoCountryCodes::Code::CCK.instance,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iso_country_codes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-09-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|