nameable 1.1.1 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.gitignore +1 -1
- data/.travis.yml +3 -4
- data/Gemfile.lock +23 -78
- data/lib/nameable/latin.rb +1 -1
- data/lib/nameable/latin/patterns.rb +1 -1
- data/lib/nameable/version.rb +1 -1
- data/nameable.gemspec +0 -3
- data/spec/nameable/latin_spec.rb +39 -1
- metadata +3 -45
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 697d359c5c166e771017cab9bb7da4e495459c13
|
4
|
+
data.tar.gz: 9a1ef0da17788e989a582918446108d7ce1bd6a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce4e9bd5fceb11e9c2f859688b1bf443fa7472772949e1fafecd88ec6e601760b543e18528ab351d89ffe49610eb0bb9fd8b28c118a70ddf4216bf9efa4b86b0
|
7
|
+
data.tar.gz: 27e93549631ea9c81d7592c9d869eea650a2c4a923f0ea0ffa062a98f3f0282091fbfcbfd848c3fbf9ed16e5fe53c54b5d57e300f795d65d285a2f31e3a2d6ae
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/.travis.yml
CHANGED
@@ -2,9 +2,8 @@ language: ruby
|
|
2
2
|
cache: bundler
|
3
3
|
script: bundle exec rspec
|
4
4
|
rvm:
|
5
|
-
- 2.
|
6
|
-
- 2.
|
7
|
-
- 2.
|
8
|
-
- 1.9.3
|
5
|
+
- 2.4.1
|
6
|
+
- 2.3.4
|
7
|
+
- 2.2.7
|
9
8
|
dd:
|
10
9
|
secure: fzItORKaVrevTjQQu85FYgqgSVkRGG8PtOfNTCYY0meyP1+hF/lH6i5ZAb35VAuwi9InqaYnPx09dREBlfEqkzY/Ypxglq+EosAfqOgiKFu44JlM4vhxSdwn2mywCJpYZ0IbH5OnkF6rUULL/AoRQPlIV77eRqhB9LGfLNlYMfU=
|
data/Gemfile.lock
CHANGED
@@ -1,91 +1,36 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
nameable (1.1.
|
4
|
+
nameable (1.1.3)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
|
10
|
-
timers (~> 4.0.0)
|
11
|
-
codeclimate-test-reporter (0.4.7)
|
9
|
+
codeclimate-test-reporter (0.6.0)
|
12
10
|
simplecov (>= 0.7.1, < 1.0.0)
|
13
|
-
|
14
|
-
diff-lcs (1.2.5)
|
11
|
+
diff-lcs (1.3)
|
15
12
|
docile (1.1.5)
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
shellany (~> 0.0)
|
27
|
-
thor (>= 0.18.1)
|
28
|
-
guard-bundler (2.1.0)
|
29
|
-
bundler (~> 1.0)
|
30
|
-
guard (~> 2.2)
|
31
|
-
guard-compat (~> 1.1)
|
32
|
-
guard-compat (1.2.1)
|
33
|
-
guard-rspec (4.5.2)
|
34
|
-
guard (~> 2.1)
|
35
|
-
guard-compat (~> 1.1)
|
36
|
-
rspec (>= 2.99.0, < 4.0)
|
37
|
-
hitimes (1.2.2)
|
38
|
-
hitimes (1.2.2-java)
|
39
|
-
json (1.8.3)
|
40
|
-
json (1.8.3-java)
|
41
|
-
listen (2.10.1)
|
42
|
-
celluloid (~> 0.16.0)
|
43
|
-
rb-fsevent (>= 0.9.3)
|
44
|
-
rb-inotify (>= 0.9)
|
45
|
-
lumberjack (1.0.9)
|
46
|
-
method_source (0.8.2)
|
47
|
-
nenv (0.2.0)
|
48
|
-
notiffany (0.0.6)
|
49
|
-
nenv (~> 0.1)
|
50
|
-
shellany (~> 0.0)
|
51
|
-
pry (0.10.1)
|
52
|
-
coderay (~> 1.1.0)
|
53
|
-
method_source (~> 0.8.1)
|
54
|
-
slop (~> 3.4)
|
55
|
-
pry (0.10.1-java)
|
56
|
-
coderay (~> 1.1.0)
|
57
|
-
method_source (~> 0.8.1)
|
58
|
-
slop (~> 3.4)
|
59
|
-
spoon (~> 0.0)
|
60
|
-
rake (10.4.2)
|
61
|
-
rb-fsevent (0.9.5)
|
62
|
-
rb-inotify (0.9.5)
|
63
|
-
ffi (>= 0.5.0)
|
64
|
-
rspec (3.3.0)
|
65
|
-
rspec-core (~> 3.3.0)
|
66
|
-
rspec-expectations (~> 3.3.0)
|
67
|
-
rspec-mocks (~> 3.3.0)
|
68
|
-
rspec-core (3.3.1)
|
69
|
-
rspec-support (~> 3.3.0)
|
70
|
-
rspec-expectations (3.3.0)
|
13
|
+
json (2.1.0)
|
14
|
+
json (2.1.0-java)
|
15
|
+
rake (10.5.0)
|
16
|
+
rspec (3.6.0)
|
17
|
+
rspec-core (~> 3.6.0)
|
18
|
+
rspec-expectations (~> 3.6.0)
|
19
|
+
rspec-mocks (~> 3.6.0)
|
20
|
+
rspec-core (3.6.0)
|
21
|
+
rspec-support (~> 3.6.0)
|
22
|
+
rspec-expectations (3.6.0)
|
71
23
|
diff-lcs (>= 1.2.0, < 2.0)
|
72
|
-
rspec-support (~> 3.
|
73
|
-
rspec-mocks (3.
|
24
|
+
rspec-support (~> 3.6.0)
|
25
|
+
rspec-mocks (3.6.0)
|
74
26
|
diff-lcs (>= 1.2.0, < 2.0)
|
75
|
-
rspec-support (~> 3.
|
76
|
-
rspec-support (3.
|
77
|
-
|
78
|
-
simplecov (0.10.0)
|
27
|
+
rspec-support (~> 3.6.0)
|
28
|
+
rspec-support (3.6.0)
|
29
|
+
simplecov (0.14.1)
|
79
30
|
docile (~> 1.1.0)
|
80
|
-
json (
|
31
|
+
json (>= 1.8, < 3)
|
81
32
|
simplecov-html (~> 0.10.0)
|
82
|
-
simplecov-html (0.10.
|
83
|
-
slop (3.6.0)
|
84
|
-
spoon (0.0.4)
|
85
|
-
ffi
|
86
|
-
thor (0.19.1)
|
87
|
-
timers (4.0.1)
|
88
|
-
hitimes
|
33
|
+
simplecov-html (0.10.1)
|
89
34
|
|
90
35
|
PLATFORMS
|
91
36
|
java
|
@@ -94,9 +39,9 @@ PLATFORMS
|
|
94
39
|
DEPENDENCIES
|
95
40
|
bundler (~> 1.6)
|
96
41
|
codeclimate-test-reporter (~> 0.4)
|
97
|
-
guard (~> 2.12)
|
98
|
-
guard-bundler (~> 2.1)
|
99
|
-
guard-rspec (~> 4.5)
|
100
42
|
nameable!
|
101
43
|
rake (~> 10.4)
|
102
44
|
rspec (~> 3.3)
|
45
|
+
|
46
|
+
BUNDLED WITH
|
47
|
+
1.14.6
|
data/lib/nameable/latin.rb
CHANGED
@@ -118,7 +118,7 @@ module Nameable
|
|
118
118
|
raise InvalidNameError unless name
|
119
119
|
if name.class == String
|
120
120
|
if name.index(',')
|
121
|
-
name = "#{$2} #{$1}" if name =~ /^([a-z]+)\s*,\s*,*(
|
121
|
+
name = "#{$2} #{$1}" if name =~ /^([a-z]+)\s*,\s*,*([^,]*)/i
|
122
122
|
end
|
123
123
|
|
124
124
|
name = name.strip.split(/\s+/)
|
@@ -8,7 +8,7 @@ module Nameable
|
|
8
8
|
"Mrs." => /^\(*(mrs\.*|misses)\)*$/i,
|
9
9
|
"Ms." => /^\(*(ms\.*|miss)\)*$/i,
|
10
10
|
"Dr." => /^\(*(dr\.*|doctor)\)*$/i,
|
11
|
-
"Rev." => /^\(*(rev\.*|
|
11
|
+
"Rev." => /^\(*(rev\.*|reverend)\)*$/i,
|
12
12
|
"Fr." => /^\(*(fr\.*|friar)\)*$/i,
|
13
13
|
"Master" => /^\(*(master)\)*$/i,
|
14
14
|
"Sir" => /^\(*(sir)\)*$/i
|
data/lib/nameable/version.rb
CHANGED
data/nameable.gemspec
CHANGED
@@ -26,9 +26,6 @@ Gem::Specification.new do |spec|
|
|
26
26
|
|
27
27
|
spec.add_development_dependency 'bundler', '~> 1.6'
|
28
28
|
spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
|
29
|
-
spec.add_development_dependency 'guard', '~> 2.12'
|
30
|
-
spec.add_development_dependency 'guard-bundler', '~> 2.1'
|
31
|
-
spec.add_development_dependency 'guard-rspec', '~> 4.5'
|
32
29
|
spec.add_development_dependency 'rake', '~> 10.4'
|
33
30
|
spec.add_development_dependency 'rspec', '~> 3.3'
|
34
31
|
end
|
data/spec/nameable/latin_spec.rb
CHANGED
@@ -64,6 +64,44 @@ describe Nameable::Latin do
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
+
context('last_name, first_name') do
|
68
|
+
subject(:n) { Nameable::Latin.new.parse("Horn, Chris") }
|
69
|
+
it '.prefix' do
|
70
|
+
expect(n.prefix).to be_nil
|
71
|
+
end
|
72
|
+
it '.first' do
|
73
|
+
expect(n.first).to eq('Chris')
|
74
|
+
end
|
75
|
+
it '.middle' do
|
76
|
+
expect(n.middle).to be_nil
|
77
|
+
end
|
78
|
+
it '.last' do
|
79
|
+
expect(n.last).to eq('Horn')
|
80
|
+
end
|
81
|
+
it '.suffix' do
|
82
|
+
expect(n.suffix).to be_nil
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
context('last_name, first_name,') do
|
87
|
+
subject(:n) { Nameable::Latin.new.parse("Horn, Chris,") }
|
88
|
+
it '.prefix' do
|
89
|
+
expect(n.prefix).to be_nil
|
90
|
+
end
|
91
|
+
it '.first' do
|
92
|
+
expect(n.first).to eq('Chris')
|
93
|
+
end
|
94
|
+
it '.middle' do
|
95
|
+
expect(n.middle).to be_nil
|
96
|
+
end
|
97
|
+
it '.last' do
|
98
|
+
expect(n.last).to eq('Horn')
|
99
|
+
end
|
100
|
+
it '.suffix' do
|
101
|
+
expect(n.suffix).to be_nil
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
67
105
|
context('with a simple middle name') do
|
68
106
|
subject(:n) { Nameable::Latin.new.parse("Chris Derp Horn") }
|
69
107
|
it '.prefix' do
|
@@ -146,7 +184,7 @@ describe Nameable::Latin do
|
|
146
184
|
end
|
147
185
|
end
|
148
186
|
|
149
|
-
%w{Rev Rev.
|
187
|
+
%w{Rev Rev. Reverend}.each do |prefix|
|
150
188
|
it prefix do
|
151
189
|
expect(Nameable::Latin.new.parse("#{prefix} Chris Horn").prefix).to eq('Rev.')
|
152
190
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nameable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Horn
|
@@ -64,7 +64,7 @@ cert_chain:
|
|
64
64
|
plBjPb1jywhCxKfdcYv+f4er+X1AnUyoYNi7EiifiNys7nmVG4+aFEZyUULPrB2g
|
65
65
|
bHE=
|
66
66
|
-----END CERTIFICATE-----
|
67
|
-
date:
|
67
|
+
date: 2017-06-06 00:00:00.000000000 Z
|
68
68
|
dependencies:
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: bundler
|
@@ -94,48 +94,6 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0.4'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: guard
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '2.12'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '2.12'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: guard-bundler
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '2.1'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '2.1'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: guard-rspec
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '4.5'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '4.5'
|
139
97
|
- !ruby/object:Gem::Dependency
|
140
98
|
name: rake
|
141
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -220,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
178
|
version: '0'
|
221
179
|
requirements: []
|
222
180
|
rubyforge_project:
|
223
|
-
rubygems_version: 2.
|
181
|
+
rubygems_version: 2.6.11
|
224
182
|
signing_key:
|
225
183
|
specification_version: 4
|
226
184
|
summary: Parse names into components.
|
metadata.gz.sig
CHANGED
Binary file
|