get_your_rep 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5741d7020c669da418435c2ff212e9e8455a76a
4
- data.tar.gz: acba81f8daf9d744295c298c3234428d8f3ca2ca
3
+ metadata.gz: 1782c2a5230bdcc479cec091d9a35c066e8fd845
4
+ data.tar.gz: 968959010cce628943b0451ff3b21d5389c3b628
5
5
  SHA512:
6
- metadata.gz: 56ac5c1fd7dcda7b52667bd2fede7b00a2f239f0bad8f5738347ea26b0f19bca99cfa05b62f3134235b7b3c034c9d0ff192209c10b124a8edc133530fe76956d
7
- data.tar.gz: 58d5b6313451869530e3af51c20afb1d136e43fa3405338b481e8779c5ee12d32af445d4c28ad1eb457ba29775d5f3f905156139866d0f964ed8680694b67d4d
6
+ metadata.gz: 743d761b375e97435248cf3b1f9a798c6b5282fdb21bcfdde43999894083086730483ce353272f7c2afa0f462ff8e39b465b31218832d0f5f0874d3ba0404283
7
+ data.tar.gz: 574ec214a72556ed7b3bc3bff029a74007a0c7398abec54f27d17f541bea72df6f1120b08cad16fe462fdc128de7a6528e497fddfdb06f78ea31f44942ec441d
@@ -14,7 +14,6 @@ module GetYourRep
14
14
  get_coordinates(address)
15
15
  end
16
16
  @response = get_rep
17
-
18
17
  if @response.empty? || @response.is_a?(String) || @response.first['error']
19
18
  puts 'Error message received. Confirm and re-enter your address and check your parameters.'
20
19
  puts @response
@@ -36,7 +36,9 @@ module GetYourRep
36
36
 
37
37
  return self[:first_name] if self[:first_name]
38
38
 
39
- if (name.split.count > 3) || (name.split[-2].downcase == name.split[-2])
39
+ if name.split.count == 1
40
+ nil
41
+ elsif (name.split.count > 3) || (name.split[-2].downcase == name.split[-2])
40
42
  name.split[0..-3].join(' ')
41
43
  else
42
44
  name.split[0..-2].join(' ')
@@ -54,7 +56,9 @@ module GetYourRep
54
56
 
55
57
  return self[:last_name] if self[:last_name]
56
58
 
57
- if (name.split.count > 3) || (name.split[-2].downcase == name.split[-2])
59
+ if name.split.count == 1
60
+ name
61
+ elsif (name.split.count > 3) || (name.split[-2].downcase == name.split[-2])
58
62
  name.split[-2..-1].join(' ')
59
63
  else
60
64
  name.split.last
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: 0.1.8
4
+ version: 0.1.9
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-20 00:00:00.000000000 Z
11
+ date: 2016-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty