gmaps_geocoding 1.2.2 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5caef1d3551e2745d8f5949e6d1e220afe4d34ed
4
- data.tar.gz: 5d176e55396d2b3b024d8140feed91e518a6b98d
3
+ metadata.gz: b654b588fdf5b34c21ccd55f008d482b2802fc55
4
+ data.tar.gz: f28760fb36c8298650297932ca9399b205b57f71
5
5
  SHA512:
6
- metadata.gz: 9ddc39990ff94582d188af1576fab336ef71b3fb874a4d43a1e3f802e2435fb5b8d8483467552663386c96c98d22ca4d594c7c864fcab7102fdffc088ef4118c
7
- data.tar.gz: 56636d31bdd3b932de7baa32bd4843bd59e4cbd3f83a6b0b7bfc96db7cab04f32919047ae8f7064f108e75bafc7a8dce8238a4d5677360fa13700ef3005d21b2
6
+ metadata.gz: e11a3cda1549a260dc9105cbf68f533b5629add28cdc232e883d3ec70f749b641eeacc1dbb8ce98c967128bb3d03b905ebd7efe4f491c274b3448315d9ce94a1
7
+ data.tar.gz: b97e32244d58048c295b5de15dba31796a43c0ef23ffb38d03113e11e2ca313c25d4c31924fad112e3ad5bf963d99cb1d22cd1fde321731af527b11636d7910c
@@ -1,5 +1,5 @@
1
1
  rvm:
2
2
  - 2.0.0
3
3
  - 2.1.6
4
- - 2.2.3
4
+ - 2.2.4
5
5
  script: bundle exec rake test
@@ -1,4 +1,4 @@
1
- ruby=ruby-2.2.3
1
+ ruby=ruby-2.2.4
2
2
  ruby-gemset=gmaps_geocoding
3
3
  #ruby-gem-install=bundler rake
4
4
  #ruby-bundle-install=true
@@ -1,3 +1,3 @@
1
- require 'gmaps_geocoding/api'
2
- require 'gmaps_geocoding/config'
3
- require 'gmaps_geocoding/version'
1
+ require_relative 'gmaps_geocoding/api'
2
+ require_relative 'gmaps_geocoding/config'
3
+ require_relative 'gmaps_geocoding/version'
@@ -41,16 +41,13 @@ module GmapsGeocoding
41
41
  # result = api.location
42
42
  #
43
43
  def location
44
- if @config.valid?
45
- rest_client = retrieve_geocoding_data
46
- case @config.json_format?
47
- when true
48
- json_to_hash(rest_client)
49
- else
50
- xml_to_hash(rest_client)
51
- end
44
+ fail 'Invalid configuration parameters check the Google Geocoding API documentation'.freeze unless @config.valid?
45
+ rest_client = retrieve_geocoding_data
46
+ case @config.json_format?
47
+ when true
48
+ json_to_hash(rest_client)
52
49
  else
53
- fail 'Invalid configuration parameters check the Google Geocoding API documentation'.freeze
50
+ xml_to_hash(rest_client)
54
51
  end
55
52
  rescue => e
56
53
  @logger.error e
@@ -95,8 +92,8 @@ module GmapsGeocoding
95
92
  tmp_data = data
96
93
  tmp_data = [tmp_data] unless tmp_data.is_a?(Array)
97
94
  tmp_data.each do |d|
98
- result["#{d['geometry']['location_type']}"] = { lng: d['geometry']['location']['lng'].to_f,
99
- lat: d['geometry']['location']['lat'].to_f }
95
+ result[d['geometry']['location_type']] = { lng: d['geometry']['location']['lng'].to_f,
96
+ lat: d['geometry']['location']['lat'].to_f }
100
97
  end
101
98
  result
102
99
  end
@@ -146,15 +143,13 @@ module GmapsGeocoding
146
143
  else
147
144
  result[d.value] = xml_node_to_ruby(d)
148
145
  end
149
- else
150
- if result.include?(d.value)
151
- unless result[d.value].is_a?(Array)
152
- result[d.value] = [result[d.value]]
153
- end
154
- result[d.value] << d.nodes[0]
155
- else
156
- result[d.value] = d.nodes[0]
146
+ elsif result.include?(d.value)
147
+ unless result[d.value].is_a?(Array)
148
+ result[d.value] = [result[d.value]]
157
149
  end
150
+ result[d.value] << d.nodes[0]
151
+ else
152
+ result[d.value] = d.nodes[0]
158
153
  end
159
154
  end
160
155
  result
@@ -1,3 +1,3 @@
1
1
  module GmapsGeocoding
2
- VERSION = '1.2.2'.freeze
2
+ VERSION = '1.3.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gmaps_geocoding
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Kakesa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-02 00:00:00.000000000 Z
11
+ date: 2016-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client