geocoder-kb 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (248) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +6 -0
  3. data/.travis.yml +31 -0
  4. data/CHANGELOG.md +384 -0
  5. data/LICENSE +20 -0
  6. data/README.md +1085 -0
  7. data/Rakefile +25 -0
  8. data/bin/geocode +5 -0
  9. data/examples/autoexpire_cache_dalli.rb +62 -0
  10. data/examples/autoexpire_cache_redis.rb +28 -0
  11. data/examples/cache_bypass.rb +48 -0
  12. data/examples/sidekiq_worker.rb +16 -0
  13. data/gemfiles/Gemfile.mongoid-2.4.x +16 -0
  14. data/lib/generators/geocoder/config/config_generator.rb +14 -0
  15. data/lib/generators/geocoder/config/templates/initializer.rb +21 -0
  16. data/lib/generators/geocoder/maxmind/geolite_city_generator.rb +28 -0
  17. data/lib/generators/geocoder/maxmind/geolite_country_generator.rb +28 -0
  18. data/lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb +30 -0
  19. data/lib/generators/geocoder/maxmind/templates/migration/geolite_country.rb +17 -0
  20. data/lib/geocoder.rb +47 -0
  21. data/lib/geocoder/cache.rb +90 -0
  22. data/lib/geocoder/calculations.rb +428 -0
  23. data/lib/geocoder/cli.rb +121 -0
  24. data/lib/geocoder/configuration.rb +124 -0
  25. data/lib/geocoder/configuration_hash.rb +11 -0
  26. data/lib/geocoder/exceptions.rb +21 -0
  27. data/lib/geocoder/ip_address.rb +21 -0
  28. data/lib/geocoder/lookup.rb +102 -0
  29. data/lib/geocoder/lookups/amap.rb +55 -0
  30. data/lib/geocoder/lookups/baidu.rb +55 -0
  31. data/lib/geocoder/lookups/baidu_ip.rb +54 -0
  32. data/lib/geocoder/lookups/base.rb +302 -0
  33. data/lib/geocoder/lookups/bing.rb +59 -0
  34. data/lib/geocoder/lookups/dstk.rb +20 -0
  35. data/lib/geocoder/lookups/esri.rb +48 -0
  36. data/lib/geocoder/lookups/freegeoip.rb +47 -0
  37. data/lib/geocoder/lookups/geocoder_ca.rb +54 -0
  38. data/lib/geocoder/lookups/geocoder_us.rb +39 -0
  39. data/lib/geocoder/lookups/geocodio.rb +42 -0
  40. data/lib/geocoder/lookups/geoip2.rb +40 -0
  41. data/lib/geocoder/lookups/google.rb +67 -0
  42. data/lib/geocoder/lookups/google_places_details.rb +50 -0
  43. data/lib/geocoder/lookups/google_premier.rb +47 -0
  44. data/lib/geocoder/lookups/here.rb +62 -0
  45. data/lib/geocoder/lookups/mapquest.rb +60 -0
  46. data/lib/geocoder/lookups/maxmind.rb +90 -0
  47. data/lib/geocoder/lookups/maxmind_local.rb +58 -0
  48. data/lib/geocoder/lookups/nominatim.rb +52 -0
  49. data/lib/geocoder/lookups/okf.rb +43 -0
  50. data/lib/geocoder/lookups/opencagedata.rb +58 -0
  51. data/lib/geocoder/lookups/ovi.rb +62 -0
  52. data/lib/geocoder/lookups/pointpin.rb +68 -0
  53. data/lib/geocoder/lookups/postcode_anywhere_uk.rb +51 -0
  54. data/lib/geocoder/lookups/smarty_streets.rb +45 -0
  55. data/lib/geocoder/lookups/telize.rb +40 -0
  56. data/lib/geocoder/lookups/test.rb +44 -0
  57. data/lib/geocoder/lookups/yahoo.rb +88 -0
  58. data/lib/geocoder/lookups/yandex.rb +54 -0
  59. data/lib/geocoder/models/active_record.rb +50 -0
  60. data/lib/geocoder/models/base.rb +39 -0
  61. data/lib/geocoder/models/mongo_base.rb +64 -0
  62. data/lib/geocoder/models/mongo_mapper.rb +26 -0
  63. data/lib/geocoder/models/mongoid.rb +32 -0
  64. data/lib/geocoder/query.rb +111 -0
  65. data/lib/geocoder/railtie.rb +26 -0
  66. data/lib/geocoder/request.rb +25 -0
  67. data/lib/geocoder/results/amap.rb +85 -0
  68. data/lib/geocoder/results/baidu.rb +79 -0
  69. data/lib/geocoder/results/baidu_ip.rb +62 -0
  70. data/lib/geocoder/results/base.rb +67 -0
  71. data/lib/geocoder/results/bing.rb +48 -0
  72. data/lib/geocoder/results/dstk.rb +6 -0
  73. data/lib/geocoder/results/esri.rb +51 -0
  74. data/lib/geocoder/results/freegeoip.rb +45 -0
  75. data/lib/geocoder/results/geocoder_ca.rb +60 -0
  76. data/lib/geocoder/results/geocoder_us.rb +39 -0
  77. data/lib/geocoder/results/geocodio.rb +66 -0
  78. data/lib/geocoder/results/geoip2.rb +64 -0
  79. data/lib/geocoder/results/google.rb +124 -0
  80. data/lib/geocoder/results/google_places_details.rb +35 -0
  81. data/lib/geocoder/results/google_premier.rb +6 -0
  82. data/lib/geocoder/results/here.rb +62 -0
  83. data/lib/geocoder/results/mapquest.rb +51 -0
  84. data/lib/geocoder/results/maxmind.rb +135 -0
  85. data/lib/geocoder/results/maxmind_local.rb +49 -0
  86. data/lib/geocoder/results/nominatim.rb +94 -0
  87. data/lib/geocoder/results/okf.rb +106 -0
  88. data/lib/geocoder/results/opencagedata.rb +82 -0
  89. data/lib/geocoder/results/ovi.rb +62 -0
  90. data/lib/geocoder/results/pointpin.rb +44 -0
  91. data/lib/geocoder/results/postcode_anywhere_uk.rb +42 -0
  92. data/lib/geocoder/results/smarty_streets.rb +106 -0
  93. data/lib/geocoder/results/telize.rb +45 -0
  94. data/lib/geocoder/results/test.rb +33 -0
  95. data/lib/geocoder/results/yahoo.rb +55 -0
  96. data/lib/geocoder/results/yandex.rb +84 -0
  97. data/lib/geocoder/sql.rb +107 -0
  98. data/lib/geocoder/stores/active_record.rb +289 -0
  99. data/lib/geocoder/stores/base.rb +127 -0
  100. data/lib/geocoder/stores/mongo_base.rb +89 -0
  101. data/lib/geocoder/stores/mongo_mapper.rb +13 -0
  102. data/lib/geocoder/stores/mongoid.rb +13 -0
  103. data/lib/geocoder/version.rb +3 -0
  104. data/lib/hash_recursive_merge.rb +74 -0
  105. data/lib/maxmind_database.rb +109 -0
  106. data/lib/oauth_util.rb +112 -0
  107. data/lib/tasks/geocoder.rake +29 -0
  108. data/lib/tasks/maxmind.rake +73 -0
  109. data/test/fixtures/baidu_invalid_key +1 -0
  110. data/test/fixtures/baidu_ip_202_198_16_3 +19 -0
  111. data/test/fixtures/baidu_ip_invalid_key +1 -0
  112. data/test/fixtures/baidu_ip_no_results +1 -0
  113. data/test/fixtures/baidu_no_results +1 -0
  114. data/test/fixtures/baidu_reverse +1 -0
  115. data/test/fixtures/baidu_shanghai_pearl_tower +12 -0
  116. data/test/fixtures/bing_invalid_key +1 -0
  117. data/test/fixtures/bing_madison_square_garden +40 -0
  118. data/test/fixtures/bing_no_results +16 -0
  119. data/test/fixtures/bing_reverse +42 -0
  120. data/test/fixtures/cloudmade_invalid_key +1 -0
  121. data/test/fixtures/cloudmade_madison_square_garden +1 -0
  122. data/test/fixtures/cloudmade_no_results +1 -0
  123. data/test/fixtures/esri_madison_square_garden +59 -0
  124. data/test/fixtures/esri_no_results +8 -0
  125. data/test/fixtures/esri_reverse +21 -0
  126. data/test/fixtures/freegeoip_74_200_247_59 +12 -0
  127. data/test/fixtures/freegeoip_no_results +1 -0
  128. data/test/fixtures/geocoder_ca_madison_square_garden +1 -0
  129. data/test/fixtures/geocoder_ca_no_results +1 -0
  130. data/test/fixtures/geocoder_ca_reverse +34 -0
  131. data/test/fixtures/geocoder_us_madison_square_garden +1 -0
  132. data/test/fixtures/geocoder_us_no_results +1 -0
  133. data/test/fixtures/geocodio_1101_pennsylvania_ave +1 -0
  134. data/test/fixtures/geocodio_bad_api_key +3 -0
  135. data/test/fixtures/geocodio_invalid +4 -0
  136. data/test/fixtures/geocodio_no_results +1 -0
  137. data/test/fixtures/geocodio_over_query_limit +4 -0
  138. data/test/fixtures/google_garbage +456 -0
  139. data/test/fixtures/google_madison_square_garden +57 -0
  140. data/test/fixtures/google_no_city_data +44 -0
  141. data/test/fixtures/google_no_locality +51 -0
  142. data/test/fixtures/google_no_results +4 -0
  143. data/test/fixtures/google_over_limit +4 -0
  144. data/test/fixtures/google_places_details_invalid_request +4 -0
  145. data/test/fixtures/google_places_details_madison_square_garden +120 -0
  146. data/test/fixtures/google_places_details_no_results +4 -0
  147. data/test/fixtures/google_places_details_no_reviews +60 -0
  148. data/test/fixtures/google_places_details_no_types +66 -0
  149. data/test/fixtures/here_madison_square_garden +72 -0
  150. data/test/fixtures/here_no_results +8 -0
  151. data/test/fixtures/mapquest_error +16 -0
  152. data/test/fixtures/mapquest_invalid_api_key +16 -0
  153. data/test/fixtures/mapquest_invalid_request +16 -0
  154. data/test/fixtures/mapquest_madison_square_garden +52 -0
  155. data/test/fixtures/mapquest_no_results +16 -0
  156. data/test/fixtures/maxmind_24_24_24_21 +1 -0
  157. data/test/fixtures/maxmind_24_24_24_22 +1 -0
  158. data/test/fixtures/maxmind_24_24_24_23 +1 -0
  159. data/test/fixtures/maxmind_24_24_24_24 +1 -0
  160. data/test/fixtures/maxmind_74_200_247_59 +1 -0
  161. data/test/fixtures/maxmind_invalid_key +1 -0
  162. data/test/fixtures/maxmind_no_results +1 -0
  163. data/test/fixtures/nominatim_madison_square_garden +150 -0
  164. data/test/fixtures/nominatim_no_results +1 -0
  165. data/test/fixtures/nominatim_over_limit +1 -0
  166. data/test/fixtures/okf_kirstinmaki +67 -0
  167. data/test/fixtures/okf_no_results +4 -0
  168. data/test/fixtures/opencagedata_invalid_api_key +25 -0
  169. data/test/fixtures/opencagedata_invalid_request +26 -0
  170. data/test/fixtures/opencagedata_madison_square_garden +73 -0
  171. data/test/fixtures/opencagedata_no_results +29 -0
  172. data/test/fixtures/opencagedata_over_limit +31 -0
  173. data/test/fixtures/ovi_madison_square_garden +72 -0
  174. data/test/fixtures/ovi_no_results +8 -0
  175. data/test/fixtures/pointpin_10_10_10_10 +1 -0
  176. data/test/fixtures/pointpin_555_555_555_555 +1 -0
  177. data/test/fixtures/pointpin_80_111_555_555 +1 -0
  178. data/test/fixtures/pointpin_no_results +1 -0
  179. data/test/fixtures/postcode_anywhere_uk_geocode_v2_00_WR26NJ +1 -0
  180. data/test/fixtures/postcode_anywhere_uk_geocode_v2_00_generic_error +1 -0
  181. data/test/fixtures/postcode_anywhere_uk_geocode_v2_00_hampshire +1 -0
  182. data/test/fixtures/postcode_anywhere_uk_geocode_v2_00_key_limit_exceeded +1 -0
  183. data/test/fixtures/postcode_anywhere_uk_geocode_v2_00_no_results +1 -0
  184. data/test/fixtures/postcode_anywhere_uk_geocode_v2_00_romsey +1 -0
  185. data/test/fixtures/postcode_anywhere_uk_geocode_v2_00_unknown_key +1 -0
  186. data/test/fixtures/smarty_streets_11211 +1 -0
  187. data/test/fixtures/smarty_streets_madison_square_garden +47 -0
  188. data/test/fixtures/smarty_streets_no_results +1 -0
  189. data/test/fixtures/telize_10_10_10_10 +1 -0
  190. data/test/fixtures/telize_555_555_555_555 +4 -0
  191. data/test/fixtures/telize_74_200_247_59 +1 -0
  192. data/test/fixtures/telize_no_results +1 -0
  193. data/test/fixtures/yahoo_error +1 -0
  194. data/test/fixtures/yahoo_invalid_key +2 -0
  195. data/test/fixtures/yahoo_madison_square_garden +52 -0
  196. data/test/fixtures/yahoo_no_results +10 -0
  197. data/test/fixtures/yahoo_over_limit +2 -0
  198. data/test/fixtures/yandex_canada_rue_dupuis_14 +446 -0
  199. data/test/fixtures/yandex_invalid_key +1 -0
  200. data/test/fixtures/yandex_kremlin +48 -0
  201. data/test/fixtures/yandex_new_york +1 -0
  202. data/test/fixtures/yandex_no_city_and_town +112 -0
  203. data/test/fixtures/yandex_no_results +16 -0
  204. data/test/integration/http_client_test.rb +31 -0
  205. data/test/mongoid_test_helper.rb +43 -0
  206. data/test/test_helper.rb +416 -0
  207. data/test/unit/active_record_test.rb +16 -0
  208. data/test/unit/cache_test.rb +37 -0
  209. data/test/unit/calculations_test.rb +220 -0
  210. data/test/unit/configuration_test.rb +55 -0
  211. data/test/unit/error_handling_test.rb +56 -0
  212. data/test/unit/geocoder_test.rb +78 -0
  213. data/test/unit/https_test.rb +17 -0
  214. data/test/unit/ip_address_test.rb +27 -0
  215. data/test/unit/lookup_test.rb +153 -0
  216. data/test/unit/lookups/bing_test.rb +68 -0
  217. data/test/unit/lookups/dstk_test.rb +26 -0
  218. data/test/unit/lookups/esri_test.rb +48 -0
  219. data/test/unit/lookups/freegeoip_test.rb +27 -0
  220. data/test/unit/lookups/geocoder_ca_test.rb +17 -0
  221. data/test/unit/lookups/geocodio_test.rb +55 -0
  222. data/test/unit/lookups/geoip2_test.rb +27 -0
  223. data/test/unit/lookups/google_places_details_test.rb +122 -0
  224. data/test/unit/lookups/google_premier_test.rb +22 -0
  225. data/test/unit/lookups/google_test.rb +84 -0
  226. data/test/unit/lookups/mapquest_test.rb +60 -0
  227. data/test/unit/lookups/maxmind_local_test.rb +28 -0
  228. data/test/unit/lookups/maxmind_test.rb +63 -0
  229. data/test/unit/lookups/nominatim_test.rb +31 -0
  230. data/test/unit/lookups/okf_test.rb +38 -0
  231. data/test/unit/lookups/opencagedata_test.rb +64 -0
  232. data/test/unit/lookups/pointpin_test.rb +30 -0
  233. data/test/unit/lookups/postcode_anywhere_uk_test.rb +70 -0
  234. data/test/unit/lookups/smarty_streets_test.rb +71 -0
  235. data/test/unit/lookups/telize_test.rb +36 -0
  236. data/test/unit/lookups/yahoo_test.rb +35 -0
  237. data/test/unit/method_aliases_test.rb +26 -0
  238. data/test/unit/model_test.rb +38 -0
  239. data/test/unit/mongoid_test.rb +47 -0
  240. data/test/unit/near_test.rb +87 -0
  241. data/test/unit/oauth_util_test.rb +31 -0
  242. data/test/unit/proxy_test.rb +37 -0
  243. data/test/unit/query_test.rb +52 -0
  244. data/test/unit/rake_task_test.rb +21 -0
  245. data/test/unit/request_test.rb +35 -0
  246. data/test/unit/result_test.rb +72 -0
  247. data/test/unit/test_mode_test.rb +70 -0
  248. metadata +294 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 072fb96146fd3a621f1e053f36a0ae88d3eaf2dc
4
+ data.tar.gz: c41a708702fa8c14598242490174c88654857b6d
5
+ SHA512:
6
+ metadata.gz: 4c02ae370ff0ad0fc07ee59c0efa910ad5d5a0f59d8df77b3c6e22b79d2ef468a033c8b121decc27aee93b5f668b39aa13e02df8aac82963cbc690eed3529482
7
+ data.tar.gz: 0091c5d99aa1ecf2eb93fa2dee97fdf2cb2a9d41c3548c91e5e995bcd5e4276421d0d8a4c9ea14f5b5791d652119e29485d4bc6ea6109aa0bafac149e9e1e7ed
@@ -0,0 +1,6 @@
1
+ pkg/*
2
+ rdoc/*
3
+ *.gem
4
+ .bundle
5
+ Gemfile.lock
6
+ api_keys.yml
@@ -0,0 +1,31 @@
1
+ rvm:
2
+ - 1.9.2
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.2
6
+ - jruby-19mode
7
+ - rbx-2
8
+ gemfile:
9
+ - Gemfile
10
+ - gemfiles/Gemfile.mongoid-2.4.x
11
+ env: SSL_CERT_DIR=/etc/ssl/certs
12
+ matrix:
13
+ exclude:
14
+ - rvm: 1.9.2
15
+ gemfile: Gemfile
16
+ env: SSL_CERT_DIR=/etc/ssl/certs
17
+ - rvm: 1.9.3
18
+ gemfile: gemfiles/Gemfile.mongoid-2.4.x
19
+ env: SSL_CERT_DIR=/etc/ssl/certs
20
+ - rvm: 2.0.0
21
+ gemfile: gemfiles/Gemfile.mongoid-2.4.x
22
+ env: SSL_CERT_DIR=/etc/ssl/certs
23
+ - rvm: 2.1.2
24
+ gemfile: gemfiles/Gemfile.mongoid-2.4.x
25
+ env: SSL_CERT_DIR=/etc/ssl/certs
26
+ - rvm: jruby-19mode
27
+ gemfile: gemfiles/Gemfile.mongoid-2.4.x
28
+ env: SSL_CERT_DIR=/etc/ssl/certs
29
+ - rvm: rbx-2
30
+ gemfile: gemfiles/Gemfile.mongoid-2.4.x
31
+ env: SSL_CERT_DIR=/etc/ssl/certs
@@ -0,0 +1,384 @@
1
+ Changelog
2
+ =========
3
+
4
+ Major changes to Geocoder for each release. Please see the Git log for complete list of changes.
5
+
6
+ 1.2.6 (2014 Nov 8)
7
+ -------------------
8
+ * Add :geoip2 lookup (thanks github.com/ChristianHoj).
9
+ * Add :okf lookup (thanks github.com/kakoni).
10
+ * Add :postcode_anywhere_uk lookup (thanks github.com/rob-murray).
11
+ * Properly detect IPv6 addresses (thanks github.com/sethherr and github.com/ignatiusreza).
12
+
13
+ 1.2.5 (2014 Sep 12)
14
+ -------------------
15
+ * Fix bugs in :opencagedata lookup (thanks github.com/duboff and kayakyakr).
16
+ * Allow language to be set in model configuration (thanks github.com/viniciusnz).
17
+ * Optimize lookup queries when using MaxMind Local (thanks github.com/gersmann).
18
+
19
+ 1.2.4 (2014 Aug 12)
20
+ -------------------
21
+ * Add ability to specify lat/lon column names with .near scope (thanks github.com/switzersc).
22
+ * Add OpenCageData geocoder (thanks github.com/mtmail).
23
+ * Remove CloudMade geocoder.
24
+
25
+ 1.2.3 (2014 Jul 11)
26
+ -------------------
27
+ * Add Telize IP address lookup (thanks github.com/lukeroberts1990).
28
+ * Fix bug in Bing reverse geocoding (thanks github.com/nickelser).
29
+
30
+ 1.2.2 (2014 Jun 12)
31
+ -------------------
32
+ * Add ability to specify language per query (thanks github.com/mkristian).
33
+ * Handle Errno::ECONNREFUSED exceptions like TimeoutError exceptions.
34
+ * Switch to 'unstructured' query format for Bing API (thanks github.com/lukewendling).
35
+
36
+ 1.2.1 (2014 May 12)
37
+ -------------------
38
+
39
+ * Fix: correctly handle encoding of MaxMind API responses (thanks github.com/hydrozen, gonzoyumo).
40
+ * Fixes to :maxmind_local database structure (thanks github.com/krakatoa).
41
+
42
+ 1.2.0 (2014 Apr 16)
43
+ -------------------
44
+
45
+ * DROP SUPPORT for Ruby 1.8.x.
46
+ * Add :here lookup (thanks github.com/christoph-buente).
47
+ * Add :cloudmade lookup (thanks github.com/spoptchev).
48
+ * Add :smarty_streets lookup (thanks github.com/drinks).
49
+ * Add :maxmind_local IP lookup (thanks github.com/fernandomm).
50
+ * Add :baidu_ip lookup (thanks github.com/yonggu).
51
+ * Add :geocodio lookup (thanks github.com/dblock).
52
+ * Add :lookup option to `Geocoder.search` and `geocoded_by` (thanks github.com/Bonias).
53
+ * Add support for :maxmind_local on JRuby via jgeoip gem (thanks github.com/gxbe).
54
+ * Add support for using :maxmind_local with an SQL database, including Rake tasks for downloading CSV data and populating a local DB.
55
+ * Add support for character encodings based on Content-type header (thanks github.com/timaro).
56
+ * Add :min_radius option to `near` scope (thanks github.com/phallstrom).
57
+ * Fix: Yandex city attribute caused exception with certain responses (thanks github.com/dblock).
58
+ * Change name of MapQuest config option from :licensed to :open and revert default behavior to be MapQuest data (not OpenStreetMaps).
59
+ * Reduce number of Ruby warnings (thanks github.com/exviva).
60
+
61
+ 1.1.9 (2013 Dec 11)
62
+ -------------------
63
+
64
+ * DEPRECATED support for Ruby 1.8.x. Will be dropped in a future version.
65
+ * Require API key for MapQuest (thanks github.com/robdiciuccio).
66
+ * Add support for geocoder.us and HTTP basic auth (thanks github.com/komba).
67
+ * Add support for Data Science Toolkit lookup (thanks github.com/ejhayes).
68
+ * Add support for Baidu (thanks github.com/mclee).
69
+ * Add Geocoder::Calculations.random_point_near method (thanks github.com/adambray).
70
+ * Fix: #nearbys method with Mongoid (thanks github.com/pascalbetz).
71
+ * Fix: bug in FreeGeoIp lookup that was preventing exception from being raised when configured cache was unavailable.
72
+
73
+ 1.1.8 (2013 Apr 22)
74
+ -------------------
75
+
76
+ * Fix bug in ESRI lookup that caused an exception on load in environments without rack/utils.
77
+
78
+ 1.1.7 (2013 Apr 21)
79
+ -------------------
80
+
81
+ * Add support for Ovi/Nokia API (thanks github.com/datenimperator).
82
+ * Add support for ESRI API (thanks github.com/rpepato).
83
+ * Add ability to omit distance and bearing from SQL select clause (thanks github.com/nicolasdespres).
84
+ * Add support for caches that use read/write methods (thanks github.com/eskil).
85
+ * Add support for nautical miles (thanks github.com/vanboom).
86
+ * Fix: bug in parsing of MaxMind responses.
87
+ * Fix: bugs in query regular expressions (thanks github.com/boone).
88
+ * Fix: various bugs in MaxMind implementation.
89
+ * Fix: don't require a key for MapQuest.
90
+ * Fix: bug in handling of HTTP_X_FORWARDED_FOR header (thanks github.com/robdimarco).
91
+
92
+ 1.1.6 (2012 Dec 24)
93
+ -------------------
94
+
95
+ * Major changes to configuration syntax which allow for API-specific config options. Old config syntax is now DEPRECATED.
96
+ * Add support for MaxMind API (thanks github.com/gonzoyumo).
97
+ * Add optional Geocoder::InvalidApiKey exception for bad API credentials (Yahoo, Yandex, Bing, and Maxmind). Warn when bad key and exception not set in Geocoder.configure(:always_raise => [...]).
98
+ * Add support for X-Real-IP and X-Forwarded-For headers (thanks github.com/konsti).
99
+ * Add support for custom Nominatim host config: Geocoder.configure(:nominatim => {:host => "..."}).
100
+ * Raise exception when required API key is missing or incorrect format.
101
+ * Add support for Google's :region and :components parameters (thanks to github.com/tomlion).
102
+ * Fix: string escaping bug in OAuth lib (thanks github.com/m0thman).
103
+ * Fix: configured units were not always respected in SQL queries.
104
+ * Fix: in #nearbys, don't try to exclude self if not yet persisted.
105
+ * Fix: bug with cache stores that provided #delete but not #del.
106
+ * Change #nearbys so that it returns nil instead of [] when object is not geocoded.
107
+
108
+ 1.1.5 (2012 Nov 9)
109
+ ------------------
110
+
111
+ * Replace support for old Yahoo Placefinder with Yahoo BOSS (thanks github.com/pwoltman).
112
+ * Add support for actual Mapquest API (was previously just a proxy for Nominatim), including the paid service (thanks github.com/jedschneider).
113
+ * Add support for :select => :id_only option to near scope.
114
+ * Treat a given query as blank (don't do a lookup) if coordinates are given but latitude or longitude is nil.
115
+ * Speed up 'near' queries by adding bounding box condition (thanks github.com/mlandauer).
116
+ * Fix: don't redefine Object#hash in Yahoo result object (thanks github.com/m0thman).
117
+
118
+ 1.1.4 (2012 Oct 2)
119
+ ------------------
120
+
121
+ * Deprecate Geocoder::Result::Nominatim#class and #type methods. Use #place_class and #place_type instead.
122
+ * Add support for setting arbitrary parameters in geocoding request URL.
123
+ * Add support for Google's :bounds parameter (thanks to github.com/rosscooperman and github.com/peterjm for submitting suggestions).
124
+ * Add support for :select => :geo_only option to near scope (thanks github.com/gugl).
125
+ * Add ability to omit ORDER BY clause from .near scope (pass option :order => false).
126
+ * Fix: error on Yahoo lookup due to API change (thanks github.com/kynesun).
127
+ * Fix: problem with Mongoid field aliases not being respected.
128
+ * Fix: :exclude option to .near scope when primary key != :id (thanks github.com/smisml).
129
+ * Much code refactoring (added Geocoder::Query class and Geocoder::Sql module).
130
+
131
+ 1.1.3 (2012 Aug 26)
132
+ -------------------
133
+
134
+ * Add support for Mapquest geocoding service (thanks github.com/razorinc).
135
+ * Add :test lookup for easy testing of apps using Geocoder (thanks github.com/mguterl).
136
+ * Add #precision method to Yandex results (thanks github.com/gemaker).
137
+ * Add support for raising :all exceptions (thanks github.com/andyvb).
138
+ * Add exceptions for certain Google geocoder responses (thanks github.com/andyvb).
139
+ * Add Travis-CI integration (thanks github.com/petergoldstein).
140
+ * Fix: unit config was not working with SQLite (thanks github.com/balvig).
141
+ * Fix: get tests to pass under Jruby (thanks github.com/petergoldstein).
142
+ * Fix: bug in distance_from_sql method (error occurred when coordinates not found).
143
+ * Fix: incompatibility with Mongoid 3.0.x (thanks github.com/petergoldstein).
144
+
145
+ 1.1.2 (2012 May 24)
146
+ -------------------
147
+
148
+ * Add ability to specify default units and distance calculation method (thanks github.com/abravalheri).
149
+ * Add new (optional) configuration syntax (thanks github.com/abravalheri).
150
+ * Add support for cache stores that provide :get and :set methods.
151
+ * Add support for custom HTTP request headers (thanks github.com/robotmay).
152
+ * Add Result#cache_hit attribute (thanks github.com/s01ipsist).
153
+ * Fix: rake geocode:all wasn't properly loading namespaced classes.
154
+ * Fix: properly recognize IP addresses with ::ffff: prefix (thanks github.com/brian-ewell).
155
+ * Fix: avoid exception during calculations when coordinates not known (thanks github.com/flori).
156
+
157
+ 1.1.1 (2012 Feb 16)
158
+ -------------------
159
+
160
+ * Add distance_from_sql class method to geocoded class (thanks github.com/dwilkie).
161
+ * Add OverQueryLimitError and raise when relevant for Google lookup.
162
+ * Fix: don't cache API data if response indicates an error.
163
+ * Fix: within_bounding_box now uses correct lat/lon DB columns (thanks github.com/kongo).
164
+ * Fix: error accessing city in some cases with Yandex result (thanks github.com/kor6n and sld).
165
+
166
+ 1.1.0 (2011 Dec 3)
167
+ ------------------
168
+
169
+ * A block passed to geocoded_by is now always executed, even if the geocoding service returns no results. This means you need to make sure you have results before trying to assign data to your object.
170
+ * Fix issues with joins and row counts (issues #49, 86, and 108) by not using GROUP BY clause with ActiveRecord scopes.
171
+ * Fix incorrect object ID when join used (fixes issue #140).
172
+ * Fix calculation of bounding box which spans 180th meridian (thanks github.com/hwuethrich).
173
+ * Add within_bounding_box scope for ActiveRecord-based models (thanks github.com/gavinhughes and dbloete).
174
+ * Add option to raise Geocoder::OverQueryLimitError for Google geocoding service.
175
+ * Add support for Nominatim geocoding service (thanks github.com/wranglerdriver).
176
+ * Add support for API key to Geocoder.ca geocoding service (thanks github.com/ryanLonac).
177
+ * Add support for state to Yandex results (thanks github.com/tipugin).
178
+
179
+ 1.0.5 (2011 Oct 26)
180
+ -------------------
181
+
182
+ * Fix error with `rake assets:precompile` (thanks github.com/Sush).
183
+ * Fix HTTPS support (thanks github.com/rsanheim).
184
+ * Improve cache interface.
185
+
186
+ 1.0.4 (2011 Sep 18)
187
+ -------------------
188
+
189
+ * Remove klass method from rake task, which could conflict with app methods (thanks github.com/mguterl).
190
+
191
+ 1.0.3 (2011 Sep 17)
192
+ -------------------
193
+
194
+ * Add support for Google Premier geocoding service (thanks github.com/steveh).
195
+ * Update Google API URL (thanks github.com/soorajb).
196
+ * Allow rescue from timeout with FreeGeoIP (thanks github.com/lukeledet).
197
+ * Fix: rake assets:precompile (Rails 3.1) not working in some situations.
198
+ * Fix: stop double-adjusting units when using kilometers (thanks github.com/hairyheron).
199
+
200
+ 1.0.2 (2011 June 25)
201
+ --------------------
202
+
203
+ * Add support for MongoMapper (thanks github.com/spagalloco).
204
+ * Fix: user-specified coordinates field wasn't working with Mongoid (thanks github.com/thisduck).
205
+ * Fix: invalid location given to near scope was returning all results (Active Record) or error (Mongoid) (thanks github.com/ogennadi).
206
+
207
+ 1.0.1 (2011 May 17)
208
+ -------------------
209
+
210
+ * Add option to not rescue from certain exceptions (thanks github.com/ahmedrb).
211
+ * Fix STI child/parent geocoding bug (thanks github.com/ogennadi).
212
+ * Other bugfixes.
213
+
214
+ 1.0.0 (2011 May 9)
215
+ ------------------
216
+
217
+ * Add command line interface.
218
+ * Add support for local proxy (thanks github.com/Olivier).
219
+ * Add support for Yandex.ru geocoding service.
220
+ * Add support for Bing geocoding service (thanks github.com/astevens).
221
+ * Fix single table inheritance bug (reported by github.com/enrico).
222
+ * Fix bug when Google result supplies no city (thanks github.com/jkeen).
223
+
224
+ 0.9.13 (2011 Apr 11)
225
+ --------------------
226
+
227
+ * Fix "can't find special index: 2d" error when using Mongoid with Ruby 1.8.
228
+
229
+ 0.9.12 (2011 Apr 6)
230
+ -------------------
231
+
232
+ * Add support for Mongoid.
233
+ * Add bearing_to/from methods to geocoded objects.
234
+ * Improve SQLite's distance calculation heuristic.
235
+ * Fix: Geocoder::Calculations.geographic_center was modifying its argument in-place (reported by github.com/joelmats).
236
+ * Fix: sort 'near' query results by distance when using SQLite.
237
+ * Clean up input: search for coordinates as a string with space after comma yields zero results from Google. Now we get rid of any such space before sending the query.
238
+ * DEPRECATION: Geocoder.near should not take <tt>:limit</tt> or <tt>:offset</tt> options.
239
+ * DEPRECATION: Change argument format of all methods that take lat/lon as separate arguments. Now you must pass the coordinates as an array [lat,lon], but you may alternatively pass a address string (will look up coordinates) or a geocoded object (or any object that implements a to_coordinates method which returns a [lat,lon] array).
240
+
241
+ 0.9.11 (2011 Mar 25)
242
+ --------------------
243
+
244
+ * Add support for result caching.
245
+ * Add support for Geocoder.ca geocoding service.
246
+ * Add +bearing+ attribute to objects returned by geo-aware queries (thanks github.com/matellis).
247
+ * Add config setting: language.
248
+ * Add config settings: +use_https+, +google_api_key+ (thanks github.com/svesely).
249
+ * DEPRECATION: <tt>Geocoder.search</tt> now returns an array instead of a single result.
250
+ * DEPRECATION: <tt>obj.nearbys</tt> second argument is now an options hash (instead of units). Please change <tt>obj.nearbys(20, :km)</tt> to: <tt>obj.nearbys(20, :units => :km)</tt>.
251
+
252
+ 0.9.10 (2011 Mar 9)
253
+ -------------------
254
+
255
+ * Fix broken scopes (github.com/mikepinde).
256
+ * Fix broken Ruby 1.9 and JRuby compatibility (don't require json gem).
257
+
258
+ 0.9.9 (2011 Mar 9)
259
+ ------------------
260
+
261
+ * Add support for IP address geocoding via FreeGeoIp.net.
262
+ * Add support for Yahoo PlaceFinder geocoding API.
263
+ * Add support for custom geocoder data handling by passing a block to geocoded_by or reverse_geocoded_by.
264
+ * Add <tt>Rack::Request#location</tt> method for geocoding user's IP address.
265
+ * Change gem name to geocoder (no more rails-geocoder).
266
+ * Gem now works outside of Rails.
267
+ * DEPRECATION: +fetch_coordinates+ no longer takes an argument.
268
+ * DEPRECATION: +fetch_address+ no longer takes an argument.
269
+ * DEPRECATION: <tt>Geocoder.search</tt> now returns a single result instead of an array.
270
+ * DEPRECATION: <tt>fetch_coordinates!</tt> has been superceded by +geocode+ (then save your object manually).
271
+ * DEPRECATION: <tt>fetch_address!</tt> has been superceded by +reverse_geocode+ (then save your object manually).
272
+ * Fix: don't die when trying to get coordinates with a nil address (github.com/zmack).
273
+
274
+ 0.9.8 (2011 Feb 8)
275
+ ------------------
276
+
277
+ * Include <tt>geocode:all</tt> Rake task in gem (was missing!).
278
+ * Add <tt>Geocoder.search</tt> for access to Google's full response.
279
+ * Add ability to configure Google connection timeout.
280
+ * Emit warnings on Google connection problems and errors.
281
+ * Refactor: insert Geocoder into ActiveRecord via Railtie.
282
+
283
+ 0.9.7 (2011 Feb 1)
284
+ ------------------
285
+
286
+ * Add reverse geocoding (+reverse_geocoded_by+).
287
+ * Prevent exception (uninitialized constant Geocoder::Net) when net/http not already required (github.com/sleepycat).
288
+ * Refactor: split monolithic Geocoder module into several smaller ones.
289
+
290
+ 0.9.6 (2011 Jan 19)
291
+ -------------------
292
+
293
+ * Fix incompatibility with will_paginate gem.
294
+ * Include table names in GROUP BY clause of nearby scope to avoid ambiguity in joins (github.com/matchu).
295
+
296
+ 0.9.5 (2010 Oct 15)
297
+ -------------------
298
+
299
+ * Fix broken PostgreSQL compatibility (now 100% compatible).
300
+ * Switch from Google's XML to JSON geocoding API.
301
+ * Separate Rails 2 and Rails 3-compatible branches.
302
+ * Don't allow :conditions hash in 'options' argument to 'nearbys' method (was deprecated in 0.9.3).
303
+
304
+ 0.9.4 (2010 Aug 2)
305
+ ------------------
306
+
307
+ * Google Maps API key no longer required (uses geocoder v3).
308
+
309
+ 0.9.3 (2010 Aug 2)
310
+ ------------------
311
+
312
+ * Fix incompatibility with Rails 3 RC 1.
313
+ * Deprecate 'options' argument to 'nearbys' method.
314
+ * Allow inclusion of 'nearbys' in Arel method chains.
315
+
316
+ 0.9.2 (2010 Jun 3)
317
+ ------------------
318
+
319
+ * Fix LIMIT clause bug in PostgreSQL (reported by github.com/kenzie).
320
+
321
+ 0.9.1 (2010 May 4)
322
+ ------------------
323
+
324
+ * Use scope instead of named_scope in Rails 3.
325
+
326
+ 0.9.0 (2010 Apr 2)
327
+ ------------------
328
+
329
+ * Fix bug in PostgreSQL support (caused "PGError: ERROR: column "distance" does not exist"), reported by github.com/developish.
330
+
331
+ 0.8.9 (2010 Feb 11)
332
+ -------------------
333
+
334
+ * Add Rails 3 compatibility.
335
+ * Avoid querying Google when query would be an empty string.
336
+
337
+ 0.8.8 (2009 Dec 7)
338
+ ------------------
339
+
340
+ * Automatically select a less accurate but compatible distance algorithm when SQLite database detected (fixes SQLite incompatibility).
341
+
342
+ 0.8.7 (2009 Nov 4)
343
+ ------------------
344
+
345
+ * Added Geocoder.geographic_center method.
346
+ * Replaced _get_coordinates class method with read_coordinates instance method.
347
+
348
+ 0.8.6 (2009 Oct 27)
349
+ -------------------
350
+
351
+ * The fetch_coordinates method now assigns coordinates to attributes (behaves like fetch_coordinates! used to) and fetch_coordinates! both assigns and saves the attributes.
352
+ * Added geocode:all rake task.
353
+
354
+ 0.8.5 (2009 Oct 26)
355
+ -------------------
356
+
357
+ * Avoid calling deprecated method from within Geocoder itself.
358
+
359
+ 0.8.4 (2009 Oct 23)
360
+ -------------------
361
+
362
+ * Deprecate <tt>find_near</tt> class method in favor of +near+ named scope.
363
+
364
+ 0.8.3 (2009 Oct 23)
365
+ -------------------
366
+
367
+ * Update Google URL query string parameter to reflect recent changes in Google's API.
368
+
369
+ 0.8.2 (2009 Oct 12)
370
+ -------------------
371
+
372
+ * Allow a model's geocoder search string method to be something other than an ActiveRecord attribute.
373
+ * Clean up documentation.
374
+
375
+ 0.8.1 (2009 Oct 8)
376
+ ------------------
377
+
378
+ * Extract XML-fetching code from <tt>Geocoder.search</tt> and place in Geocoder._fetch_xml (for ease of mocking).
379
+ * Add tests for coordinate-fetching instance methods.
380
+
381
+ 0.8.0 (2009 Oct 1)
382
+ ------------------
383
+
384
+ First release.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009-11 Alex Reisner
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.