geokit 1.13.1 → 1.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/ci.yml +22 -0
- data/.hound.yml +1 -1
- data/.rubocop.yml +28 -20
- data/CHANGELOG.md +8 -0
- data/README.markdown +8 -9
- data/Rakefile +1 -1
- data/fixtures/vcr_cassettes/bing_full.yml +1 -1
- data/fixtures/vcr_cassettes/bing_full_au.yml +1 -1
- data/fixtures/vcr_cassettes/bing_full_de.yml +1 -1
- data/fixtures/vcr_cassettes/opencage_reverse_cerdanyola.yml +47 -0
- data/fixtures/vcr_cassettes/test_component_filtering_with_special_characters.yml +126 -0
- data/geokit.gemspec +4 -5
- data/lib/geokit/geo_loc.rb +8 -6
- data/lib/geokit/geocoders/bing.rb +1 -1
- data/lib/geokit/geocoders/ca_geocoder.rb +2 -1
- data/lib/geokit/geocoders/fcc.rb +1 -0
- data/lib/geokit/geocoders/google.rb +3 -1
- data/lib/geokit/geocoders/opencage.rb +4 -0
- data/lib/geokit/geocoders/openstreetmap.rb +1 -0
- data/lib/geokit/geocoders/yahoo.rb +4 -1
- data/lib/geokit/geocoders/yandex.rb +1 -1
- data/lib/geokit/geocoders.rb +12 -2
- data/lib/geokit/mappable.rb +13 -6
- data/lib/geokit/multi_geocoder.rb +1 -0
- data/lib/geokit/version.rb +1 -1
- data/test/coverage_loader.rb +1 -1
- data/test/helper.rb +1 -1
- data/test/test_bing_geocoder.rb +4 -4
- data/test/test_ca_geocoder.rb +8 -0
- data/test/test_fcc_geocoder.rb +1 -0
- data/test/{test_geoloc.rb → test_geo_loc.rb} +1 -0
- data/test/test_google_geocoder.rb +15 -1
- data/test/test_ip_api_geocoder.rb +1 -1
- data/test/test_ipstack_geocoder.rb +1 -1
- data/test/test_multi_geocoder.rb +7 -4
- data/test/test_multi_ip_geocoder.rb +3 -1
- data/test/test_opencage_geocoder.rb +34 -3
- data/test/test_openstreetmap_geocoder.rb +2 -0
- data/test/test_yandex_geocoder.rb +5 -5
- metadata +16 -19
- data/.travis.yml +0 -12
- data/fixtures/vcr_cassettes/free_geo_ip_geocode.yml +0 -36
- data/lib/geokit/geocoders/free_geo_ip.rb +0 -36
- data/test/test_free_geo_ip_geocoder.rb +0 -21
@@ -1,21 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), 'helper')
|
2
|
-
|
3
|
-
class FreeGeoIpGeocoderTest < BaseGeocoderTest #:nodoc: all
|
4
|
-
def setup
|
5
|
-
super
|
6
|
-
@ip = '74.125.237.209'
|
7
|
-
end
|
8
|
-
|
9
|
-
def assert_url(expected_url)
|
10
|
-
assert_equal expected_url, TestHelper.last_url.gsub(/&oauth_[a-z_]+=[a-zA-Z0-9\-. %]+/, '').gsub('%20', '+')
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_free_geo_ip_geocode
|
14
|
-
url = "http://freegeoip.net/xml/#{@ip}"
|
15
|
-
res = geocode(@ip, :free_geo_ip_geocode)
|
16
|
-
assert_url url
|
17
|
-
assert_equal res.city, 'Mountain View'
|
18
|
-
assert_equal res.state, 'CA'
|
19
|
-
assert_equal res.country_code, 'US'
|
20
|
-
end
|
21
|
-
end
|