locality 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +5 -5
  2. data/lib/locality/ip.rb +18 -0
  3. metadata +21 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: 02222a241b20efa248098b82ab00a70dda5e525e
4
- data.tar.gz: 951d6823bfb5af427d4cdbc2280fb63a9ffbe491
2
+ SHA1:
3
+ metadata.gz: 367fa7c94a7abe89b7c8b948752fe8d5aacfb346
4
+ data.tar.gz: de3364b4c4ba8aadc27a87ba626080e3a416554f
5
5
  SHA512:
6
- metadata.gz: bbb4989695385132e3cdc24b1d26fd2e45025547488b3fd9b1d0d9d1430c80ea433ebc15090aa9d21056b0619dabd4bda2d950c4f850e7835be59a7ab69b228c
7
- data.tar.gz: 2722dbb8584bf5d922ae22d2fd23b202d41e9ff2778a0d889b9b4178665b9218382c7ad8a91582d77819b197cc4d2aa67a9d2fb90074dd517a4586fc55acc2f6
6
+ metadata.gz: 5f77e922086890a1a9950c2835595938bae391d8f7e4a800a04e7cffad88991f451d8c43d2137765ed641baf3b750f1d66a6730ae4c224e0e0abe2a57715c2cf
7
+ data.tar.gz: 335e400f405a526a3cc7387f2bbea810959804a1aa494f6be3bedb4c2652fa72a723fc36b85a3d245e3d34579d43bf64f61f63968be0d230f342ede31ec6af53
data/lib/locality/ip.rb CHANGED
@@ -43,6 +43,24 @@ module Locality
43
43
  city_name || province_name || state_name || country_name
44
44
  end
45
45
 
46
+ def coordinates
47
+ return unless lookup
48
+ lookup.coordinates.presence
49
+ rescue => exception
50
+ end
51
+
52
+ def latitude
53
+ return unless lookup
54
+ lookup.latitude.presence
55
+ rescue => exception
56
+ end
57
+
58
+ def longitude
59
+ return unless lookup
60
+ lookup.longitude.presence
61
+ rescue => exception
62
+ end
63
+
46
64
  def city_name
47
65
  return unless lookup
48
66
  lookup.city.presence
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locality
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - bukowskis
@@ -14,14 +14,14 @@ dependencies:
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
@@ -42,14 +42,14 @@ dependencies:
42
42
  name: hashie
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
@@ -70,98 +70,98 @@ dependencies:
70
70
  name: i18n
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: operation
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: trouble
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ! '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ! '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ! '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ! '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: guard-rspec
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ! '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ! '>='
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rb-fsevent
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ! '>='
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ! '>='
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: webmock
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ! '>='
157
+ - - ">="
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ! '>='
164
+ - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  description: See https://github.com/bukowskis/locality
@@ -190,12 +190,12 @@ require_paths:
190
190
  - lib
191
191
  required_ruby_version: !ruby/object:Gem::Requirement
192
192
  requirements:
193
- - - ! '>='
193
+ - - ">="
194
194
  - !ruby/object:Gem::Version
195
195
  version: '0'
196
196
  required_rubygems_version: !ruby/object:Gem::Requirement
197
197
  requirements:
198
- - - ! '>='
198
+ - - ">="
199
199
  - !ruby/object:Gem::Version
200
200
  version: '0'
201
201
  requirements: []
@@ -205,4 +205,3 @@ signing_key:
205
205
  specification_version: 4
206
206
  summary: Wrapping databases provided by maxmind.com and postnummerservice.se
207
207
  test_files: []
208
- has_rdoc: