diff --git a/README.md b/README.md index c14037ab7c555fe020ecece08051026a3a5a8131..647960b95635c59b0803df32e253c838c45222b8 100644 --- a/README.md +++ b/README.md @@ -457,7 +457,7 @@ The [Google Places Details API](https://developers.google.com/places/documentati * **Terms of Service**: http://wiki.openstreetmap.org/wiki/Nominatim_usage_policy * **Limitations**: Please limit request rate to 1 per second and include your contact information in User-Agent headers (eg: `Geocoder.configure(:http_headers => { "User-Agent" => "your contact info" })`). [Data licensed under Open Database License (ODbL) (you must provide attribution).](http://www.openstreetmap.org/copyright) -#### LocationIQ (`:locationiq`) +#### LocationIQ (`:location_iq`) * **API key**: required * **Quota**: 6 request/second (30k req/day), then ability to purchase more diff --git a/lib/geocoder/lookup.rb b/lib/geocoder/lookup.rb index 6cac49b1bbc8add5e523fbdb6276a6dbe531ff2b..b704d7cd1d50540a3525d7629a8294e96590af6a 100644 --- a/lib/geocoder/lookup.rb +++ b/lib/geocoder/lookup.rb @@ -23,7 +23,7 @@ module Geocoder # def street_services @street_services ||= [ - :locationiq, + :location_iq, :dstk, :esri, :google, diff --git a/lib/geocoder/lookups/locationiq.rb b/lib/geocoder/lookups/location_iq.rb similarity index 88% rename from lib/geocoder/lookups/locationiq.rb rename to lib/geocoder/lookups/location_iq.rb index a29581c454aff306bcda89d662d89396cfd3b0c1..d362c1b35735b8b1d43e43d819141e1d14220a2c 100644 --- a/lib/geocoder/lookups/locationiq.rb +++ b/lib/geocoder/lookups/location_iq.rb @@ -1,10 +1,10 @@ require 'geocoder/lookups/nominatim' -require "geocoder/results/locationiq" +require "geocoder/results/location_iq" module Geocoder::Lookup - class Locationiq < Nominatim + class LocationIq < Nominatim def name - "Locationiq" + "LocationIq" end def required_api_key_parts diff --git a/lib/geocoder/results/locationiq.rb b/lib/geocoder/results/location_iq.rb similarity index 69% rename from lib/geocoder/results/locationiq.rb rename to lib/geocoder/results/location_iq.rb index a06ea85ff06bf2852ec44940a008722b133947fd..7265212c95b96be55bb9d56614c3c429e6a8253c 100644 --- a/lib/geocoder/results/locationiq.rb +++ b/lib/geocoder/results/location_iq.rb @@ -1,6 +1,6 @@ require 'geocoder/results/nominatim' module Geocoder::Result - class Locationiq < Nominatim + class LocationIq < Nominatim end end \ No newline at end of file diff --git a/test/fixtures/locationiq_invalid_api_key b/test/fixtures/location_iq_invalid_api_key similarity index 100% rename from test/fixtures/locationiq_invalid_api_key rename to test/fixtures/location_iq_invalid_api_key diff --git a/test/fixtures/locationiq_madison_square_garden b/test/fixtures/location_iq_madison_square_garden similarity index 100% rename from test/fixtures/locationiq_madison_square_garden rename to test/fixtures/location_iq_madison_square_garden diff --git a/test/fixtures/locationiq_no_results b/test/fixtures/location_iq_no_results similarity index 100% rename from test/fixtures/locationiq_no_results rename to test/fixtures/location_iq_no_results diff --git a/test/fixtures/locationiq_over_limit b/test/fixtures/location_iq_over_limit similarity index 100% rename from test/fixtures/locationiq_over_limit rename to test/fixtures/location_iq_over_limit diff --git a/test/test_helper.rb b/test/test_helper.rb index 9051042b0033d18bdb7d1f99a3f5cd89b210c623..00d6801542c7099d817bb6130f9f856aa205e069 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -176,11 +176,11 @@ module Geocoder end end - require 'geocoder/lookups/locationiq' - class Locationiq + require 'geocoder/lookups/location_iq' + class LocationIq private def fixture_prefix - "locationiq" + "location_iq" end end diff --git a/test/unit/lookups/locationiq_test.rb b/test/unit/lookups/location_iq_test.rb similarity index 81% rename from test/unit/lookups/locationiq_test.rb rename to test/unit/lookups/location_iq_test.rb index 05fee245f1e68ca00231ad10d25bd928cce7d628..893975d17b7674252b8f16a57e4190a88ebbe04c 100644 --- a/test/unit/lookups/locationiq_test.rb +++ b/test/unit/lookups/location_iq_test.rb @@ -5,12 +5,12 @@ require 'test_helper' class LocationIq < NominatimTest def setup - Geocoder.configure(lookup: :locationiq) - set_api_key!(:locationiq) + Geocoder.configure(lookup: :location_iq) + set_api_key!(:location_iq) end def test_url_contains_api_key - Geocoder.configure(locationiq: {api_key: "abc123"}) + Geocoder.configure(location_iq: {api_key: "abc123"}) query = Geocoder::Query.new("Leadville, CO") assert_equal "http://locationiq.org/v1/search.php?key=abc123&accept-language=en&addressdetails=1&format=json&q=Leadville%2C+CO", query.url end