icu_name 1.2.5 → 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/icu_name/name.rb +1 -0
- data/lib/icu_name/version.rb +1 -1
- data/spec/name_spec.rb +17 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b8bbf1c4c849f51c6ab2f47313c82d0d13152994
|
4
|
+
data.tar.gz: 9b4fe1734f14058592026aeed2674a1342ff35da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69cbf7083eb2311fb91c6bdb3f46c964d5308e76f1dcfc481623a51661ab298f1ffeb3da949367ff452cbd712600addeaff11d2e940f0e5120c8949a8bb61318
|
7
|
+
data.tar.gz: acfdb0fc58b6ed2eb4d9f183428e2468e53751d57f36c68cbff666c4a511544d51456838c60ed7d5bed4995795029ed2d5d7ca86489e60ca50009abc03305762
|
data/lib/icu_name/name.rb
CHANGED
@@ -66,6 +66,7 @@ module ICU
|
|
66
66
|
# Match another name to this object, returning true or false.
|
67
67
|
def match(name1='', name2='', opts={})
|
68
68
|
other = Name.new(name1, name2)
|
69
|
+
return true if name == other.name
|
69
70
|
match_first(first(opts), other.first(opts)) && match_last(last(opts), other.last(opts))
|
70
71
|
end
|
71
72
|
|
data/lib/icu_name/version.rb
CHANGED
data/spec/name_spec.rb
CHANGED
@@ -168,6 +168,23 @@ module ICU
|
|
168
168
|
end
|
169
169
|
end
|
170
170
|
|
171
|
+
context "nil last name" do
|
172
|
+
before(:each) do
|
173
|
+
@sarthak1 = Name.new('Sarthak Bathla', nil)
|
174
|
+
@sarthak2 = Name.new("Sarthak", "Bathla")
|
175
|
+
@sarthak3 = Name.new("Sarthak Bathla", "")
|
176
|
+
end
|
177
|
+
|
178
|
+
it "should match concatenation of first and last name" do
|
179
|
+
[@sarthak1, @sarthak2, @sarthak3].each do |sarthak|
|
180
|
+
expect(sarthak.match("Sarthak", "Bathla")).to be_truthy
|
181
|
+
expect(sarthak.match("Sarthak Bathla", "")).to be_truthy
|
182
|
+
expect(sarthak.match("", "Sarthak Bathla")).to be_truthy
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
|
171
188
|
context "accented characters and capitalisation" do
|
172
189
|
it "should downcase upper case accented characters where appropriate" do
|
173
190
|
name = Name.new('GEARÓIDÍN', 'UÍ LAIGHLÉIS')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: icu_name
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Orr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02
|
11
|
+
date: 2019-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
version: 1.3.6
|
109
109
|
requirements: []
|
110
110
|
rubyforge_project: icu_name
|
111
|
-
rubygems_version: 2.
|
111
|
+
rubygems_version: 2.6.10
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: Canonicalises and matches person names
|