clienteer 1.5.3 → 1.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/clienteer/sanitizers/name.rb +13 -9
- data/lib/clienteer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 180976da8c903562a6d3d2485e3fbd0e45b56e82
|
4
|
+
data.tar.gz: 789ac7df138f47bce2fadd7088afa94dde911b1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9eb336313075df09ea2fd35622d81a0cac284f36e5e2e00585a0ced90ffbe41c15c15a6c36d02a2ee0113054ca9aa871422d55edc2a6150243d8e569b5d72d12
|
7
|
+
data.tar.gz: adafd0210f1231b398a658a588e09be78066c41e7d666c693dccfb97c5fa6c2f17543068c63e90b6966b58d05cc864a0fefa76a0990a11b9282372b2050384d1
|
@@ -4,19 +4,23 @@ module Clienteer
|
|
4
4
|
class Name
|
5
5
|
|
6
6
|
def process(row)
|
7
|
-
names = [row[:raw].first_name, row[:raw].last_name]
|
8
|
-
names
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
row[:reason] = "names not valid"
|
13
|
-
$skipped_people << row
|
14
|
-
return nil
|
7
|
+
names = [row[:raw].first_name, row[:raw].last_name].compact
|
8
|
+
if names.length == 1 && names[0].include? (" ")
|
9
|
+
names = names[0].split(" ")
|
10
|
+
row[:raw].first_name, row[:raw].last_name = *names
|
11
|
+
return row if names.all? {|n| proper? n }
|
15
12
|
end
|
13
|
+
return remove(row)
|
16
14
|
end
|
17
15
|
|
18
16
|
def proper?(name)
|
19
|
-
|
17
|
+
!name.match /\d/
|
18
|
+
end
|
19
|
+
|
20
|
+
def remove(row)
|
21
|
+
row[:reason] = "names not valid"
|
22
|
+
$skipped_people << row
|
23
|
+
nil
|
20
24
|
end
|
21
25
|
end
|
22
26
|
end
|
data/lib/clienteer/version.rb
CHANGED