graticule 2.6.0 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.txt +3 -0
- data/lib/graticule/geocoder/google.rb +4 -4
- data/lib/graticule/version.rb +1 -1
- data/test/graticule/geocoder/google_signed_test.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65057608d579147a37338bae8b605a84056b5c2b
|
4
|
+
data.tar.gz: 6e5e436540bb10726f7c0f543d59d38e02bc804c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79e097684736d54958dbf7264ff3632640513f477624e6fd261223c1ce93464aab32513e1f4fcb43c333e51463b6aded4a33933593f193cd57141c580c2f6672
|
7
|
+
data.tar.gz: 29e3fe53bf1b7297685c591fda096b1ce93c753253338d424785ea43dcfa2750eb67918b0da0d517415f5887b433841a47e7dec96aac6926d61fa37927c59969
|
data/CHANGELOG.txt
CHANGED
@@ -17,12 +17,12 @@ module Graticule #:nodoc:
|
|
17
17
|
def initialize(key=nil, client_id=nil)
|
18
18
|
@key = key
|
19
19
|
@client_id = client_id
|
20
|
-
@url = URI.parse '
|
20
|
+
@url = URI.parse 'https://maps.googleapis.com/maps/api/geocode/json'
|
21
21
|
end
|
22
22
|
|
23
23
|
# Locates +address+ returning a Location
|
24
24
|
def locate(address)
|
25
|
-
get :address => address.is_a?(String) ? address : location_from_params(address).to_s
|
25
|
+
get :key => @key, :address => address.is_a?(String) ? address : location_from_params(address).to_s
|
26
26
|
end
|
27
27
|
|
28
28
|
private
|
@@ -45,7 +45,7 @@ module Graticule #:nodoc:
|
|
45
45
|
when "route"
|
46
46
|
@route = component["short_name"]
|
47
47
|
when "locality", "sublocality"
|
48
|
-
@locality = component["long_name"]
|
48
|
+
@locality = component["long_name"]
|
49
49
|
when "administrative_area_level_1"
|
50
50
|
@region = component["short_name"]
|
51
51
|
when "country"
|
@@ -139,7 +139,7 @@ module Graticule #:nodoc:
|
|
139
139
|
# the url as required by v3 of the library:
|
140
140
|
#
|
141
141
|
# https://developers.google.com/maps/documentation/business/webservices#digital_signatures
|
142
|
-
#
|
142
|
+
#
|
143
143
|
def make_url(params) #:nodoc:
|
144
144
|
if @key && @client_id
|
145
145
|
url = super params.merge(:sensor => false, :client => @client_id)
|
data/lib/graticule/version.rb
CHANGED
@@ -5,14 +5,14 @@ class GoogleTest < Test::Unit::TestCase
|
|
5
5
|
def test_url_is_signed_for_business_accounts
|
6
6
|
geocoder = Graticule.service(:google).new("e7-fake-account-R911GuLecpVqA=", 'gme-example')
|
7
7
|
url = geocoder.send :make_url, :address => 'New York'
|
8
|
-
expected = "
|
8
|
+
expected = "https://maps.googleapis.com/maps/api/geocode/json?address=New%20York&client=gme-example&sensor=false&signature=EJNTEh9SqstO1FLcbFsQ0aJrWHA="
|
9
9
|
assert_equal expected, url.to_s
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_url_is_not_signed_for_normal_accounts
|
13
13
|
geocoder = Graticule.service(:google).new()
|
14
14
|
url = geocoder.send :make_url, :address => 'New York'
|
15
|
-
expected = "
|
15
|
+
expected = "https://maps.googleapis.com/maps/api/geocode/json?address=New%20York&sensor=false"
|
16
16
|
assert_equal expected, url.to_s
|
17
17
|
end
|
18
18
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graticule
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Keepers
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2018-
|
14
|
+
date: 2018-10-19 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
190
|
version: '0'
|
191
191
|
requirements: []
|
192
192
|
rubyforge_project:
|
193
|
-
rubygems_version: 2.6.
|
193
|
+
rubygems_version: 2.6.13
|
194
194
|
signing_key:
|
195
195
|
specification_version: 4
|
196
196
|
summary: API for using all the popular geocoding services
|