geokit-rails 2.5.0 → 2.5.2

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.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +125 -0
  3. data/.gitignore +44 -37
  4. data/CHANGELOG.md +112 -101
  5. data/CONFIG.markdown +67 -67
  6. data/Gemfile +3 -3
  7. data/MIT-LICENSE +19 -19
  8. data/README.markdown +726 -726
  9. data/Rakefile +17 -17
  10. data/gemfiles/rails7.1.gemfile +11 -0
  11. data/gemfiles/{rails5.gemfile → rails7.2.gemfile} +7 -7
  12. data/gemfiles/{rails6.0.gemfile → rails8.0.gemfile} +7 -8
  13. data/gemfiles/{rails6.1.gemfile → rails8.1.gemfile} +7 -8
  14. data/geokit-rails.gemspec +35 -34
  15. data/lib/generators/geokit_rails/install_generator.rb +13 -13
  16. data/lib/generators/templates/geokit_config.rb +100 -100
  17. data/lib/geokit-rails/acts_as_mappable/class_methods.rb +301 -297
  18. data/lib/geokit-rails/acts_as_mappable/glue.rb +54 -54
  19. data/lib/geokit-rails/acts_as_mappable.rb +78 -78
  20. data/lib/geokit-rails/adapters/abstract.rb +30 -30
  21. data/lib/geokit-rails/adapters/mysql.rb +21 -21
  22. data/lib/geokit-rails/adapters/mysql2.rb +8 -8
  23. data/lib/geokit-rails/adapters/mysql2spatial.rb +8 -8
  24. data/lib/geokit-rails/adapters/oracleenhanced.rb +32 -32
  25. data/lib/geokit-rails/adapters/postgresql.rb +21 -21
  26. data/lib/geokit-rails/adapters/sqlite.rb +53 -53
  27. data/lib/geokit-rails/adapters/sqlserver.rb +45 -45
  28. data/lib/geokit-rails/adapters/trilogy.rb +10 -0
  29. data/lib/geokit-rails/distance_collection.rb +8 -8
  30. data/lib/geokit-rails/geocoder_control.rb +19 -19
  31. data/lib/geokit-rails/ip_geocode_lookup.rb +44 -45
  32. data/lib/geokit-rails/railtie.rb +37 -37
  33. data/lib/geokit-rails/version.rb +3 -3
  34. data/lib/geokit-rails.rb +11 -11
  35. data/test/acts_as_mappable_test.rb +491 -478
  36. data/test/adapter_resolution_test.rb +59 -0
  37. data/test/boot.rb +40 -32
  38. data/test/database.yml +36 -28
  39. data/test/distance_collection_test.rb +41 -41
  40. data/test/dummy/Rakefile +6 -6
  41. data/test/dummy/app/assets/stylesheets/application.css +1 -1
  42. data/test/dummy/app/channels/application_cable/channel.rb +4 -4
  43. data/test/dummy/app/channels/application_cable/connection.rb +4 -4
  44. data/test/dummy/app/controllers/application_controller.rb +3 -3
  45. data/test/dummy/app/controllers/location_aware_controller.rb +42 -42
  46. data/test/dummy/app/helpers/application_helper.rb +2 -2
  47. data/test/dummy/app/jobs/application_job.rb +7 -7
  48. data/test/dummy/app/mailers/application_mailer.rb +4 -4
  49. data/test/dummy/app/models/application_record.rb +3 -3
  50. data/test/dummy/app/views/layouts/application.html.erb +15 -15
  51. data/test/dummy/app/views/layouts/mailer.html.erb +13 -13
  52. data/test/dummy/app/views/layouts/mailer.text.erb +1 -1
  53. data/test/dummy/bin/rails +4 -4
  54. data/test/dummy/bin/rake +4 -4
  55. data/test/dummy/bin/setup +33 -33
  56. data/test/dummy/config/application.rb +22 -22
  57. data/test/dummy/config/boot.rb +5 -5
  58. data/test/dummy/config/cable.yml +10 -10
  59. data/test/dummy/config/database.yml +25 -25
  60. data/test/dummy/config/environment.rb +5 -5
  61. data/test/dummy/config/environments/development.rb +68 -68
  62. data/test/dummy/config/environments/production.rb +87 -87
  63. data/test/dummy/config/environments/test.rb +60 -60
  64. data/test/dummy/config/initializers/content_security_policy.rb +25 -25
  65. data/test/dummy/config/initializers/filter_parameter_logging.rb +8 -8
  66. data/test/dummy/config/initializers/inflections.rb +16 -16
  67. data/test/dummy/config/initializers/permissions_policy.rb +11 -11
  68. data/test/dummy/config/locales/en.yml +33 -33
  69. data/test/dummy/config/puma.rb +43 -43
  70. data/test/dummy/config/routes.rb +6 -6
  71. data/test/dummy/config/storage.yml +34 -34
  72. data/test/dummy/config.ru +6 -6
  73. data/test/dummy/public/404.html +67 -67
  74. data/test/dummy/public/422.html +67 -67
  75. data/test/dummy/public/500.html +66 -66
  76. data/test/fixtures/companies.yml +9 -9
  77. data/test/fixtures/custom_locations.yml +61 -61
  78. data/test/fixtures/locations.yml +61 -61
  79. data/test/fixtures/mock_addresses.yml +16 -16
  80. data/test/fixtures/mock_families.yml +2 -2
  81. data/test/fixtures/mock_houses.yml +8 -8
  82. data/test/fixtures/mock_organizations.yml +4 -4
  83. data/test/fixtures/mock_people.yml +4 -4
  84. data/test/ip_geocode_lookup_test.rb +52 -48
  85. data/test/models/company.rb +2 -2
  86. data/test/models/custom_location.rb +11 -11
  87. data/test/models/location.rb +3 -3
  88. data/test/models/mock_address.rb +3 -3
  89. data/test/models/mock_family.rb +4 -4
  90. data/test/models/mock_house.rb +2 -2
  91. data/test/models/mock_organization.rb +5 -5
  92. data/test/models/mock_person.rb +6 -6
  93. data/test/models/store.rb +2 -2
  94. data/test/schema.rb +61 -61
  95. data/test/tasks.rake +39 -37
  96. data/test/test_helper.rb +83 -73
  97. metadata +28 -15
  98. data/.travis.yml +0 -55
  99. data/gemfiles/rails3.gemfile +0 -8
  100. data/gemfiles/rails4.gemfile +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c4bc1edb34957251330bf39e6c777d1b8e01fba0e23388b08b3f07918bb9d1ab
4
- data.tar.gz: c4f0899abed4cbc930dba47b122851a8ac34debdf5e05bbc39a8143fc61a3d36
3
+ metadata.gz: 3a39a787db2843762962e2d4fd0afe36bb117be9b951d01d65d76fd53a5dfabb
4
+ data.tar.gz: c6baa34385aad40d374ae8c1be45d99bf9e1aaaf2ddaf7c1aca731374efa7f85
5
5
  SHA512:
6
- metadata.gz: d3f0175f5717e228e12cf36df832b792ec9da4ea8ba30bee8511222dfacd89a2634308d734c84b514e57d4055400e6899c62d774c1baff0d1d65e9d5b666dae3
7
- data.tar.gz: e6939ec41db36ce5603606d3815952f32c2826390bac2a68752cc97c695094e15759ae1417150d5343bebdd606d29e6aa0397a9db62ad65b84bf11114795bc88
6
+ metadata.gz: e6fb8d2c395792b752865f466b09dd5671c28359917c69d700ac7e6655ad92e69a900416b647e12b1ac191aafb3a17e0c7d00ec5b685877781bafe7b8487486b
7
+ data.tar.gz: f8a7a2594dc5da7cc906ae1ce8b8f9e3741e8988f4772c6672e50d881310a3114a770753f45de8e915bd48b0bba4a65aa5d241d752eb68e4acba305160c61e20
@@ -0,0 +1,125 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ sqlite:
12
+ name: Ruby ${{ matrix.ruby }} / ${{ matrix.gemfile }} / sqlite
13
+ runs-on: ubuntu-latest
14
+
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ ruby: ['3.2', '3.3', '3.4', '4.0']
19
+ gemfile: [rails7.1, rails7.2, rails8.0, rails8.1]
20
+
21
+ env:
22
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
23
+
24
+ steps:
25
+ - uses: actions/checkout@v7
26
+
27
+ - uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: ${{ matrix.ruby }}
30
+ bundler-cache: true
31
+
32
+ - run: bundle exec rake test
33
+
34
+ mysql:
35
+ name: Ruby ${{ matrix.ruby }} / ${{ matrix.gemfile }} / ${{ matrix.db }}
36
+ runs-on: ubuntu-latest
37
+
38
+ strategy:
39
+ fail-fast: false
40
+ matrix:
41
+ db: [mysql, trilogy]
42
+ ruby: ['3.2', '4.0']
43
+ include:
44
+ - ruby: '3.2'
45
+ gemfile: rails7.1
46
+ - ruby: '4.0'
47
+ gemfile: rails8.1
48
+
49
+ services:
50
+ mysql:
51
+ image: mysql:8.4
52
+ env:
53
+ MYSQL_ROOT_PASSWORD: root
54
+ MYSQL_USER: tests
55
+ MYSQL_PASSWORD: tests
56
+ MYSQL_DATABASE: geokit_rails_tests
57
+ ports:
58
+ - 3306:3306
59
+ options: >-
60
+ --health-cmd "mysqladmin ping -h 127.0.0.1"
61
+ --health-interval 5s
62
+ --health-timeout 5s
63
+ --health-retries 20
64
+
65
+ env:
66
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
67
+ DB: ${{ matrix.db }}
68
+ DB_HOST: 127.0.0.1
69
+ DB_USERNAME: tests
70
+ DB_PASSWORD: tests
71
+
72
+ steps:
73
+ - uses: actions/checkout@v7
74
+
75
+ - uses: ruby/setup-ruby@v1
76
+ with:
77
+ ruby-version: ${{ matrix.ruby }}
78
+ bundler-cache: true
79
+
80
+ - run: bundle exec rake test
81
+
82
+ postgresql:
83
+ name: Ruby ${{ matrix.ruby }} / ${{ matrix.gemfile }} / postgresql
84
+ runs-on: ubuntu-latest
85
+
86
+ strategy:
87
+ fail-fast: false
88
+ matrix:
89
+ include:
90
+ - ruby: '3.2'
91
+ gemfile: rails7.1
92
+ - ruby: '4.0'
93
+ gemfile: rails8.1
94
+
95
+ services:
96
+ postgres:
97
+ image: postgres:18
98
+ env:
99
+ POSTGRES_USER: tests
100
+ POSTGRES_PASSWORD: tests
101
+ POSTGRES_DB: geokit_rails_tests
102
+ ports:
103
+ - 5432:5432
104
+ options: >-
105
+ --health-cmd pg_isready
106
+ --health-interval 5s
107
+ --health-timeout 5s
108
+ --health-retries 20
109
+
110
+ env:
111
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
112
+ DB: postgresql
113
+ DB_HOST: 127.0.0.1
114
+ DB_USERNAME: tests
115
+ DB_PASSWORD: tests
116
+
117
+ steps:
118
+ - uses: actions/checkout@v7
119
+
120
+ - uses: ruby/setup-ruby@v1
121
+ with:
122
+ ruby-version: ${{ matrix.ruby }}
123
+ bundler-cache: true
124
+
125
+ - run: bundle exec rake test
data/.gitignore CHANGED
@@ -1,37 +1,44 @@
1
- # Bundler
2
- # http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/
3
- Gemfile.lock
4
-
5
- # Test log files
6
- test/*-debug.log
7
-
8
- # SQLite Test DB
9
- test/test.sqlite3
10
-
11
- # SVN
12
- .svn
13
-
14
- # RVM
15
- .rvmrc
16
-
17
- # TextMate
18
- *.tmproj
19
-
20
- # rcov generated
21
- coverage
22
-
23
- # rdoc generated
24
- rdoc
25
-
26
- # yard generated
27
- doc
28
- .yardoc
29
-
30
- # bundler
31
- .bundle
32
-
33
- # builds
34
- *.gem
35
-
36
- # For MacOS:
37
- .DS_Store
1
+ # Bundler
2
+ # http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/
3
+ Gemfile.lock
4
+ gemfiles/*.lock
5
+
6
+ # Test log files
7
+ test/*-debug.log
8
+
9
+ # SQLite Test DB
10
+ test/test.sqlite3*
11
+
12
+ # SVN
13
+ .svn
14
+
15
+ # RVM
16
+ .rvmrc
17
+
18
+ # TextMate
19
+ *.tmproj
20
+
21
+ # rcov generated
22
+ coverage
23
+
24
+ # rdoc generated
25
+ rdoc
26
+
27
+ # yard generated
28
+ doc
29
+ .yardoc
30
+
31
+ # bundler
32
+ .bundle
33
+
34
+ # builds
35
+ *.gem
36
+
37
+ # For MacOS:
38
+ .DS_Store
39
+
40
+ # Dummy app artifacts
41
+ test/dummy/db/*.sqlite3*
42
+ test/dummy/test/*.sqlite3*
43
+ test/dummy/log/*.log
44
+ test/dummy/tmp/
data/CHANGELOG.md CHANGED
@@ -1,101 +1,112 @@
1
- ## 2.5.0
2
-
3
- * Fixed dangerous YAML loading vulnerability
4
- * Rebuilt integration tests
5
-
6
- ## 2.3.2
7
-
8
- * Fix sqlite3 adapter error
9
-
10
- ## 2.3.1
11
-
12
- * Fix Rails 5.2 deprecation warning
13
-
14
- ## 2.3.0
15
-
16
- * Drop ruby 1.9 and add 2.3 support
17
- * Add an option to skip loading
18
- * Remove excessive debug statement
19
-
20
- ## 2.2.0
21
-
22
- * Add rails config aenerator
23
- * Add NOT NULL checks for latitude and longitude, otherwise nonsense
24
- values are being returned for distance calculations involving such
25
- objects.
26
- * Fix inconsistent case where retrieve_location_from_cookie_or_services
27
- returned a Hash instead of a GeoLoc
28
- * Speed up SQL with bounding box
29
- * Tests against rails 4 & 5
30
-
31
- ## 2.1.0
32
-
33
- * Add OracleEnhanced adapter
34
- * Fix bug with custom latitude/longitude names
35
- * BREAKING: Nearest and fathest return scopes not arrays
36
- * Drop support for ruby 1.8/1.9
37
-
38
- ## 2.0.1
39
-
40
- * Fix GeoKit naming compatibility
41
-
42
- ## 2.0.0 / 2013-06-19
43
-
44
- * Integrated geokit-rails3 into geokit-rails (use 1.x for rails2 support)
45
-
46
- ## 1.2.0 / 2009-10-02
47
-
48
- * Overhaul the test suite to be independent of a Rails project
49
- * Added concept of database adapter. Ported mysql/postgresql conditional code to their own adapter.
50
- * Added SQL Server support. THANKS http://github.com/brennandunn for all the improvements in this release
51
-
52
- ## 1.1.3 / 2009-09-26
53
-
54
- * documentation updates and updated to work with Geokit gem v1.5.0
55
- * IMPORTANT: in the Geokit gem, Geokit::Geocoders::timeout became Geokit::Geocoders::request_timeout for jruby compatibility.
56
- The plugin sets this in config/initializers/geokit_config.rb. So if you've upgraded the gem to 1.5.0, you need to
57
- make the change manually from Geokit::Geocoders::timeout to Geokit::Geocoders::request_timeout in config/initializers/geokit_config.rb
58
-
59
- ## 1.1.2 / 2009-06-08
60
-
61
- * Added support for hashes in :through. So you can do: acts_as_mappable :through => { :state => :country } (Thanks José Valim).
62
-
63
- ## 1.1.1 / 2009-05-22
64
- * Support for multiple ip geocoders (Thanks dreamcat4)
65
- * Now checks if either :origin OR :bounds is passed, and proceeds with geokit query if this is true (Thanks Glenn Powell)
66
- * Raises a helpful error if someone uses through but the association does not exists or was not defined yet (Thanks José Valim)
67
-
68
- ## 1.1.0 / 2009-04-11
69
-
70
- * Fixed :through usages so that the through model is only included in the query if there
71
- is an :origin passed in (Only if it is a geokit search) (Thanks Glenn Powell)
72
- * Move library initialisation into lib/geokit-rails. init.rb uses lib/geokit-rails now (thanks Alban Peignier)
73
- * Handle the case where a user passes a hash to the :conditions Finder option (thanks Adam Greene)
74
- * Added ability to specify domain-specific API keys (Thanks Glenn Powell)
75
-
76
- ## 2009-02-20
77
-
78
- * More powerful assosciations in the Rails Plugin:You can now specify a model as mappable "through" an associated model.
79
- In other words, that associated model is the actual mappable model with "lat" and "lng" attributes, but this "through" model
80
- can still utilize all Geokit's "find by distance" finders. Also Rails 2.3 compatibility (thanks github/glennpow)
81
-
82
- ## 2008-12-18
83
-
84
- * Split Rails plugin from geocoder gem
85
- * updated for Rails 2.2.2
86
-
87
- ## 2008-08-20
88
-
89
- * Further fix of distance calculation, this time in SQL. Now uses least() function, which is available in MySQL version 3.22.5+ and postgres versions 8.1+
90
-
91
- ## 2008-01-16
92
-
93
- * fixed the "zero-distance" bug (calculating between two points that are the same)
94
-
95
- ## 2007-11-12
96
-
97
- * fixed a small but with queries crossing meridian, and also fixed find(:closest)
98
-
99
- ## 2007-10-11
100
-
101
- * Fixed Rails2/Edge compatability
1
+ ## 2.5.2
2
+
3
+ * Add support for the Trilogy MySQL adapter
4
+
5
+ ## 2.5.1
6
+
7
+ * Run the test suite on GitHub Actions against Ruby 3.2 to 4.0, Rails 7.1 to 8.1, SQLite, MySQL and PostgreSQL
8
+ * Only look up finder adapters in `Geokit::Adapters`, so a top-level constant with the same name defined by another gem isn't mistaken for one
9
+ * Fix `in_range` returning records without coordinates on PostgreSQL
10
+ * Fix `within`, `in_range` and `by_distance` on models using `:through`, which filtered on the model's own table instead of the associated one
11
+
12
+ ## 2.5.0
13
+
14
+ * Fixed dangerous YAML loading vulnerability
15
+ * Rebuilt integration tests
16
+
17
+ ## 2.3.2
18
+
19
+ * Fix sqlite3 adapter error
20
+
21
+ ## 2.3.1
22
+
23
+ * Fix Rails 5.2 deprecation warning
24
+
25
+ ## 2.3.0
26
+
27
+ * Drop ruby 1.9 and add 2.3 support
28
+ * Add an option to skip loading
29
+ * Remove excessive debug statement
30
+
31
+ ## 2.2.0
32
+
33
+ * Add rails config aenerator
34
+ * Add NOT NULL checks for latitude and longitude, otherwise nonsense
35
+ values are being returned for distance calculations involving such
36
+ objects.
37
+ * Fix inconsistent case where retrieve_location_from_cookie_or_services
38
+ returned a Hash instead of a GeoLoc
39
+ * Speed up SQL with bounding box
40
+ * Tests against rails 4 & 5
41
+
42
+ ## 2.1.0
43
+
44
+ * Add OracleEnhanced adapter
45
+ * Fix bug with custom latitude/longitude names
46
+ * BREAKING: Nearest and fathest return scopes not arrays
47
+ * Drop support for ruby 1.8/1.9
48
+
49
+ ## 2.0.1
50
+
51
+ * Fix GeoKit naming compatibility
52
+
53
+ ## 2.0.0 / 2013-06-19
54
+
55
+ * Integrated geokit-rails3 into geokit-rails (use 1.x for rails2 support)
56
+
57
+ ## 1.2.0 / 2009-10-02
58
+
59
+ * Overhaul the test suite to be independent of a Rails project
60
+ * Added concept of database adapter. Ported mysql/postgresql conditional code to their own adapter.
61
+ * Added SQL Server support. THANKS http://github.com/brennandunn for all the improvements in this release
62
+
63
+ ## 1.1.3 / 2009-09-26
64
+
65
+ * documentation updates and updated to work with Geokit gem v1.5.0
66
+ * IMPORTANT: in the Geokit gem, Geokit::Geocoders::timeout became Geokit::Geocoders::request_timeout for jruby compatibility.
67
+ The plugin sets this in config/initializers/geokit_config.rb. So if you've upgraded the gem to 1.5.0, you need to
68
+ make the change manually from Geokit::Geocoders::timeout to Geokit::Geocoders::request_timeout in config/initializers/geokit_config.rb
69
+
70
+ ## 1.1.2 / 2009-06-08
71
+
72
+ * Added support for hashes in :through. So you can do: acts_as_mappable :through => { :state => :country } (Thanks José Valim).
73
+
74
+ ## 1.1.1 / 2009-05-22
75
+ * Support for multiple ip geocoders (Thanks dreamcat4)
76
+ * Now checks if either :origin OR :bounds is passed, and proceeds with geokit query if this is true (Thanks Glenn Powell)
77
+ * Raises a helpful error if someone uses through but the association does not exists or was not defined yet (Thanks José Valim)
78
+
79
+ ## 1.1.0 / 2009-04-11
80
+
81
+ * Fixed :through usages so that the through model is only included in the query if there
82
+ is an :origin passed in (Only if it is a geokit search) (Thanks Glenn Powell)
83
+ * Move library initialisation into lib/geokit-rails. init.rb uses lib/geokit-rails now (thanks Alban Peignier)
84
+ * Handle the case where a user passes a hash to the :conditions Finder option (thanks Adam Greene)
85
+ * Added ability to specify domain-specific API keys (Thanks Glenn Powell)
86
+
87
+ ## 2009-02-20
88
+
89
+ * More powerful assosciations in the Rails Plugin:You can now specify a model as mappable "through" an associated model.
90
+ In other words, that associated model is the actual mappable model with "lat" and "lng" attributes, but this "through" model
91
+ can still utilize all Geokit's "find by distance" finders. Also Rails 2.3 compatibility (thanks github/glennpow)
92
+
93
+ ## 2008-12-18
94
+
95
+ * Split Rails plugin from geocoder gem
96
+ * updated for Rails 2.2.2
97
+
98
+ ## 2008-08-20
99
+
100
+ * Further fix of distance calculation, this time in SQL. Now uses least() function, which is available in MySQL version 3.22.5+ and postgres versions 8.1+
101
+
102
+ ## 2008-01-16
103
+
104
+ * fixed the "zero-distance" bug (calculating between two points that are the same)
105
+
106
+ ## 2007-11-12
107
+
108
+ * fixed a small but with queries crossing meridian, and also fixed find(:closest)
109
+
110
+ ## 2007-10-11
111
+
112
+ * Fixed Rails2/Edge compatability
data/CONFIG.markdown CHANGED
@@ -1,67 +1,67 @@
1
- # You can configure Geokit in your environment files
2
-
3
- These defaults are used in `Geokit::Mappable.distance_to` and in `acts_as_mappable`
4
-
5
- config.geokit.default_units = :miles
6
- config.geokit.default_formula = :sphere
7
-
8
- This is the timeout value in seconds to be used for calls to the geocoder web services. For no timeout at all, comment out the setting. The timeout unit is in seconds.
9
-
10
- config.geokit.geocoders.request_timeout = 3
11
-
12
- These settings are used if web service calls must be routed through a proxy.
13
- These setting can be `nil` if not needed, otherwise, addr and port must be filled in at a minimum. If the proxy requires authentication, the username and password can be provided as well.
14
-
15
- config.geokit.geocoders.proxy_addr = nil
16
- config.geokit.geocoders.proxy_port = nil
17
- config.geokit.geocoders.proxy_user = nil
18
- config.geokit.geocoders.proxy_pass = nil
19
-
20
- This is your yahoo application key for the Yahoo Geocoder.
21
-
22
- See [http://developer.yahoo.com/faq/index.html#appid](http://developer.yahoo.com/faq/index.html#appid)
23
- and [http://developer.yahoo.com/maps/rest/V1/geocode.html](http://developer.yahoo.com/maps/rest/V1/geocode.html)
24
-
25
- config.geokit.geocoders.yahoo = 'REPLACE_WITH_YOUR_YAHOO_KEY'
26
-
27
- This is your Google Maps geocoder key.
28
-
29
- See [http://www.google.com/apis/maps/signup.html](http://www.google.com/apis/maps/signup.html)
30
- and [http://www.google.com/apis/maps/documentation/#Geocoding_Examples](http://www.google.com/apis/maps/documentation/#Geocoding_Examples)
31
-
32
- config.geokit.geocoders.google = 'REPLACE_WITH_YOUR_GOOGLE_KEY'
33
-
34
- This is your username and password for **geocoder.us**.
35
- To use the free service, the value can be set to `nil` or `false`.
36
- For usage tied to an account, the value should be set to `username:password`.
37
-
38
- See [http://geocoder.us](http://geocoder.us)
39
- and [http://geocoder.us/user/signup](http://geocoder.us/user/signup)
40
-
41
- config.geokit.geocoders.geocoder_us = false
42
-
43
- This is your authorization key for **geocoder.ca**.
44
- To use the free service, the value can be set to `nil` or `false`. For usage tied to an account, set the value to the key obtained from
45
- **Geocoder.ca**.
46
-
47
- See [http://geocoder.ca](http://geocoder.ca)
48
- and [http://geocoder.ca/?register=1](http://geocoder.ca/?register=1)
49
-
50
- config.geokit.geocoders.geocoder_ca = false
51
-
52
- Add this to use a username with the Geonames geocoder
53
-
54
- config.geokit.geocoders.geonames="REPLACE_WITH_YOUR_GEONAMES_USERNAME"
55
-
56
- This is the order in which the geocoders are called in a failover scenario.
57
- If you only want to use a single geocoder, put a single symbol in the array.
58
- Valid symbols are `:google`, `:yahoo`, `:us`, and `:ca`.
59
- Be aware that there are **Terms of Use** restrictions on how you can use the various geocoders. Make sure you read up on relevant **Terms of Use** for each geocoder you are going to use.
60
-
61
- config.geokit.geocoders.provider_order = [:google,:us]
62
-
63
- The IP provider order. Valid symbols are `:ip`, `:geo_plugin`.
64
- As before, make sure you read up on relevant **Terms of Use** for each
65
-
66
- config.geokit.geocoders.ip_provider_order = [:geo_plugin,:ip]
67
-
1
+ # You can configure Geokit in your environment files
2
+
3
+ These defaults are used in `Geokit::Mappable.distance_to` and in `acts_as_mappable`
4
+
5
+ config.geokit.default_units = :miles
6
+ config.geokit.default_formula = :sphere
7
+
8
+ This is the timeout value in seconds to be used for calls to the geocoder web services. For no timeout at all, comment out the setting. The timeout unit is in seconds.
9
+
10
+ config.geokit.geocoders.request_timeout = 3
11
+
12
+ These settings are used if web service calls must be routed through a proxy.
13
+ These setting can be `nil` if not needed, otherwise, addr and port must be filled in at a minimum. If the proxy requires authentication, the username and password can be provided as well.
14
+
15
+ config.geokit.geocoders.proxy_addr = nil
16
+ config.geokit.geocoders.proxy_port = nil
17
+ config.geokit.geocoders.proxy_user = nil
18
+ config.geokit.geocoders.proxy_pass = nil
19
+
20
+ This is your yahoo application key for the Yahoo Geocoder.
21
+
22
+ See [http://developer.yahoo.com/faq/index.html#appid](http://developer.yahoo.com/faq/index.html#appid)
23
+ and [http://developer.yahoo.com/maps/rest/V1/geocode.html](http://developer.yahoo.com/maps/rest/V1/geocode.html)
24
+
25
+ config.geokit.geocoders.yahoo = 'REPLACE_WITH_YOUR_YAHOO_KEY'
26
+
27
+ This is your Google Maps geocoder key.
28
+
29
+ See [http://www.google.com/apis/maps/signup.html](http://www.google.com/apis/maps/signup.html)
30
+ and [http://www.google.com/apis/maps/documentation/#Geocoding_Examples](http://www.google.com/apis/maps/documentation/#Geocoding_Examples)
31
+
32
+ config.geokit.geocoders.google = 'REPLACE_WITH_YOUR_GOOGLE_KEY'
33
+
34
+ This is your username and password for **geocoder.us**.
35
+ To use the free service, the value can be set to `nil` or `false`.
36
+ For usage tied to an account, the value should be set to `username:password`.
37
+
38
+ See [http://geocoder.us](http://geocoder.us)
39
+ and [http://geocoder.us/user/signup](http://geocoder.us/user/signup)
40
+
41
+ config.geokit.geocoders.geocoder_us = false
42
+
43
+ This is your authorization key for **geocoder.ca**.
44
+ To use the free service, the value can be set to `nil` or `false`. For usage tied to an account, set the value to the key obtained from
45
+ **Geocoder.ca**.
46
+
47
+ See [http://geocoder.ca](http://geocoder.ca)
48
+ and [http://geocoder.ca/?register=1](http://geocoder.ca/?register=1)
49
+
50
+ config.geokit.geocoders.geocoder_ca = false
51
+
52
+ Add this to use a username with the Geonames geocoder
53
+
54
+ config.geokit.geocoders.geonames="REPLACE_WITH_YOUR_GEONAMES_USERNAME"
55
+
56
+ This is the order in which the geocoders are called in a failover scenario.
57
+ If you only want to use a single geocoder, put a single symbol in the array.
58
+ Valid symbols are `:google`, `:yahoo`, `:us`, and `:ca`.
59
+ Be aware that there are **Terms of Use** restrictions on how you can use the various geocoders. Make sure you read up on relevant **Terms of Use** for each geocoder you are going to use.
60
+
61
+ config.geokit.geocoders.provider_order = [:google,:us]
62
+
63
+ The IP provider order. Valid symbols are `:ip`, `:geo_plugin`.
64
+ As before, make sure you read up on relevant **Terms of Use** for each
65
+
66
+ config.geokit.geocoders.ip_provider_order = [:geo_plugin,:ip]
67
+
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/MIT-LICENSE CHANGED
@@ -1,20 +1,20 @@
1
- Copyright (c) 2013 Michael Noack, James Cox, Bill Eisenhauer & Andre Lewis
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
1
+ Copyright (c) 2013 Michael Noack, James Cox, Bill Eisenhauer & Andre Lewis
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
20
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.