get-your-rep 1.3.0 → 1.3.1
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 +4 -4
- data/lib/get-your-rep/delegation.rb +14 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b65ff3454591d1ede812f534a057153baf8fa42
|
4
|
+
data.tar.gz: 72af8fb79c5af6203b79dd139be79cb75f779d21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5daecb7e779110c1bdb7fa16fd96aa258cefe0c4ff8ee2ac7a014fdf4ac5f6eb05299217be4c6e04425b293b46db79fac996875ee2ff05005424b3217b28fd0
|
7
|
+
data.tar.gz: 3e8b8d9ec37957ac72d76aec2603c89a7a3e53ca808ea76bb745d0d6ffd8d7ccef72935cba67bafc2194d440bb59d4a7860f18d21bea10e1ef36c7d03659937e
|
@@ -21,12 +21,24 @@ class Delegation < Array
|
|
21
21
|
|
22
22
|
# Collects the first names of every rep in the Delegation.
|
23
23
|
def first_names
|
24
|
-
self.map
|
24
|
+
self.map do |rep|
|
25
|
+
if (rep[:name].split.count > 3) || (rep[:name].split[-2].downcase == rep[:name].split[-2])
|
26
|
+
rep[:name].split[0..-3].join(' ')
|
27
|
+
else
|
28
|
+
rep[:name].split[0..-2].join(' ')
|
29
|
+
end
|
30
|
+
end
|
25
31
|
end
|
26
32
|
|
27
33
|
# Collects the last names of every rep in the Delegation.
|
28
34
|
def last_names
|
29
|
-
self.map
|
35
|
+
self.map do |rep|
|
36
|
+
if (rep[:name].split.count > 3) || (rep[:name].split[-2].downcase == rep[:name].split[-2])
|
37
|
+
rep[:name].split[-2..-1].join(' ')
|
38
|
+
else
|
39
|
+
rep[:name].split.last
|
40
|
+
end
|
41
|
+
end
|
30
42
|
end
|
31
43
|
|
32
44
|
# Maps attributes to a simple array for easy printing, iteration, and display. It uses #each rather than #map so it can skip over nil values without mapping them.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: get-your-rep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- msimonborg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -94,7 +94,7 @@ dependencies:
|
|
94
94
|
version: '10'
|
95
95
|
description: Get your rep with Google's Civic Information API using your address and
|
96
96
|
API key. Check the documentation and README for new search options added in this
|
97
|
-
|
97
|
+
version 1.3. This patch fixes some incorrect handling of multi-word surnames.
|
98
98
|
email: msimonborg@gmail.com
|
99
99
|
executables: []
|
100
100
|
extensions: []
|