geocoder 1.1.9 → 1.2.0
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +9 -5
- data/CHANGELOG.md +19 -0
- data/README.md +175 -10
- data/Rakefile +1 -1
- data/gemfiles/Gemfile.mongoid-2.4.x +1 -0
- data/lib/generators/geocoder/maxmind/geolite_city_generator.rb +28 -0
- data/lib/generators/geocoder/maxmind/geolite_country_generator.rb +28 -0
- data/lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb +27 -0
- data/lib/generators/geocoder/maxmind/templates/migration/geolite_country.rb +17 -0
- data/lib/geocoder.rb +4 -12
- data/lib/geocoder/cache.rb +3 -2
- data/lib/geocoder/calculations.rb +39 -0
- data/lib/geocoder/configuration.rb +1 -7
- data/lib/geocoder/ip_address.rb +12 -0
- data/lib/geocoder/lookup.rb +10 -1
- data/lib/geocoder/lookups/baidu.rb +7 -6
- data/lib/geocoder/lookups/baidu_ip.rb +54 -0
- data/lib/geocoder/lookups/base.rb +37 -9
- data/lib/geocoder/lookups/bing.rb +10 -5
- data/lib/geocoder/lookups/cloudmade.rb +35 -0
- data/lib/geocoder/lookups/freegeoip.rb +5 -1
- data/lib/geocoder/lookups/geocodio.rb +42 -0
- data/lib/geocoder/lookups/google_premier.rb +1 -1
- data/lib/geocoder/lookups/here.rb +62 -0
- data/lib/geocoder/lookups/mapquest.rb +2 -1
- data/lib/geocoder/lookups/maxmind_local.rb +58 -0
- data/lib/geocoder/lookups/nominatim.rb +8 -0
- data/lib/geocoder/lookups/smarty_streets.rb +45 -0
- data/lib/geocoder/lookups/yahoo.rb +1 -1
- data/lib/geocoder/models/active_record.rb +5 -3
- data/lib/geocoder/models/base.rb +1 -4
- data/lib/geocoder/models/mongo_base.rb +4 -2
- data/lib/geocoder/query.rb +4 -4
- data/lib/geocoder/railtie.rb +1 -1
- data/lib/geocoder/request.rb +10 -8
- data/lib/geocoder/results/baidu_ip.rb +62 -0
- data/lib/geocoder/results/cloudmade.rb +39 -0
- data/lib/geocoder/results/geocodio.rb +66 -0
- data/lib/geocoder/results/here.rb +62 -0
- data/lib/geocoder/results/maxmind_local.rb +49 -0
- data/lib/geocoder/results/smarty_streets.rb +106 -0
- data/lib/geocoder/results/test.rb +20 -3
- data/lib/geocoder/results/yandex.rb +7 -3
- data/lib/geocoder/sql.rb +16 -15
- data/lib/geocoder/stores/active_record.rb +6 -2
- data/lib/geocoder/stores/base.rb +8 -1
- data/lib/geocoder/version.rb +1 -1
- data/lib/maxmind_database.rb +109 -0
- data/lib/oauth_util.rb +1 -1
- data/lib/tasks/geocoder.rake +3 -1
- data/lib/tasks/maxmind.rake +73 -0
- data/test/fixtures/baidu_ip_202_198_16_3 +19 -0
- data/test/fixtures/baidu_ip_invalid_key +1 -0
- data/test/fixtures/baidu_ip_no_results +1 -0
- data/test/fixtures/cloudmade_invalid_key +1 -0
- data/test/fixtures/cloudmade_madison_square_garden +1 -0
- data/test/fixtures/cloudmade_no_results +1 -0
- data/test/fixtures/geocodio_1101_pennsylvania_ave +1 -0
- data/test/fixtures/geocodio_bad_api_key +3 -0
- data/test/fixtures/geocodio_invalid +4 -0
- data/test/fixtures/geocodio_no_results +1 -0
- data/test/fixtures/geocodio_over_query_limit +4 -0
- data/test/fixtures/here_madison_square_garden +72 -0
- data/test/fixtures/here_no_results +8 -0
- data/test/fixtures/nominatim_over_limit +1 -0
- data/test/fixtures/smarty_streets_11211 +1 -0
- data/test/fixtures/smarty_streets_madison_square_garden +47 -0
- data/test/fixtures/smarty_streets_no_results +1 -0
- data/test/fixtures/yandex_canada_rue_dupuis_14 +446 -0
- data/test/fixtures/yandex_new_york +1 -0
- data/test/integration/http_client_test.rb +25 -0
- data/test/mongoid_test_helper.rb +2 -2
- data/test/test_helper.rb +98 -30
- data/test/{active_record_test.rb → unit/active_record_test.rb} +4 -3
- data/test/{cache_test.rb → unit/cache_test.rb} +3 -1
- data/test/{calculations_test.rb → unit/calculations_test.rb} +22 -13
- data/test/{configuration_test.rb → unit/configuration_test.rb} +4 -27
- data/test/{error_handling_test.rb → unit/error_handling_test.rb} +10 -9
- data/test/{geocoder_test.rb → unit/geocoder_test.rb} +26 -7
- data/test/{https_test.rb → unit/https_test.rb} +4 -3
- data/test/unit/ip_address_test.rb +24 -0
- data/test/{lookup_test.rb → unit/lookup_test.rb} +33 -20
- data/test/unit/lookups/bing_test.rb +68 -0
- data/test/unit/lookups/dstk_test.rb +26 -0
- data/test/unit/lookups/esri_test.rb +48 -0
- data/test/unit/lookups/freegeoip_test.rb +27 -0
- data/test/unit/lookups/geocoder_ca_test.rb +17 -0
- data/test/unit/lookups/geocodio_test.rb +55 -0
- data/test/unit/lookups/google_premier_test.rb +22 -0
- data/test/unit/lookups/google_test.rb +84 -0
- data/test/unit/lookups/mapquest_test.rb +60 -0
- data/test/unit/lookups/maxmind_local_test.rb +28 -0
- data/test/unit/lookups/maxmind_test.rb +63 -0
- data/test/unit/lookups/nominatim_test.rb +31 -0
- data/test/unit/lookups/smarty_streets_test.rb +71 -0
- data/test/unit/lookups/yahoo_test.rb +35 -0
- data/test/{method_aliases_test.rb → unit/method_aliases_test.rb} +5 -4
- data/test/unit/model_test.rb +38 -0
- data/test/{mongoid_test.rb → unit/mongoid_test.rb} +10 -9
- data/test/unit/near_test.rb +87 -0
- data/test/{oauth_util_test.rb → unit/oauth_util_test.rb} +3 -2
- data/test/{proxy_test.rb → unit/proxy_test.rb} +2 -1
- data/test/{query_test.rb → unit/query_test.rb} +7 -8
- data/test/unit/rake_task_test.rb +21 -0
- data/test/{request_test.rb → unit/request_test.rb} +8 -2
- data/test/{result_test.rb → unit/result_test.rb} +29 -1
- data/test/{test_mode_test.rb → unit/test_mode_test.rb} +12 -1
- metadata +80 -27
- data/test/custom_block_test.rb +0 -32
- data/test/integration/smoke_test.rb +0 -26
- data/test/near_test.rb +0 -61
- data/test/services_test.rb +0 -393
@@ -1,45 +1,46 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
$: << File.join(File.dirname(__FILE__), "..")
|
2
3
|
require 'mongoid_test_helper'
|
3
4
|
|
4
|
-
class MongoidTest <
|
5
|
+
class MongoidTest < GeocoderTestCase
|
5
6
|
def test_geocoded_check
|
6
|
-
p =
|
7
|
+
p = PlaceUsingMongoid.new(*geocoded_object_params(:msg))
|
7
8
|
p.location = [40.750354, -73.993371]
|
8
9
|
assert p.geocoded?
|
9
10
|
end
|
10
11
|
|
11
12
|
def test_distance_to_returns_float
|
12
|
-
p =
|
13
|
+
p = PlaceUsingMongoid.new(*geocoded_object_params(:msg))
|
13
14
|
p.location = [40.750354, -73.993371]
|
14
15
|
assert p.distance_to([30, -94]).is_a?(Float)
|
15
16
|
end
|
16
17
|
|
17
18
|
def test_custom_coordinate_field_near_scope
|
18
19
|
location = [40.750354, -73.993371]
|
19
|
-
p =
|
20
|
+
p = PlaceUsingMongoid.near(location)
|
20
21
|
key = Mongoid::VERSION >= "3" ? "location" : :location
|
21
22
|
assert_equal p.selector[key]['$nearSphere'], location.reverse
|
22
23
|
end
|
23
24
|
|
24
25
|
def test_model_configuration
|
25
|
-
p =
|
26
|
+
p = PlaceUsingMongoid.new(*geocoded_object_params(:msg))
|
26
27
|
p.location = [0, 0]
|
27
28
|
|
28
|
-
|
29
|
+
PlaceUsingMongoid.geocoded_by :address, :coordinates => :location, :units => :km
|
29
30
|
assert_equal 111, p.distance_to([0,1]).round
|
30
31
|
|
31
|
-
|
32
|
+
PlaceUsingMongoid.geocoded_by :address, :coordinates => :location, :units => :mi
|
32
33
|
assert_equal 69, p.distance_to([0,1]).round
|
33
34
|
end
|
34
35
|
|
35
36
|
def test_index_is_skipped_if_skip_option_flag
|
36
|
-
result =
|
37
|
+
result = PlaceUsingMongoidWithoutIndex.index_options.keys.flatten[0] == :coordinates
|
37
38
|
assert !result
|
38
39
|
end
|
39
40
|
|
40
41
|
def test_nil_radius_omits_max_distance
|
41
42
|
location = [40.750354, -73.993371]
|
42
|
-
p =
|
43
|
+
p = PlaceUsingMongoid.near(location, nil)
|
43
44
|
key = Mongoid::VERSION >= "3" ? "location" : :location
|
44
45
|
assert_equal nil, p.selector[key]['$maxDistance']
|
45
46
|
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
$: << File.join(File.dirname(__FILE__), "..")
|
3
|
+
require 'test_helper'
|
4
|
+
|
5
|
+
class NearTest < GeocoderTestCase
|
6
|
+
|
7
|
+
def test_near_scope_options_without_sqlite_includes_bounding_box_condition
|
8
|
+
result = PlaceWithCustomResultsHandling.send(:near_scope_options, 1.0, 2.0, 5)
|
9
|
+
assert_match(/test_table_name.latitude BETWEEN 0.9276\d* AND 1.0723\d* AND test_table_name.longitude BETWEEN 1.9276\d* AND 2.0723\d* AND /, result[:conditions][0])
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_near_scope_options_without_sqlite_includes_radius_condition
|
13
|
+
result = Place.send(:near_scope_options, 1.0, 2.0, 5)
|
14
|
+
assert_match(/BETWEEN \? AND \?$/, result[:conditions][0])
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_near_scope_options_without_sqlite_includes_radius_default_min_radius
|
18
|
+
result = Place.send(:near_scope_options, 1.0, 2.0, 5)
|
19
|
+
|
20
|
+
assert_equal(0, result[:conditions][1])
|
21
|
+
assert_equal(5, result[:conditions][2])
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_near_scope_options_without_sqlite_includes_radius_custom_min_radius
|
25
|
+
result = Place.send(:near_scope_options, 1.0, 2.0, 5, :min_radius => 3)
|
26
|
+
|
27
|
+
assert_equal(3, result[:conditions][1])
|
28
|
+
assert_equal(5, result[:conditions][2])
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_near_scope_options_without_sqlite_includes_radius_bogus_min_radius
|
32
|
+
result = Place.send(:near_scope_options, 1.0, 2.0, 5, :min_radius => 'bogus')
|
33
|
+
|
34
|
+
assert_equal(0, result[:conditions][1])
|
35
|
+
assert_equal(5, result[:conditions][2])
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_near_scope_options_with_defaults
|
39
|
+
result = PlaceWithCustomResultsHandling.send(:near_scope_options, 1.0, 2.0, 5)
|
40
|
+
|
41
|
+
assert_match(/AS distance/, result[:select])
|
42
|
+
assert_match(/AS bearing/, result[:select])
|
43
|
+
assert_no_consecutive_comma(result[:select])
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_near_scope_options_with_no_distance
|
47
|
+
result = PlaceWithCustomResultsHandling.send(:near_scope_options, 1.0, 2.0, 5, :select_distance => false)
|
48
|
+
|
49
|
+
assert_no_match(/AS distance/, result[:select])
|
50
|
+
assert_match(/AS bearing/, result[:select])
|
51
|
+
assert_no_match(/distance/, result[:condition])
|
52
|
+
assert_no_match(/distance/, result[:order])
|
53
|
+
assert_no_consecutive_comma(result[:select])
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_near_scope_options_with_no_bearing
|
57
|
+
result = PlaceWithCustomResultsHandling.send(:near_scope_options, 1.0, 2.0, 5, :select_bearing => false)
|
58
|
+
|
59
|
+
assert_match(/AS distance/, result[:select])
|
60
|
+
assert_no_match(/AS bearing/, result[:select])
|
61
|
+
assert_no_consecutive_comma(result[:select])
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_near_scope_options_with_custom_distance_column
|
65
|
+
result = PlaceWithCustomResultsHandling.send(:near_scope_options, 1.0, 2.0, 5, :distance_column => 'calculated_distance')
|
66
|
+
|
67
|
+
assert_no_match(/AS distance/, result[:select])
|
68
|
+
assert_match(/AS calculated_distance/, result[:select])
|
69
|
+
assert_no_match(/\bdistance\b/, result[:order])
|
70
|
+
assert_match(/calculated_distance/, result[:order])
|
71
|
+
assert_no_consecutive_comma(result[:select])
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_near_scope_options_with_custom_bearing_column
|
75
|
+
result = PlaceWithCustomResultsHandling.send(:near_scope_options, 1.0, 2.0, 5, :bearing_column => 'calculated_bearing')
|
76
|
+
|
77
|
+
assert_no_match(/AS bearing/, result[:select])
|
78
|
+
assert_match(/AS calculated_bearing/, result[:select])
|
79
|
+
assert_no_consecutive_comma(result[:select])
|
80
|
+
end
|
81
|
+
|
82
|
+
private
|
83
|
+
|
84
|
+
def assert_no_consecutive_comma(string)
|
85
|
+
assert_no_match(/, *,/, string, "two consecutive commas")
|
86
|
+
end
|
87
|
+
end
|
@@ -1,9 +1,10 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
$: << File.join(File.dirname(__FILE__), "..")
|
2
3
|
require 'test_helper'
|
3
4
|
require 'cgi'
|
4
5
|
require 'uri'
|
5
6
|
|
6
|
-
class OauthUtilTest <
|
7
|
+
class OauthUtilTest < GeocoderTestCase
|
7
8
|
def test_query_string_escapes_single_quote
|
8
9
|
base_url = "http://example.com?location=d'iberville"
|
9
10
|
|
@@ -25,6 +26,6 @@ class OauthUtilTest < Test::Unit::TestCase
|
|
25
26
|
|
26
27
|
query_string = o.sign(URI.parse(base_url)).query_string
|
27
28
|
|
28
|
-
assert_match
|
29
|
+
assert_match(/.*a_param=.*b_param=.*n_param=.*z_param=.*/, query_string)
|
29
30
|
end
|
30
31
|
end
|
@@ -1,16 +1,13 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
$: << File.join(File.dirname(__FILE__), "..")
|
2
3
|
require 'test_helper'
|
3
4
|
|
4
|
-
class QueryTest <
|
5
|
+
class QueryTest < GeocoderTestCase
|
5
6
|
|
6
7
|
def test_ip_address_detection
|
7
8
|
assert Geocoder::Query.new("232.65.123.94").ip_address?
|
8
|
-
assert Geocoder::Query.new("666.65.123.94").ip_address? # technically invalid
|
9
|
-
assert Geocoder::Query.new("::ffff:12.34.56.78").ip_address?
|
10
9
|
assert !Geocoder::Query.new("232.65.123.94.43").ip_address?
|
11
|
-
assert !Geocoder::Query.new("232.65.123").ip_address?
|
12
10
|
assert !Geocoder::Query.new("::ffff:123.456.789").ip_address?
|
13
|
-
assert !Geocoder::Query.new("Test\n232.65.123.94").ip_address?
|
14
11
|
end
|
15
12
|
|
16
13
|
def test_blank_query_detection
|
@@ -38,15 +35,17 @@ class QueryTest < Test::Unit::TestCase
|
|
38
35
|
end
|
39
36
|
|
40
37
|
def test_loopback_ip_address
|
41
|
-
assert Geocoder::Query.new("0.0.0.0").loopback_ip_address?
|
42
38
|
assert Geocoder::Query.new("127.0.0.1").loopback_ip_address?
|
43
39
|
assert !Geocoder::Query.new("232.65.123.234").loopback_ip_address?
|
44
|
-
assert !Geocoder::Query.new("127 Main St.").loopback_ip_address?
|
45
|
-
assert !Geocoder::Query.new("John Doe\n127 Main St.\nAnywhere, USA").loopback_ip_address?
|
46
40
|
end
|
47
41
|
|
48
42
|
def test_sanitized_text_with_array
|
49
43
|
q = Geocoder::Query.new([43.1313,11.3131])
|
50
44
|
assert_equal "43.1313,11.3131", q.sanitized_text
|
51
45
|
end
|
46
|
+
|
47
|
+
def test_custom_lookup
|
48
|
+
query = Geocoder::Query.new("address", :lookup => :nominatim)
|
49
|
+
assert_equal Geocoder::Lookup::Nominatim, query.lookup.class
|
50
|
+
end
|
52
51
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
$: << File.join(File.dirname(__FILE__), "..")
|
3
|
+
require 'test_helper'
|
4
|
+
|
5
|
+
class RakeTaskTest < GeocoderTestCase
|
6
|
+
def setup
|
7
|
+
Rake.application.rake_require "tasks/geocoder"
|
8
|
+
Rake::Task.define_task(:environment)
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_rake_task_geocode_raise_specify_class_message
|
12
|
+
assert_raise(RuntimeError, "Please specify a CLASS (model)") do
|
13
|
+
Rake.application.invoke_task("geocode:all")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_rake_task_geocode_specify_class
|
18
|
+
ENV['CLASS'] = 'Place'
|
19
|
+
assert_nil Rake.application.invoke_task("geocode:all")
|
20
|
+
end
|
21
|
+
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
$: << File.join(File.dirname(__FILE__), "..")
|
2
3
|
require 'test_helper'
|
3
4
|
|
4
|
-
class RequestTest <
|
5
|
+
class RequestTest < GeocoderTestCase
|
5
6
|
class MockRequest
|
6
7
|
include Geocoder::Request
|
7
8
|
attr_accessor :env, :ip
|
@@ -26,4 +27,9 @@ class RequestTest < Test::Unit::TestCase
|
|
26
27
|
req = MockRequest.new({}, "74.200.247.59")
|
27
28
|
assert req.location.is_a?(Geocoder::Result::Freegeoip)
|
28
29
|
end
|
29
|
-
|
30
|
+
|
31
|
+
def test_with_loopback_x_forwarded_for
|
32
|
+
req = MockRequest.new({"HTTP_X_FORWARDED_FOR" => "127.0.0.1"}, "74.200.247.59")
|
33
|
+
assert_equal "US", req.location.country_code
|
34
|
+
end
|
35
|
+
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
$: << File.join(File.dirname(__FILE__), "..")
|
2
3
|
require 'test_helper'
|
3
4
|
|
4
|
-
class ResultTest <
|
5
|
+
class ResultTest < GeocoderTestCase
|
5
6
|
|
6
7
|
def test_result_has_required_attributes
|
7
8
|
Geocoder::Lookup.all_services_except_test.each do |l|
|
@@ -21,6 +22,33 @@ class ResultTest < Test::Unit::TestCase
|
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
25
|
+
def test_yandex_result_new_york
|
26
|
+
assert_nothing_raised do
|
27
|
+
Geocoder.configure(:lookup => :yandex)
|
28
|
+
set_api_key!(:yandex)
|
29
|
+
result = Geocoder.search("new york").first
|
30
|
+
assert_equal "", result.city
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_yandex_result_kind
|
35
|
+
assert_nothing_raised do
|
36
|
+
Geocoder.configure(:lookup => :yandex)
|
37
|
+
set_api_key!(:yandex)
|
38
|
+
["new york", [45.423733, -75.676333], "no city and town"].each do |query|
|
39
|
+
Geocoder.search("new york").first.kind
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_yandex_result_without_locality_name
|
45
|
+
assert_nothing_raised do
|
46
|
+
Geocoder.configure(:lookup => :yandex)
|
47
|
+
set_api_key!(:yandex)
|
48
|
+
result = Geocoder.search("canada rue dupuis 14")[6]
|
49
|
+
assert_equal "", result.city
|
50
|
+
end
|
51
|
+
end
|
24
52
|
|
25
53
|
private # ------------------------------------------------------------------
|
26
54
|
|
@@ -1,6 +1,8 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
$: << File.join(File.dirname(__FILE__), "..")
|
1
3
|
require 'test_helper'
|
2
4
|
|
3
|
-
class TestModeTest <
|
5
|
+
class TestModeTest < GeocoderTestCase
|
4
6
|
|
5
7
|
def setup
|
6
8
|
@_original_lookup = Geocoder.config.lookup
|
@@ -42,6 +44,15 @@ class TestModeTest < Test::Unit::TestCase
|
|
42
44
|
end
|
43
45
|
end
|
44
46
|
|
47
|
+
def test_search_with_custom_attributes
|
48
|
+
custom_attributes = mock_attributes.merge(:custom => 'NY, NY')
|
49
|
+
Geocoder::Lookup::Test.add_stub("New York, NY", [custom_attributes])
|
50
|
+
|
51
|
+
result = Geocoder.search("New York, NY").first
|
52
|
+
|
53
|
+
assert_equal 'NY, NY', result.custom
|
54
|
+
end
|
55
|
+
|
45
56
|
private
|
46
57
|
def mock_attributes
|
47
58
|
coordinates = [40.7143528, -74.0059731]
|
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.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Reisner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-04-16 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,8 +21,8 @@ executables:
|
|
21
21
|
extensions: []
|
22
22
|
extra_rdoc_files: []
|
23
23
|
files:
|
24
|
-
- .gitignore
|
25
|
-
- .travis.yml
|
24
|
+
- ".gitignore"
|
25
|
+
- ".travis.yml"
|
26
26
|
- CHANGELOG.md
|
27
27
|
- LICENSE
|
28
28
|
- README.md
|
@@ -34,6 +34,10 @@ files:
|
|
34
34
|
- gemfiles/Gemfile.mongoid-2.4.x
|
35
35
|
- lib/generators/geocoder/config/config_generator.rb
|
36
36
|
- lib/generators/geocoder/config/templates/initializer.rb
|
37
|
+
- lib/generators/geocoder/maxmind/geolite_city_generator.rb
|
38
|
+
- lib/generators/geocoder/maxmind/geolite_country_generator.rb
|
39
|
+
- lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
|
40
|
+
- lib/generators/geocoder/maxmind/templates/migration/geolite_country.rb
|
37
41
|
- lib/geocoder.rb
|
38
42
|
- lib/geocoder/cache.rb
|
39
43
|
- lib/geocoder/calculations.rb
|
@@ -41,21 +45,28 @@ files:
|
|
41
45
|
- lib/geocoder/configuration.rb
|
42
46
|
- lib/geocoder/configuration_hash.rb
|
43
47
|
- lib/geocoder/exceptions.rb
|
48
|
+
- lib/geocoder/ip_address.rb
|
44
49
|
- lib/geocoder/lookup.rb
|
45
50
|
- lib/geocoder/lookups/baidu.rb
|
51
|
+
- lib/geocoder/lookups/baidu_ip.rb
|
46
52
|
- lib/geocoder/lookups/base.rb
|
47
53
|
- lib/geocoder/lookups/bing.rb
|
54
|
+
- lib/geocoder/lookups/cloudmade.rb
|
48
55
|
- lib/geocoder/lookups/dstk.rb
|
49
56
|
- lib/geocoder/lookups/esri.rb
|
50
57
|
- lib/geocoder/lookups/freegeoip.rb
|
51
58
|
- lib/geocoder/lookups/geocoder_ca.rb
|
52
59
|
- lib/geocoder/lookups/geocoder_us.rb
|
60
|
+
- lib/geocoder/lookups/geocodio.rb
|
53
61
|
- lib/geocoder/lookups/google.rb
|
54
62
|
- lib/geocoder/lookups/google_premier.rb
|
63
|
+
- lib/geocoder/lookups/here.rb
|
55
64
|
- lib/geocoder/lookups/mapquest.rb
|
56
65
|
- lib/geocoder/lookups/maxmind.rb
|
66
|
+
- lib/geocoder/lookups/maxmind_local.rb
|
57
67
|
- lib/geocoder/lookups/nominatim.rb
|
58
68
|
- lib/geocoder/lookups/ovi.rb
|
69
|
+
- lib/geocoder/lookups/smarty_streets.rb
|
59
70
|
- lib/geocoder/lookups/test.rb
|
60
71
|
- lib/geocoder/lookups/yahoo.rb
|
61
72
|
- lib/geocoder/lookups/yandex.rb
|
@@ -68,19 +79,25 @@ files:
|
|
68
79
|
- lib/geocoder/railtie.rb
|
69
80
|
- lib/geocoder/request.rb
|
70
81
|
- lib/geocoder/results/baidu.rb
|
82
|
+
- lib/geocoder/results/baidu_ip.rb
|
71
83
|
- lib/geocoder/results/base.rb
|
72
84
|
- lib/geocoder/results/bing.rb
|
85
|
+
- lib/geocoder/results/cloudmade.rb
|
73
86
|
- lib/geocoder/results/dstk.rb
|
74
87
|
- lib/geocoder/results/esri.rb
|
75
88
|
- lib/geocoder/results/freegeoip.rb
|
76
89
|
- lib/geocoder/results/geocoder_ca.rb
|
77
90
|
- lib/geocoder/results/geocoder_us.rb
|
91
|
+
- lib/geocoder/results/geocodio.rb
|
78
92
|
- lib/geocoder/results/google.rb
|
79
93
|
- lib/geocoder/results/google_premier.rb
|
94
|
+
- lib/geocoder/results/here.rb
|
80
95
|
- lib/geocoder/results/mapquest.rb
|
81
96
|
- lib/geocoder/results/maxmind.rb
|
97
|
+
- lib/geocoder/results/maxmind_local.rb
|
82
98
|
- lib/geocoder/results/nominatim.rb
|
83
99
|
- lib/geocoder/results/ovi.rb
|
100
|
+
- lib/geocoder/results/smarty_streets.rb
|
84
101
|
- lib/geocoder/results/test.rb
|
85
102
|
- lib/geocoder/results/yahoo.rb
|
86
103
|
- lib/geocoder/results/yandex.rb
|
@@ -92,15 +109,14 @@ files:
|
|
92
109
|
- lib/geocoder/stores/mongoid.rb
|
93
110
|
- lib/geocoder/version.rb
|
94
111
|
- lib/hash_recursive_merge.rb
|
112
|
+
- lib/maxmind_database.rb
|
95
113
|
- lib/oauth_util.rb
|
96
114
|
- lib/tasks/geocoder.rake
|
97
|
-
-
|
98
|
-
- test/cache_test.rb
|
99
|
-
- test/calculations_test.rb
|
100
|
-
- test/configuration_test.rb
|
101
|
-
- test/custom_block_test.rb
|
102
|
-
- test/error_handling_test.rb
|
115
|
+
- lib/tasks/maxmind.rake
|
103
116
|
- test/fixtures/baidu_invalid_key
|
117
|
+
- test/fixtures/baidu_ip_202_198_16_3
|
118
|
+
- test/fixtures/baidu_ip_invalid_key
|
119
|
+
- test/fixtures/baidu_ip_no_results
|
104
120
|
- test/fixtures/baidu_no_results
|
105
121
|
- test/fixtures/baidu_reverse
|
106
122
|
- test/fixtures/baidu_shanghai_pearl_tower
|
@@ -108,6 +124,9 @@ files:
|
|
108
124
|
- test/fixtures/bing_madison_square_garden
|
109
125
|
- test/fixtures/bing_no_results
|
110
126
|
- test/fixtures/bing_reverse
|
127
|
+
- test/fixtures/cloudmade_invalid_key
|
128
|
+
- test/fixtures/cloudmade_madison_square_garden
|
129
|
+
- test/fixtures/cloudmade_no_results
|
111
130
|
- test/fixtures/esri_madison_square_garden
|
112
131
|
- test/fixtures/esri_no_results
|
113
132
|
- test/fixtures/esri_reverse
|
@@ -118,12 +137,19 @@ files:
|
|
118
137
|
- test/fixtures/geocoder_ca_reverse
|
119
138
|
- test/fixtures/geocoder_us_madison_square_garden
|
120
139
|
- test/fixtures/geocoder_us_no_results
|
140
|
+
- test/fixtures/geocodio_1101_pennsylvania_ave
|
141
|
+
- test/fixtures/geocodio_bad_api_key
|
142
|
+
- test/fixtures/geocodio_invalid
|
143
|
+
- test/fixtures/geocodio_no_results
|
144
|
+
- test/fixtures/geocodio_over_query_limit
|
121
145
|
- test/fixtures/google_garbage
|
122
146
|
- test/fixtures/google_madison_square_garden
|
123
147
|
- test/fixtures/google_no_city_data
|
124
148
|
- test/fixtures/google_no_locality
|
125
149
|
- test/fixtures/google_no_results
|
126
150
|
- test/fixtures/google_over_limit
|
151
|
+
- test/fixtures/here_madison_square_garden
|
152
|
+
- test/fixtures/here_no_results
|
127
153
|
- test/fixtures/mapquest_error
|
128
154
|
- test/fixtures/mapquest_invalid_api_key
|
129
155
|
- test/fixtures/mapquest_invalid_request
|
@@ -138,33 +164,60 @@ files:
|
|
138
164
|
- test/fixtures/maxmind_no_results
|
139
165
|
- test/fixtures/nominatim_madison_square_garden
|
140
166
|
- test/fixtures/nominatim_no_results
|
167
|
+
- test/fixtures/nominatim_over_limit
|
141
168
|
- test/fixtures/ovi_madison_square_garden
|
142
169
|
- test/fixtures/ovi_no_results
|
170
|
+
- test/fixtures/smarty_streets_11211
|
171
|
+
- test/fixtures/smarty_streets_madison_square_garden
|
172
|
+
- test/fixtures/smarty_streets_no_results
|
143
173
|
- test/fixtures/yahoo_error
|
144
174
|
- test/fixtures/yahoo_invalid_key
|
145
175
|
- test/fixtures/yahoo_madison_square_garden
|
146
176
|
- test/fixtures/yahoo_no_results
|
147
177
|
- test/fixtures/yahoo_over_limit
|
178
|
+
- test/fixtures/yandex_canada_rue_dupuis_14
|
148
179
|
- test/fixtures/yandex_invalid_key
|
149
180
|
- test/fixtures/yandex_kremlin
|
181
|
+
- test/fixtures/yandex_new_york
|
150
182
|
- test/fixtures/yandex_no_city_and_town
|
151
183
|
- test/fixtures/yandex_no_results
|
152
|
-
- test/
|
153
|
-
- test/https_test.rb
|
154
|
-
- test/integration/smoke_test.rb
|
155
|
-
- test/lookup_test.rb
|
156
|
-
- test/method_aliases_test.rb
|
157
|
-
- test/mongoid_test.rb
|
184
|
+
- test/integration/http_client_test.rb
|
158
185
|
- test/mongoid_test_helper.rb
|
159
|
-
- test/near_test.rb
|
160
|
-
- test/oauth_util_test.rb
|
161
|
-
- test/proxy_test.rb
|
162
|
-
- test/query_test.rb
|
163
|
-
- test/request_test.rb
|
164
|
-
- test/result_test.rb
|
165
|
-
- test/services_test.rb
|
166
186
|
- test/test_helper.rb
|
167
|
-
- test/
|
187
|
+
- test/unit/active_record_test.rb
|
188
|
+
- test/unit/cache_test.rb
|
189
|
+
- test/unit/calculations_test.rb
|
190
|
+
- test/unit/configuration_test.rb
|
191
|
+
- test/unit/error_handling_test.rb
|
192
|
+
- test/unit/geocoder_test.rb
|
193
|
+
- test/unit/https_test.rb
|
194
|
+
- test/unit/ip_address_test.rb
|
195
|
+
- test/unit/lookup_test.rb
|
196
|
+
- test/unit/lookups/bing_test.rb
|
197
|
+
- test/unit/lookups/dstk_test.rb
|
198
|
+
- test/unit/lookups/esri_test.rb
|
199
|
+
- test/unit/lookups/freegeoip_test.rb
|
200
|
+
- test/unit/lookups/geocoder_ca_test.rb
|
201
|
+
- test/unit/lookups/geocodio_test.rb
|
202
|
+
- test/unit/lookups/google_premier_test.rb
|
203
|
+
- test/unit/lookups/google_test.rb
|
204
|
+
- test/unit/lookups/mapquest_test.rb
|
205
|
+
- test/unit/lookups/maxmind_local_test.rb
|
206
|
+
- test/unit/lookups/maxmind_test.rb
|
207
|
+
- test/unit/lookups/nominatim_test.rb
|
208
|
+
- test/unit/lookups/smarty_streets_test.rb
|
209
|
+
- test/unit/lookups/yahoo_test.rb
|
210
|
+
- test/unit/method_aliases_test.rb
|
211
|
+
- test/unit/model_test.rb
|
212
|
+
- test/unit/mongoid_test.rb
|
213
|
+
- test/unit/near_test.rb
|
214
|
+
- test/unit/oauth_util_test.rb
|
215
|
+
- test/unit/proxy_test.rb
|
216
|
+
- test/unit/query_test.rb
|
217
|
+
- test/unit/rake_task_test.rb
|
218
|
+
- test/unit/request_test.rb
|
219
|
+
- test/unit/result_test.rb
|
220
|
+
- test/unit/test_mode_test.rb
|
168
221
|
homepage: http://www.rubygeocoder.com
|
169
222
|
licenses: []
|
170
223
|
metadata: {}
|
@@ -174,17 +227,17 @@ require_paths:
|
|
174
227
|
- lib
|
175
228
|
required_ruby_version: !ruby/object:Gem::Requirement
|
176
229
|
requirements:
|
177
|
-
- -
|
230
|
+
- - ">="
|
178
231
|
- !ruby/object:Gem::Version
|
179
232
|
version: '0'
|
180
233
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
234
|
requirements:
|
182
|
-
- -
|
235
|
+
- - ">="
|
183
236
|
- !ruby/object:Gem::Version
|
184
237
|
version: '0'
|
185
238
|
requirements: []
|
186
239
|
rubyforge_project:
|
187
|
-
rubygems_version: 2.
|
240
|
+
rubygems_version: 2.2.2
|
188
241
|
signing_key:
|
189
242
|
specification_version: 4
|
190
243
|
summary: Complete geocoding solution for Ruby.
|