geocoder 1.1.9 → 1.3.7

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


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

Files changed (174) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +157 -0
  3. data/README.md +467 -70
  4. data/examples/reverse_geocode_job.rb +40 -0
  5. data/lib/generators/geocoder/config/templates/initializer.rb +16 -16
  6. data/lib/generators/geocoder/maxmind/geolite_city_generator.rb +28 -0
  7. data/lib/generators/geocoder/maxmind/geolite_country_generator.rb +28 -0
  8. data/lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb +30 -0
  9. data/lib/generators/geocoder/maxmind/templates/migration/geolite_country.rb +17 -0
  10. data/lib/geocoder/cache.rb +3 -2
  11. data/lib/geocoder/calculations.rb +44 -2
  12. data/lib/geocoder/configuration.rb +17 -10
  13. data/lib/geocoder/esri_token.rb +38 -0
  14. data/lib/geocoder/exceptions.rb +19 -0
  15. data/lib/geocoder/ip_address.rb +13 -0
  16. data/lib/geocoder/kernel_logger.rb +25 -0
  17. data/lib/geocoder/logger.rb +47 -0
  18. data/lib/geocoder/lookup.rb +32 -8
  19. data/lib/geocoder/lookups/baidu.rb +18 -13
  20. data/lib/geocoder/lookups/baidu_ip.rb +59 -0
  21. data/lib/geocoder/lookups/base.rb +81 -19
  22. data/lib/geocoder/lookups/bing.rb +40 -7
  23. data/lib/geocoder/lookups/esri.rb +42 -5
  24. data/lib/geocoder/lookups/freegeoip.rb +9 -1
  25. data/lib/geocoder/lookups/geocoder_ca.rb +1 -2
  26. data/lib/geocoder/lookups/geocoder_us.rb +6 -2
  27. data/lib/geocoder/lookups/geocodio.rb +42 -0
  28. data/lib/geocoder/lookups/geoip2.rb +45 -0
  29. data/lib/geocoder/lookups/geoportail_lu.rb +65 -0
  30. data/lib/geocoder/lookups/google.rb +29 -5
  31. data/lib/geocoder/lookups/google_places_details.rb +50 -0
  32. data/lib/geocoder/lookups/google_premier.rb +1 -1
  33. data/lib/geocoder/lookups/here.rb +62 -0
  34. data/lib/geocoder/lookups/ipapi_com.rb +86 -0
  35. data/lib/geocoder/lookups/ipinfo_io.rb +55 -0
  36. data/lib/geocoder/lookups/latlon.rb +59 -0
  37. data/lib/geocoder/lookups/mapbox.rb +53 -0
  38. data/lib/geocoder/lookups/mapquest.rb +6 -6
  39. data/lib/geocoder/lookups/mapzen.rb +15 -0
  40. data/lib/geocoder/lookups/maxmind.rb +4 -2
  41. data/lib/geocoder/lookups/maxmind_geoip2.rb +69 -0
  42. data/lib/geocoder/lookups/maxmind_local.rb +65 -0
  43. data/lib/geocoder/lookups/nominatim.rb +9 -1
  44. data/lib/geocoder/lookups/okf.rb +44 -0
  45. data/lib/geocoder/lookups/opencagedata.rb +58 -0
  46. data/lib/geocoder/lookups/pelias.rb +64 -0
  47. data/lib/geocoder/lookups/pointpin.rb +68 -0
  48. data/lib/geocoder/lookups/postcode_anywhere_uk.rb +51 -0
  49. data/lib/geocoder/lookups/smarty_streets.rb +53 -0
  50. data/lib/geocoder/lookups/telize.rb +55 -0
  51. data/lib/geocoder/lookups/yandex.rb +8 -4
  52. data/lib/geocoder/models/active_record.rb +7 -3
  53. data/lib/geocoder/models/base.rb +1 -4
  54. data/lib/geocoder/models/mongo_base.rb +6 -4
  55. data/lib/geocoder/query.rb +9 -5
  56. data/lib/geocoder/railtie.rb +1 -1
  57. data/lib/geocoder/request.rb +74 -12
  58. data/lib/geocoder/results/baidu_ip.rb +62 -0
  59. data/lib/geocoder/results/bing.rb +4 -0
  60. data/lib/geocoder/results/esri.rb +30 -6
  61. data/lib/geocoder/results/freegeoip.rb +2 -2
  62. data/lib/geocoder/results/geocodio.rb +70 -0
  63. data/lib/geocoder/results/geoip2.rb +62 -0
  64. data/lib/geocoder/results/geoportail_lu.rb +69 -0
  65. data/lib/geocoder/results/google.rb +15 -0
  66. data/lib/geocoder/results/google_places_details.rb +35 -0
  67. data/lib/geocoder/results/here.rb +71 -0
  68. data/lib/geocoder/results/ipapi_com.rb +45 -0
  69. data/lib/geocoder/results/ipinfo_io.rb +48 -0
  70. data/lib/geocoder/results/latlon.rb +71 -0
  71. data/lib/geocoder/results/mapbox.rb +47 -0
  72. data/lib/geocoder/results/mapquest.rb +5 -8
  73. data/lib/geocoder/results/mapzen.rb +5 -0
  74. data/lib/geocoder/results/maxmind_geoip2.rb +9 -0
  75. data/lib/geocoder/results/maxmind_local.rb +49 -0
  76. data/lib/geocoder/results/nominatim.rb +6 -1
  77. data/lib/geocoder/results/okf.rb +106 -0
  78. data/lib/geocoder/results/opencagedata.rb +90 -0
  79. data/lib/geocoder/results/ovi.rb +9 -0
  80. data/lib/geocoder/results/pelias.rb +58 -0
  81. data/lib/geocoder/results/pointpin.rb +40 -0
  82. data/lib/geocoder/results/postcode_anywhere_uk.rb +42 -0
  83. data/lib/geocoder/results/smarty_streets.rb +106 -0
  84. data/lib/geocoder/results/telize.rb +45 -0
  85. data/lib/geocoder/results/test.rb +20 -3
  86. data/lib/geocoder/results/yandex.rb +18 -6
  87. data/lib/geocoder/sql.rb +16 -15
  88. data/lib/geocoder/stores/active_record.rb +51 -18
  89. data/lib/geocoder/stores/base.rb +8 -12
  90. data/lib/geocoder/stores/mongo_base.rb +0 -31
  91. data/lib/geocoder/version.rb +1 -1
  92. data/lib/geocoder.rb +6 -13
  93. data/lib/maxmind_database.rb +109 -0
  94. data/lib/tasks/geocoder.rake +14 -3
  95. data/lib/tasks/maxmind.rake +73 -0
  96. metadata +59 -85
  97. data/.gitignore +0 -5
  98. data/.travis.yml +0 -27
  99. data/Rakefile +0 -25
  100. data/gemfiles/Gemfile.mongoid-2.4.x +0 -15
  101. data/lib/geocoder/lookups/yahoo.rb +0 -86
  102. data/lib/geocoder/results/yahoo.rb +0 -55
  103. data/lib/oauth_util.rb +0 -112
  104. data/test/active_record_test.rb +0 -15
  105. data/test/cache_test.rb +0 -35
  106. data/test/calculations_test.rb +0 -211
  107. data/test/configuration_test.rb +0 -78
  108. data/test/custom_block_test.rb +0 -32
  109. data/test/error_handling_test.rb +0 -43
  110. data/test/fixtures/baidu_invalid_key +0 -1
  111. data/test/fixtures/baidu_no_results +0 -1
  112. data/test/fixtures/baidu_reverse +0 -1
  113. data/test/fixtures/baidu_shanghai_pearl_tower +0 -12
  114. data/test/fixtures/bing_invalid_key +0 -1
  115. data/test/fixtures/bing_madison_square_garden +0 -40
  116. data/test/fixtures/bing_no_results +0 -16
  117. data/test/fixtures/bing_reverse +0 -42
  118. data/test/fixtures/esri_madison_square_garden +0 -59
  119. data/test/fixtures/esri_no_results +0 -8
  120. data/test/fixtures/esri_reverse +0 -21
  121. data/test/fixtures/freegeoip_74_200_247_59 +0 -12
  122. data/test/fixtures/freegeoip_no_results +0 -1
  123. data/test/fixtures/geocoder_ca_madison_square_garden +0 -1
  124. data/test/fixtures/geocoder_ca_no_results +0 -1
  125. data/test/fixtures/geocoder_ca_reverse +0 -34
  126. data/test/fixtures/geocoder_us_madison_square_garden +0 -1
  127. data/test/fixtures/geocoder_us_no_results +0 -1
  128. data/test/fixtures/google_garbage +0 -456
  129. data/test/fixtures/google_madison_square_garden +0 -57
  130. data/test/fixtures/google_no_city_data +0 -44
  131. data/test/fixtures/google_no_locality +0 -51
  132. data/test/fixtures/google_no_results +0 -4
  133. data/test/fixtures/google_over_limit +0 -4
  134. data/test/fixtures/mapquest_error +0 -16
  135. data/test/fixtures/mapquest_invalid_api_key +0 -16
  136. data/test/fixtures/mapquest_invalid_request +0 -16
  137. data/test/fixtures/mapquest_madison_square_garden +0 -52
  138. data/test/fixtures/mapquest_no_results +0 -16
  139. data/test/fixtures/maxmind_24_24_24_21 +0 -1
  140. data/test/fixtures/maxmind_24_24_24_22 +0 -1
  141. data/test/fixtures/maxmind_24_24_24_23 +0 -1
  142. data/test/fixtures/maxmind_24_24_24_24 +0 -1
  143. data/test/fixtures/maxmind_74_200_247_59 +0 -1
  144. data/test/fixtures/maxmind_invalid_key +0 -1
  145. data/test/fixtures/maxmind_no_results +0 -1
  146. data/test/fixtures/nominatim_madison_square_garden +0 -150
  147. data/test/fixtures/nominatim_no_results +0 -1
  148. data/test/fixtures/ovi_madison_square_garden +0 -72
  149. data/test/fixtures/ovi_no_results +0 -8
  150. data/test/fixtures/yahoo_error +0 -1
  151. data/test/fixtures/yahoo_invalid_key +0 -2
  152. data/test/fixtures/yahoo_madison_square_garden +0 -52
  153. data/test/fixtures/yahoo_no_results +0 -10
  154. data/test/fixtures/yahoo_over_limit +0 -2
  155. data/test/fixtures/yandex_invalid_key +0 -1
  156. data/test/fixtures/yandex_kremlin +0 -48
  157. data/test/fixtures/yandex_no_city_and_town +0 -112
  158. data/test/fixtures/yandex_no_results +0 -16
  159. data/test/geocoder_test.rb +0 -59
  160. data/test/https_test.rb +0 -16
  161. data/test/integration/smoke_test.rb +0 -26
  162. data/test/lookup_test.rb +0 -117
  163. data/test/method_aliases_test.rb +0 -25
  164. data/test/mongoid_test.rb +0 -46
  165. data/test/mongoid_test_helper.rb +0 -43
  166. data/test/near_test.rb +0 -61
  167. data/test/oauth_util_test.rb +0 -30
  168. data/test/proxy_test.rb +0 -36
  169. data/test/query_test.rb +0 -52
  170. data/test/request_test.rb +0 -29
  171. data/test/result_test.rb +0 -42
  172. data/test/services_test.rb +0 -393
  173. data/test/test_helper.rb +0 -289
  174. data/test/test_mode_test.rb +0 -59
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e54ea93888b39c46a8ed298a9d3eca5c6a4533a
4
- data.tar.gz: 2b72dcae0e8cc61ba37fb831db4ef88b18543b56
3
+ metadata.gz: b3ba97fb2510ac5e0f739b4f7a11825f9d9bf277
4
+ data.tar.gz: d69a73fd1c4a6536170ac28563475def5ffed69e
5
5
  SHA512:
6
- metadata.gz: b30e519cafc13d8e57c300f6249fdae8736e92503ef3f2bb03b2670eca83f956c3640ddff1f8567bfbb3b80b048ae80a4bebf8f08423a8a137a0d7f3dfa83e2b
7
- data.tar.gz: dbd472d124b0b795b797abbfe997a9591db207495880c84fbda1f9c2b07626f176be4aab78136e59d347c4492f3b55b41e8381e8e59b85d36945f6d0a18323e1
6
+ metadata.gz: a09fa3752902e9422511ea4b30b038e8b91f6a6c6ad37aad0d979864ca610b0c5e5ab80fc9b0aff94dca4bcf493056e8d84a9d1433abc3b4a6385fd1fced6ea5
7
+ data.tar.gz: 77e358b416b3862952f8210f9a5752e0b1e11dc8247ed3f13966fe79c64af98fd7ef31a2b5310fb9fc36bfc98bde3330cf96baca1949229e99d159d724807856
data/CHANGELOG.md CHANGED
@@ -3,6 +3,163 @@ Changelog
3
3
 
4
4
  Major changes to Geocoder for each release. Please see the Git log for complete list of changes.
5
5
 
6
+ 1.3.7 (2016 Jun 9)
7
+ -------------------
8
+ * Fix Ruby 1.9, 2.0 incompatibility (thanks github.com/ebouchut).
9
+ * Update SmartyStreets zipcode API endpoint (thanks github.com/jeffects).
10
+ * Catch network errors (thanks github.com/sas1ni69).
11
+
12
+ 1.3.6 (2016 May 31)
13
+ -------------------
14
+ * Fix Sinatra support broken in 1.3.5.
15
+
16
+ 1.3.5 (2016 May 27)
17
+ -------------------
18
+ * Fix Rails 5 ActionDispatch include issue (thanks github.com/alepore).
19
+ * Fix bug that caused :esri lookup to ignore certain configured parameters (thanks github.com/aaronpk).
20
+ * Add reverse geocoding support to :pelias/:mapzen (thanks github.com/shinyaK14).
21
+ * Add support for custom host with :telize (thanks github.com/jwaldrip).
22
+ * Change the way :esri lookup generates cache keys for improved performance (thanks github.com/aaronpk).
23
+ * Improve HTTPS connections with :google (thanks github.com/jlhonora).
24
+
25
+ 1.3.4 (2016 Apr 14)
26
+ -------------------
27
+ * Update :freegeoip host (old one is down).
28
+ * Add IP lookup :ipapi_com (thanks github.com/piotrgorecki).
29
+
30
+ 1.3.3 (2016 Apr 4)
31
+ ------------------
32
+ * Fix incorrect gem version number.
33
+
34
+ 1.3.2 (2016 Apr 1)
35
+ ------------------
36
+ * Remove :yahoo lookup (service was discontinued Mar 31) (thanks github.com/galiat).
37
+ * Add support for LatLon.io service (thanks github.com/evanmarks).
38
+ * Add support for IpInfo.io service (thanks github.com/rehan, akostyuk).
39
+ * Add support for Pelias/Mapzen service (thanks github.com/RealScout).
40
+
41
+ 1.3.1 (2016 Feb 20)
42
+ -------------------
43
+ * Warn about upcoming discontinuation of :yahoo lookup (thanks github.com/galiat).
44
+ * Add #viewport method to results that return viewport data (thanks github.com/lime).
45
+
46
+ 1.3.0 (2016 Jan 31)
47
+ -------------------
48
+ * Lazy load lookups to reduce memory footprint (thanks github.com/TrangPham).
49
+ * Add :geoportail_lu lookup (Luxembourg only) (thanks github.com/mdebo).
50
+ * Maxmind local query performance improvement (thanks github.com/vojtad).
51
+ * Remove deprecated Mongo near query methods (please use Mongo-native methods instead).
52
+
53
+ 1.2.14 (2015 Dec 27)
54
+ --------------------
55
+ * Fix bug in :geoip2 lookup (thanks github.com/mromulus).
56
+
57
+ 1.2.13 (2015 Dec 15)
58
+ --------------------
59
+ * Update :telize IP lookup to reflect new URL (thanks github.com/jfredrickson).
60
+ * Add reverse geocode rake task (thanks github.com/FanaHOVA).
61
+ * Fix reversed coordinates array with Mapbox (thanks github.com/marcusat).
62
+ * Fix missing city name in some cases with ESRI (thanks github.com/roybotnik).
63
+ * Prevent re-opening of DB file on every read with :geoip2 (thanks github.com/oogali).
64
+
65
+ 1.2.12 (2015 Oct 29)
66
+ --------------------
67
+ * Fix Ruby 1.9.3 incompatibility (remove non-existent timeout classes) (thanks github.com/roychri).
68
+
69
+ 1.2.11 (2015 Sep 10)
70
+ --------------------
71
+ * Fix load issue on Ruby 1.9.3.
72
+
73
+ 1.2.10 (2015 Sep 7)
74
+ -------------------
75
+ * Force Yandex to use HTTPS (thanks github.com/donbobka).
76
+ * Force :google to use HTTPS if API key set.
77
+ * Fix out-of-the-box verbosity issues (GH #881).
78
+ * Improve timeout mechanism and add exception Geocoder::LookupTimeout (thanks github.com/ankane).
79
+ * Deprecate .near and #nearbys for MongoDB-backed models.
80
+
81
+ 1.2.9 (2015 Jun 12)
82
+ -------------------
83
+ * Don't cache unsuccessful responses from Bing (thanks github.com/peteb).
84
+ * Show API response when not valid JSON.
85
+ * Log each API request.
86
+ * Force all SmartyStreets requests to use HTTPS.
87
+
88
+ 1.2.8 (2015 Mar 21)
89
+ -------------------
90
+ * Add :maxmind_geoip2 lookup (thanks github.com/TrangPham).
91
+ * Add ability to force/specify query type (street or IP address) (thanks github.com/TrangPham).
92
+ * Add :basic_auth configuration (thanks github.com/TrangPham).
93
+ * Add `safe_location` method for Rails controllers (thanks github.com/edslocomb).
94
+ * Add :logger configuration (thanks github.com/TrangPham).
95
+ * Improve error condition handling with Bing (thanks github.com/TrangPham).
96
+
97
+ 1.2.7 (2015 Jan 24)
98
+ -------------------
99
+ * DROP SUPPORT for Ruby 1.9.2.
100
+ * Use UTF-8 encoding for maxmind_local results (thanks github.com/ellmo).
101
+ * Update freegeoip response handling (thanks github.com/hosamaly).
102
+ * Update nominatim response handling (thanks github.com/jsantos).
103
+ * Update yandex response handling (thanks github.com/wfleming).
104
+ * Update geocodio response handling (thanks github.com/getsidewalk).
105
+ * Add ability to raise exception when response parsing fails (thanks github.com/spiderpug).
106
+ * Fix double-loading of Railtie (thanks github.com/wfleming and zhouguangming).
107
+
108
+ 1.2.6 (2014 Nov 8)
109
+ ------------------
110
+ * Add :geoip2 lookup (thanks github.com/ChristianHoj).
111
+ * Add :okf lookup (thanks github.com/kakoni).
112
+ * Add :postcode_anywhere_uk lookup (thanks github.com/rob-murray).
113
+ * Properly detect IPv6 addresses (thanks github.com/sethherr and github.com/ignatiusreza).
114
+
115
+ 1.2.5 (2014 Sep 12)
116
+ -------------------
117
+ * Fix bugs in :opencagedata lookup (thanks github.com/duboff and kayakyakr).
118
+ * Allow language to be set in model configuration (thanks github.com/viniciusnz).
119
+ * Optimize lookup queries when using MaxMind Local (thanks github.com/gersmann).
120
+
121
+ 1.2.4 (2014 Aug 12)
122
+ -------------------
123
+ * Add ability to specify lat/lon column names with .near scope (thanks github.com/switzersc).
124
+ * Add OpenCageData geocoder (thanks github.com/mtmail).
125
+ * Remove CloudMade geocoder.
126
+
127
+ 1.2.3 (2014 Jul 11)
128
+ -------------------
129
+ * Add Telize IP address lookup (thanks github.com/lukeroberts1990).
130
+ * Fix bug in Bing reverse geocoding (thanks github.com/nickelser).
131
+
132
+ 1.2.2 (2014 Jun 12)
133
+ -------------------
134
+ * Add ability to specify language per query (thanks github.com/mkristian).
135
+ * Handle Errno::ECONNREFUSED exceptions like TimeoutError exceptions.
136
+ * Switch to 'unstructured' query format for Bing API (thanks github.com/lukewendling).
137
+
138
+ 1.2.1 (2014 May 12)
139
+ -------------------
140
+
141
+ * Fix: correctly handle encoding of MaxMind API responses (thanks github.com/hydrozen, gonzoyumo).
142
+ * Fixes to :maxmind_local database structure (thanks github.com/krakatoa).
143
+
144
+ 1.2.0 (2014 Apr 16)
145
+ -------------------
146
+
147
+ * DROP SUPPORT for Ruby 1.8.x.
148
+ * Add :here lookup (thanks github.com/christoph-buente).
149
+ * Add :cloudmade lookup (thanks github.com/spoptchev).
150
+ * Add :smarty_streets lookup (thanks github.com/drinks).
151
+ * Add :maxmind_local IP lookup (thanks github.com/fernandomm).
152
+ * Add :baidu_ip lookup (thanks github.com/yonggu).
153
+ * Add :geocodio lookup (thanks github.com/dblock).
154
+ * Add :lookup option to `Geocoder.search` and `geocoded_by` (thanks github.com/Bonias).
155
+ * Add support for :maxmind_local on JRuby via jgeoip gem (thanks github.com/gxbe).
156
+ * Add support for using :maxmind_local with an SQL database, including Rake tasks for downloading CSV data and populating a local DB.
157
+ * Add support for character encodings based on Content-type header (thanks github.com/timaro).
158
+ * Add :min_radius option to `near` scope (thanks github.com/phallstrom).
159
+ * Fix: Yandex city attribute caused exception with certain responses (thanks github.com/dblock).
160
+ * Change name of MapQuest config option from :licensed to :open and revert default behavior to be MapQuest data (not OpenStreetMaps).
161
+ * Reduce number of Ruby warnings (thanks github.com/exviva).
162
+
6
163
  1.1.9 (2013 Dec 11)
7
164
  -------------------
8
165