geocoder 1.2.7 → 1.2.8

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.

Potentially problematic release.


This version of geocoder might be problematic. Click here for more details.

Files changed (180) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -1
  3. data/README.md +31 -28
  4. data/examples/reverse_geocode_job.rb +40 -0
  5. data/lib/geocoder.rb +1 -0
  6. data/lib/geocoder/configuration.rb +5 -1
  7. data/lib/geocoder/exceptions.rb +3 -0
  8. data/lib/geocoder/ip_address.rb +2 -10
  9. data/lib/geocoder/logger.rb +55 -0
  10. data/lib/geocoder/lookup.rb +2 -1
  11. data/lib/geocoder/lookups/baidu.rb +5 -5
  12. data/lib/geocoder/lookups/baidu_ip.rb +5 -5
  13. data/lib/geocoder/lookups/base.rb +21 -16
  14. data/lib/geocoder/lookups/bing.rb +15 -2
  15. data/lib/geocoder/lookups/esri.rb +1 -1
  16. data/lib/geocoder/lookups/geocoder_ca.rb +1 -2
  17. data/lib/geocoder/lookups/geocodio.rb +3 -3
  18. data/lib/geocoder/lookups/google.rb +3 -3
  19. data/lib/geocoder/lookups/google_places_details.rb +3 -3
  20. data/lib/geocoder/lookups/mapquest.rb +3 -3
  21. data/lib/geocoder/lookups/maxmind.rb +1 -1
  22. data/lib/geocoder/lookups/maxmind_geoip2.rb +69 -0
  23. data/lib/geocoder/lookups/nominatim.rb +1 -1
  24. data/lib/geocoder/lookups/opencagedata.rb +4 -4
  25. data/lib/geocoder/lookups/pointpin.rb +4 -4
  26. data/lib/geocoder/lookups/postcode_anywhere_uk.rb +3 -3
  27. data/lib/geocoder/lookups/yahoo.rb +3 -3
  28. data/lib/geocoder/lookups/yandex.rb +3 -3
  29. data/lib/geocoder/query.rb +1 -1
  30. data/lib/geocoder/request.rb +70 -12
  31. data/lib/geocoder/results/geoip2.rb +8 -14
  32. data/lib/geocoder/results/maxmind_geoip2.rb +9 -0
  33. data/lib/geocoder/results/yandex.rb +5 -5
  34. data/lib/geocoder/version.rb +1 -1
  35. metadata +6 -147
  36. data/.gitignore +0 -6
  37. data/.travis.yml +0 -32
  38. data/Rakefile +0 -25
  39. data/examples/sidekiq_worker.rb +0 -16
  40. data/gemfiles/Gemfile.mongoid-2.4.x +0 -16
  41. data/test/fixtures/baidu_invalid_key +0 -1
  42. data/test/fixtures/baidu_ip_202_198_16_3 +0 -19
  43. data/test/fixtures/baidu_ip_invalid_key +0 -1
  44. data/test/fixtures/baidu_ip_no_results +0 -1
  45. data/test/fixtures/baidu_no_results +0 -1
  46. data/test/fixtures/baidu_reverse +0 -1
  47. data/test/fixtures/baidu_shanghai_pearl_tower +0 -12
  48. data/test/fixtures/bing_invalid_key +0 -1
  49. data/test/fixtures/bing_madison_square_garden +0 -40
  50. data/test/fixtures/bing_no_results +0 -16
  51. data/test/fixtures/bing_reverse +0 -42
  52. data/test/fixtures/cloudmade_invalid_key +0 -1
  53. data/test/fixtures/cloudmade_madison_square_garden +0 -1
  54. data/test/fixtures/cloudmade_no_results +0 -1
  55. data/test/fixtures/esri_madison_square_garden +0 -59
  56. data/test/fixtures/esri_no_results +0 -8
  57. data/test/fixtures/esri_reverse +0 -21
  58. data/test/fixtures/freegeoip_74_200_247_59 +0 -12
  59. data/test/fixtures/freegeoip_no_results +0 -1
  60. data/test/fixtures/geocoder_ca_madison_square_garden +0 -1
  61. data/test/fixtures/geocoder_ca_no_results +0 -1
  62. data/test/fixtures/geocoder_ca_reverse +0 -34
  63. data/test/fixtures/geocoder_us_madison_square_garden +0 -1
  64. data/test/fixtures/geocoder_us_no_results +0 -1
  65. data/test/fixtures/geocodio_1101_pennsylvania_ave +0 -1
  66. data/test/fixtures/geocodio_bad_api_key +0 -3
  67. data/test/fixtures/geocodio_invalid +0 -4
  68. data/test/fixtures/geocodio_no_results +0 -1
  69. data/test/fixtures/geocodio_over_query_limit +0 -4
  70. data/test/fixtures/google_garbage +0 -456
  71. data/test/fixtures/google_madison_square_garden +0 -57
  72. data/test/fixtures/google_no_city_data +0 -44
  73. data/test/fixtures/google_no_locality +0 -51
  74. data/test/fixtures/google_no_results +0 -4
  75. data/test/fixtures/google_over_limit +0 -4
  76. data/test/fixtures/google_places_details_invalid_request +0 -4
  77. data/test/fixtures/google_places_details_madison_square_garden +0 -120
  78. data/test/fixtures/google_places_details_no_results +0 -4
  79. data/test/fixtures/google_places_details_no_reviews +0 -60
  80. data/test/fixtures/google_places_details_no_types +0 -66
  81. data/test/fixtures/here_madison_square_garden +0 -72
  82. data/test/fixtures/here_no_results +0 -8
  83. data/test/fixtures/mapquest_error +0 -16
  84. data/test/fixtures/mapquest_invalid_api_key +0 -16
  85. data/test/fixtures/mapquest_invalid_request +0 -16
  86. data/test/fixtures/mapquest_madison_square_garden +0 -52
  87. data/test/fixtures/mapquest_no_results +0 -16
  88. data/test/fixtures/maxmind_24_24_24_21 +0 -1
  89. data/test/fixtures/maxmind_24_24_24_22 +0 -1
  90. data/test/fixtures/maxmind_24_24_24_23 +0 -1
  91. data/test/fixtures/maxmind_24_24_24_24 +0 -1
  92. data/test/fixtures/maxmind_74_200_247_59 +0 -1
  93. data/test/fixtures/maxmind_invalid_key +0 -1
  94. data/test/fixtures/maxmind_no_results +0 -1
  95. data/test/fixtures/nominatim_madison_square_garden +0 -150
  96. data/test/fixtures/nominatim_no_results +0 -1
  97. data/test/fixtures/nominatim_over_limit +0 -1
  98. data/test/fixtures/okf_kirstinmaki +0 -67
  99. data/test/fixtures/okf_no_results +0 -4
  100. data/test/fixtures/opencagedata_invalid_api_key +0 -25
  101. data/test/fixtures/opencagedata_invalid_request +0 -26
  102. data/test/fixtures/opencagedata_madison_square_garden +0 -73
  103. data/test/fixtures/opencagedata_no_results +0 -29
  104. data/test/fixtures/opencagedata_over_limit +0 -31
  105. data/test/fixtures/ovi_madison_square_garden +0 -72
  106. data/test/fixtures/ovi_no_results +0 -8
  107. data/test/fixtures/pointpin_10_10_10_10 +0 -1
  108. data/test/fixtures/pointpin_555_555_555_555 +0 -1
  109. data/test/fixtures/pointpin_80_111_555_555 +0 -1
  110. data/test/fixtures/pointpin_no_results +0 -1
  111. data/test/fixtures/postcode_anywhere_uk_geocode_v2_00_WR26NJ +0 -1
  112. data/test/fixtures/postcode_anywhere_uk_geocode_v2_00_generic_error +0 -1
  113. data/test/fixtures/postcode_anywhere_uk_geocode_v2_00_hampshire +0 -1
  114. data/test/fixtures/postcode_anywhere_uk_geocode_v2_00_key_limit_exceeded +0 -1
  115. data/test/fixtures/postcode_anywhere_uk_geocode_v2_00_no_results +0 -1
  116. data/test/fixtures/postcode_anywhere_uk_geocode_v2_00_romsey +0 -1
  117. data/test/fixtures/postcode_anywhere_uk_geocode_v2_00_unknown_key +0 -1
  118. data/test/fixtures/smarty_streets_11211 +0 -1
  119. data/test/fixtures/smarty_streets_madison_square_garden +0 -47
  120. data/test/fixtures/smarty_streets_no_results +0 -1
  121. data/test/fixtures/telize_10_10_10_10 +0 -1
  122. data/test/fixtures/telize_555_555_555_555 +0 -4
  123. data/test/fixtures/telize_74_200_247_59 +0 -1
  124. data/test/fixtures/telize_no_results +0 -1
  125. data/test/fixtures/yahoo_error +0 -1
  126. data/test/fixtures/yahoo_invalid_key +0 -2
  127. data/test/fixtures/yahoo_madison_square_garden +0 -52
  128. data/test/fixtures/yahoo_no_results +0 -10
  129. data/test/fixtures/yahoo_over_limit +0 -2
  130. data/test/fixtures/yandex_canada_rue_dupuis_14 +0 -446
  131. data/test/fixtures/yandex_invalid_key +0 -1
  132. data/test/fixtures/yandex_kremlin +0 -48
  133. data/test/fixtures/yandex_new_york +0 -1
  134. data/test/fixtures/yandex_no_administrative_area +0 -53
  135. data/test/fixtures/yandex_no_city_and_town +0 -112
  136. data/test/fixtures/yandex_no_results +0 -16
  137. data/test/integration/http_client_test.rb +0 -31
  138. data/test/mongoid_test_helper.rb +0 -43
  139. data/test/test_helper.rb +0 -423
  140. data/test/unit/active_record_test.rb +0 -16
  141. data/test/unit/cache_test.rb +0 -37
  142. data/test/unit/calculations_test.rb +0 -220
  143. data/test/unit/configuration_test.rb +0 -55
  144. data/test/unit/error_handling_test.rb +0 -79
  145. data/test/unit/geocoder_test.rb +0 -78
  146. data/test/unit/https_test.rb +0 -17
  147. data/test/unit/ip_address_test.rb +0 -27
  148. data/test/unit/lookup_test.rb +0 -153
  149. data/test/unit/lookups/bing_test.rb +0 -68
  150. data/test/unit/lookups/dstk_test.rb +0 -26
  151. data/test/unit/lookups/esri_test.rb +0 -48
  152. data/test/unit/lookups/freegeoip_test.rb +0 -27
  153. data/test/unit/lookups/geocoder_ca_test.rb +0 -17
  154. data/test/unit/lookups/geocodio_test.rb +0 -56
  155. data/test/unit/lookups/geoip2_test.rb +0 -27
  156. data/test/unit/lookups/google_places_details_test.rb +0 -122
  157. data/test/unit/lookups/google_premier_test.rb +0 -22
  158. data/test/unit/lookups/google_test.rb +0 -84
  159. data/test/unit/lookups/mapquest_test.rb +0 -60
  160. data/test/unit/lookups/maxmind_local_test.rb +0 -28
  161. data/test/unit/lookups/maxmind_test.rb +0 -63
  162. data/test/unit/lookups/nominatim_test.rb +0 -31
  163. data/test/unit/lookups/okf_test.rb +0 -38
  164. data/test/unit/lookups/opencagedata_test.rb +0 -64
  165. data/test/unit/lookups/pointpin_test.rb +0 -30
  166. data/test/unit/lookups/postcode_anywhere_uk_test.rb +0 -70
  167. data/test/unit/lookups/smarty_streets_test.rb +0 -71
  168. data/test/unit/lookups/telize_test.rb +0 -36
  169. data/test/unit/lookups/yahoo_test.rb +0 -35
  170. data/test/unit/method_aliases_test.rb +0 -26
  171. data/test/unit/model_test.rb +0 -38
  172. data/test/unit/mongoid_test.rb +0 -47
  173. data/test/unit/near_test.rb +0 -87
  174. data/test/unit/oauth_util_test.rb +0 -31
  175. data/test/unit/proxy_test.rb +0 -37
  176. data/test/unit/query_test.rb +0 -52
  177. data/test/unit/rake_task_test.rb +0 -21
  178. data/test/unit/request_test.rb +0 -35
  179. data/test/unit/result_test.rb +0 -81
  180. data/test/unit/test_mode_test.rb +0 -70
@@ -0,0 +1,9 @@
1
+ require 'geocoder/results/geoip2'
2
+
3
+ module Geocoder::Result
4
+ class MaxmindGeoip2 < Geoip2
5
+ # MindmindGeoip2 has the same results as Geoip2 because both are from MaxMind's GeoIP2 Precision Services
6
+ # See http://dev.maxmind.com/geoip/geoip2/web-services/ The difference being that Maxmind calls the service
7
+ # directly while GeoIP2 uses Hive::GeoIP2. See https://github.com/desuwa/hive_geoip2
8
+ end
9
+ end
@@ -12,9 +12,9 @@ module Geocoder::Result
12
12
  end
13
13
 
14
14
  def city
15
- if state.empty? and address_details.has_key? 'Locality'
15
+ if state.empty? and address_details and address_details.has_key? 'Locality'
16
16
  address_details['Locality']['LocalityName']
17
- elsif sub_state.empty? and address_details.has_key? 'AdministrativeArea' and
17
+ elsif sub_state.empty? and address_details and address_details.has_key? 'AdministrativeArea' and
18
18
  address_details['AdministrativeArea'].has_key? 'Locality'
19
19
  address_details['AdministrativeArea']['Locality']['LocalityName']
20
20
  elsif not sub_state_city.empty?
@@ -33,7 +33,7 @@ module Geocoder::Result
33
33
  end
34
34
 
35
35
  def state
36
- if address_details['AdministrativeArea']
36
+ if address_details and address_details['AdministrativeArea']
37
37
  address_details['AdministrativeArea']['AdministrativeAreaName']
38
38
  else
39
39
  ""
@@ -41,7 +41,7 @@ module Geocoder::Result
41
41
  end
42
42
 
43
43
  def sub_state
44
- if !state.empty? and address_details['AdministrativeArea']['SubAdministrativeArea']
44
+ if !state.empty? and address_details and address_details['AdministrativeArea']['SubAdministrativeArea']
45
45
  address_details['AdministrativeArea']['SubAdministrativeArea']['SubAdministrativeAreaName']
46
46
  else
47
47
  ""
@@ -75,7 +75,7 @@ module Geocoder::Result
75
75
  end
76
76
 
77
77
  def sub_state_city
78
- if !sub_state.empty? and address_details['AdministrativeArea']['SubAdministrativeArea'].has_key? 'Locality'
78
+ if !sub_state.empty? and address_details and address_details['AdministrativeArea']['SubAdministrativeArea'].has_key? 'Locality'
79
79
  address_details['AdministrativeArea']['SubAdministrativeArea']['Locality']['LocalityName'] || ""
80
80
  else
81
81
  ""
@@ -1,3 +1,3 @@
1
1
  module Geocoder
2
- VERSION = "1.2.7"
2
+ VERSION = "1.2.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geocoder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.7
4
+ version: 1.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Reisner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-24 00:00:00.000000000 Z
11
+ date: 2015-03-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Provides object geocoding (by street or IP address), reverse geocoding
14
14
  (coordinates to street address), distance queries for ActiveRecord and Mongoid,
@@ -21,18 +21,14 @@ executables:
21
21
  extensions: []
22
22
  extra_rdoc_files: []
23
23
  files:
24
- - ".gitignore"
25
- - ".travis.yml"
26
24
  - CHANGELOG.md
27
25
  - LICENSE
28
26
  - README.md
29
- - Rakefile
30
27
  - bin/geocode
31
28
  - examples/autoexpire_cache_dalli.rb
32
29
  - examples/autoexpire_cache_redis.rb
33
30
  - examples/cache_bypass.rb
34
- - examples/sidekiq_worker.rb
35
- - gemfiles/Gemfile.mongoid-2.4.x
31
+ - examples/reverse_geocode_job.rb
36
32
  - lib/generators/geocoder/config/config_generator.rb
37
33
  - lib/generators/geocoder/config/templates/initializer.rb
38
34
  - lib/generators/geocoder/maxmind/geolite_city_generator.rb
@@ -47,6 +43,7 @@ files:
47
43
  - lib/geocoder/configuration_hash.rb
48
44
  - lib/geocoder/exceptions.rb
49
45
  - lib/geocoder/ip_address.rb
46
+ - lib/geocoder/logger.rb
50
47
  - lib/geocoder/lookup.rb
51
48
  - lib/geocoder/lookups/baidu.rb
52
49
  - lib/geocoder/lookups/baidu_ip.rb
@@ -65,6 +62,7 @@ files:
65
62
  - lib/geocoder/lookups/here.rb
66
63
  - lib/geocoder/lookups/mapquest.rb
67
64
  - lib/geocoder/lookups/maxmind.rb
65
+ - lib/geocoder/lookups/maxmind_geoip2.rb
68
66
  - lib/geocoder/lookups/maxmind_local.rb
69
67
  - lib/geocoder/lookups/nominatim.rb
70
68
  - lib/geocoder/lookups/okf.rb
@@ -102,6 +100,7 @@ files:
102
100
  - lib/geocoder/results/here.rb
103
101
  - lib/geocoder/results/mapquest.rb
104
102
  - lib/geocoder/results/maxmind.rb
103
+ - lib/geocoder/results/maxmind_geoip2.rb
105
104
  - lib/geocoder/results/maxmind_local.rb
106
105
  - lib/geocoder/results/nominatim.rb
107
106
  - lib/geocoder/results/okf.rb
@@ -126,146 +125,6 @@ files:
126
125
  - lib/oauth_util.rb
127
126
  - lib/tasks/geocoder.rake
128
127
  - lib/tasks/maxmind.rake
129
- - test/fixtures/baidu_invalid_key
130
- - test/fixtures/baidu_ip_202_198_16_3
131
- - test/fixtures/baidu_ip_invalid_key
132
- - test/fixtures/baidu_ip_no_results
133
- - test/fixtures/baidu_no_results
134
- - test/fixtures/baidu_reverse
135
- - test/fixtures/baidu_shanghai_pearl_tower
136
- - test/fixtures/bing_invalid_key
137
- - test/fixtures/bing_madison_square_garden
138
- - test/fixtures/bing_no_results
139
- - test/fixtures/bing_reverse
140
- - test/fixtures/cloudmade_invalid_key
141
- - test/fixtures/cloudmade_madison_square_garden
142
- - test/fixtures/cloudmade_no_results
143
- - test/fixtures/esri_madison_square_garden
144
- - test/fixtures/esri_no_results
145
- - test/fixtures/esri_reverse
146
- - test/fixtures/freegeoip_74_200_247_59
147
- - test/fixtures/freegeoip_no_results
148
- - test/fixtures/geocoder_ca_madison_square_garden
149
- - test/fixtures/geocoder_ca_no_results
150
- - test/fixtures/geocoder_ca_reverse
151
- - test/fixtures/geocoder_us_madison_square_garden
152
- - test/fixtures/geocoder_us_no_results
153
- - test/fixtures/geocodio_1101_pennsylvania_ave
154
- - test/fixtures/geocodio_bad_api_key
155
- - test/fixtures/geocodio_invalid
156
- - test/fixtures/geocodio_no_results
157
- - test/fixtures/geocodio_over_query_limit
158
- - test/fixtures/google_garbage
159
- - test/fixtures/google_madison_square_garden
160
- - test/fixtures/google_no_city_data
161
- - test/fixtures/google_no_locality
162
- - test/fixtures/google_no_results
163
- - test/fixtures/google_over_limit
164
- - test/fixtures/google_places_details_invalid_request
165
- - test/fixtures/google_places_details_madison_square_garden
166
- - test/fixtures/google_places_details_no_results
167
- - test/fixtures/google_places_details_no_reviews
168
- - test/fixtures/google_places_details_no_types
169
- - test/fixtures/here_madison_square_garden
170
- - test/fixtures/here_no_results
171
- - test/fixtures/mapquest_error
172
- - test/fixtures/mapquest_invalid_api_key
173
- - test/fixtures/mapquest_invalid_request
174
- - test/fixtures/mapquest_madison_square_garden
175
- - test/fixtures/mapquest_no_results
176
- - test/fixtures/maxmind_24_24_24_21
177
- - test/fixtures/maxmind_24_24_24_22
178
- - test/fixtures/maxmind_24_24_24_23
179
- - test/fixtures/maxmind_24_24_24_24
180
- - test/fixtures/maxmind_74_200_247_59
181
- - test/fixtures/maxmind_invalid_key
182
- - test/fixtures/maxmind_no_results
183
- - test/fixtures/nominatim_madison_square_garden
184
- - test/fixtures/nominatim_no_results
185
- - test/fixtures/nominatim_over_limit
186
- - test/fixtures/okf_kirstinmaki
187
- - test/fixtures/okf_no_results
188
- - test/fixtures/opencagedata_invalid_api_key
189
- - test/fixtures/opencagedata_invalid_request
190
- - test/fixtures/opencagedata_madison_square_garden
191
- - test/fixtures/opencagedata_no_results
192
- - test/fixtures/opencagedata_over_limit
193
- - test/fixtures/ovi_madison_square_garden
194
- - test/fixtures/ovi_no_results
195
- - test/fixtures/pointpin_10_10_10_10
196
- - test/fixtures/pointpin_555_555_555_555
197
- - test/fixtures/pointpin_80_111_555_555
198
- - test/fixtures/pointpin_no_results
199
- - test/fixtures/postcode_anywhere_uk_geocode_v2_00_WR26NJ
200
- - test/fixtures/postcode_anywhere_uk_geocode_v2_00_generic_error
201
- - test/fixtures/postcode_anywhere_uk_geocode_v2_00_hampshire
202
- - test/fixtures/postcode_anywhere_uk_geocode_v2_00_key_limit_exceeded
203
- - test/fixtures/postcode_anywhere_uk_geocode_v2_00_no_results
204
- - test/fixtures/postcode_anywhere_uk_geocode_v2_00_romsey
205
- - test/fixtures/postcode_anywhere_uk_geocode_v2_00_unknown_key
206
- - test/fixtures/smarty_streets_11211
207
- - test/fixtures/smarty_streets_madison_square_garden
208
- - test/fixtures/smarty_streets_no_results
209
- - test/fixtures/telize_10_10_10_10
210
- - test/fixtures/telize_555_555_555_555
211
- - test/fixtures/telize_74_200_247_59
212
- - test/fixtures/telize_no_results
213
- - test/fixtures/yahoo_error
214
- - test/fixtures/yahoo_invalid_key
215
- - test/fixtures/yahoo_madison_square_garden
216
- - test/fixtures/yahoo_no_results
217
- - test/fixtures/yahoo_over_limit
218
- - test/fixtures/yandex_canada_rue_dupuis_14
219
- - test/fixtures/yandex_invalid_key
220
- - test/fixtures/yandex_kremlin
221
- - test/fixtures/yandex_new_york
222
- - test/fixtures/yandex_no_administrative_area
223
- - test/fixtures/yandex_no_city_and_town
224
- - test/fixtures/yandex_no_results
225
- - test/integration/http_client_test.rb
226
- - test/mongoid_test_helper.rb
227
- - test/test_helper.rb
228
- - test/unit/active_record_test.rb
229
- - test/unit/cache_test.rb
230
- - test/unit/calculations_test.rb
231
- - test/unit/configuration_test.rb
232
- - test/unit/error_handling_test.rb
233
- - test/unit/geocoder_test.rb
234
- - test/unit/https_test.rb
235
- - test/unit/ip_address_test.rb
236
- - test/unit/lookup_test.rb
237
- - test/unit/lookups/bing_test.rb
238
- - test/unit/lookups/dstk_test.rb
239
- - test/unit/lookups/esri_test.rb
240
- - test/unit/lookups/freegeoip_test.rb
241
- - test/unit/lookups/geocoder_ca_test.rb
242
- - test/unit/lookups/geocodio_test.rb
243
- - test/unit/lookups/geoip2_test.rb
244
- - test/unit/lookups/google_places_details_test.rb
245
- - test/unit/lookups/google_premier_test.rb
246
- - test/unit/lookups/google_test.rb
247
- - test/unit/lookups/mapquest_test.rb
248
- - test/unit/lookups/maxmind_local_test.rb
249
- - test/unit/lookups/maxmind_test.rb
250
- - test/unit/lookups/nominatim_test.rb
251
- - test/unit/lookups/okf_test.rb
252
- - test/unit/lookups/opencagedata_test.rb
253
- - test/unit/lookups/pointpin_test.rb
254
- - test/unit/lookups/postcode_anywhere_uk_test.rb
255
- - test/unit/lookups/smarty_streets_test.rb
256
- - test/unit/lookups/telize_test.rb
257
- - test/unit/lookups/yahoo_test.rb
258
- - test/unit/method_aliases_test.rb
259
- - test/unit/model_test.rb
260
- - test/unit/mongoid_test.rb
261
- - test/unit/near_test.rb
262
- - test/unit/oauth_util_test.rb
263
- - test/unit/proxy_test.rb
264
- - test/unit/query_test.rb
265
- - test/unit/rake_task_test.rb
266
- - test/unit/request_test.rb
267
- - test/unit/result_test.rb
268
- - test/unit/test_mode_test.rb
269
128
  homepage: http://www.rubygeocoder.com
270
129
  licenses:
271
130
  - MIT
data/.gitignore DELETED
@@ -1,6 +0,0 @@
1
- pkg/*
2
- rdoc/*
3
- *.gem
4
- .bundle
5
- Gemfile.lock
6
- api_keys.yml
@@ -1,32 +0,0 @@
1
- rvm:
2
- - 1.9.2
3
- - 1.9.3
4
- - 2.0.0
5
- - 2.1.2
6
- - 2.2.0
7
- - jruby-19mode
8
- - rbx-2
9
- gemfile:
10
- - Gemfile
11
- - gemfiles/Gemfile.mongoid-2.4.x
12
- env: SSL_CERT_DIR=/etc/ssl/certs
13
- matrix:
14
- exclude:
15
- - rvm: 1.9.2
16
- gemfile: Gemfile
17
- env: SSL_CERT_DIR=/etc/ssl/certs
18
- - rvm: 1.9.3
19
- gemfile: gemfiles/Gemfile.mongoid-2.4.x
20
- env: SSL_CERT_DIR=/etc/ssl/certs
21
- - rvm: 2.0.0
22
- gemfile: gemfiles/Gemfile.mongoid-2.4.x
23
- env: SSL_CERT_DIR=/etc/ssl/certs
24
- - rvm: 2.1.2
25
- gemfile: gemfiles/Gemfile.mongoid-2.4.x
26
- env: SSL_CERT_DIR=/etc/ssl/certs
27
- - rvm: jruby-19mode
28
- gemfile: gemfiles/Gemfile.mongoid-2.4.x
29
- env: SSL_CERT_DIR=/etc/ssl/certs
30
- - rvm: rbx-2
31
- gemfile: gemfiles/Gemfile.mongoid-2.4.x
32
- env: SSL_CERT_DIR=/etc/ssl/certs
data/Rakefile DELETED
@@ -1,25 +0,0 @@
1
- require 'bundler'
2
- Bundler::GemHelper.install_tasks
3
-
4
- require 'rake/testtask'
5
- Rake::TestTask.new(:test) do |test|
6
- test.libs << 'lib' << 'test'
7
- test.pattern = 'test/unit/**/*_test.rb'
8
- test.verbose = true
9
- end
10
-
11
- Rake::TestTask.new(:integration) do |test|
12
- test.libs << 'lib' << 'test'
13
- test.pattern = 'test/integration/*_test.rb'
14
- test.verbose = true
15
- end
16
-
17
- task :default => [:test]
18
-
19
- require 'rdoc/task'
20
- Rake::RDocTask.new do |rdoc|
21
- rdoc.rdoc_dir = 'rdoc'
22
- rdoc.title = "Geocoder #{Geocoder::VERSION}"
23
- rdoc.rdoc_files.include('*.rdoc')
24
- rdoc.rdoc_files.include('lib/**/*.rb')
25
- end
@@ -1,16 +0,0 @@
1
- # This class implements a Sidekiq worker for performing geocoding
2
- # asynchronously. Do something like this in your controller:
3
- #
4
- # if @object.save
5
- # GeocoderWorker.perform_async(@object.id)
6
- # end
7
- #
8
- class GeocoderWorker
9
- include Sidekiq::Worker
10
-
11
- def perform(object_id)
12
- object = Object.find(object_id)
13
- object.geocode
14
- object.save!
15
- end
16
- end
@@ -1,16 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- gemspec :path => '..'
4
-
5
- group :development, :test do
6
- gem 'rake'
7
- gem 'mongoid', '2.4.11'
8
- gem 'bson_ext', :platforms => :ruby
9
- gem 'geoip'
10
-
11
- gem 'rails'
12
-
13
- platforms :jruby do
14
- gem 'jruby-openssl'
15
- end
16
- end
@@ -1 +0,0 @@
1
- {"results":[],"status":5,"msg":"AK Illegal or Not Exist:"}
@@ -1,19 +0,0 @@
1
- {
2
- "address": "CN|北京|北京|None|CHINANET|1|None",
3
- "content": {
4
- "address": "北京市",
5
- "address_detail": {
6
- "city": "北京市",
7
- "city_code": 131,
8
- "district": "",
9
- "province": "北京市",
10
- "street": "",
11
- "street_number": ""
12
- },
13
- "point": {
14
- "x": "116.39564504",
15
- "y": "39.92998578"
16
- }
17
- },
18
- "status": 0
19
- }
@@ -1 +0,0 @@
1
- {"status":5,"uid":null,"sk":null,"logformat":null}
@@ -1 +0,0 @@
1
- {"status":0, "content":{}}
@@ -1 +0,0 @@
1
- {"status":0,"result":[]}
@@ -1 +0,0 @@
1
- {"status":0,"result":{"location":{"lng":121.48789948569,"lat":31.249161555654},"formatted_address":"上海市闸北区天潼路619号","business":"七浦路,海宁路,北京东路","addressComponent":{"city":"上海市","district":"闸北区","province":"上海市","street":"天潼路","street_number":"619号"},"cityCode":289}}
@@ -1,12 +0,0 @@
1
- {
2
- "status":0,
3
- "result":{
4
- "location":{
5
- "lng":116.30814954222,
6
- "lat":40.056885091681
7
- },
8
- "precise":1,
9
- "confidence":80,
10
- "level":"\u5546\u52a1\u5927\u53a6"
11
- }
12
- }
@@ -1 +0,0 @@
1
- {"authenticationResultCode":"InvalidCredentials","brandLogoUri":"http:\\/\\/dev.virtualearth.net\\/Branding\\/logo_powered_by.png","copyright":"Copyright \xC2\xA9 2012 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","errorDetails":["Access was denied. You may have entered your credentials incorrectly, or you might not have access to the requested resource or operation."],"resourceSets":[],"statusCode":401,"statusDescription":"Unauthorized","traceId":"5c539f6e70c44b2e858741b6c932318e|EWRM001670|02.00.83.1900|"}
@@ -1,40 +0,0 @@
1
- {
2
- "authenticationResultCode":"ValidCredentials",
3
- "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",
4
- "copyright":"Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.",
5
- "resourceSets":[
6
- {
7
- "estimatedTotal":1,
8
- "resources":[
9
- {
10
- "__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",
11
- "bbox":[
12
- 40.744944289326668,
13
- -74.002353921532631,
14
- 40.755675807595253,
15
- -73.983625397086143
16
- ],
17
- "name":"Madison Square Garden, NY",
18
- "point":{
19
- "type":"Point",
20
- "coordinates":[
21
- 40.75031,
22
- -73.99299
23
- ]
24
- },
25
- "address":{
26
- "adminDistrict":"NY",
27
- "countryRegion":"United States",
28
- "formattedAddress":"Madison Square Garden, NY",
29
- "locality":"New York"
30
- },
31
- "confidence":"High",
32
- "entityType":"Stadium"
33
- }
34
- ]
35
- }
36
- ],
37
- "statusCode":200,
38
- "statusDescription":"OK",
39
- "traceId":"55094ee53c8d45e789794014666328cd|CH1M001466|02.00.82.2800|CH1MSNVM001396, CH1MSNVM001370, CH1MSNVM001397"
40
- }