caboose-rets 0.1.196 → 0.1.198

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
  SHA256:
3
- metadata.gz: 5e25407e4d2656292fd7d5d5c8d637dcdfd3731e37caeeff3abcb7c033398358
4
- data.tar.gz: 06bff2e64c850854f62b50a8809ba4be9bad62be3e668f4506dda3308b9c6a40
3
+ metadata.gz: b7031da9a57011b4874427b3a075e8fae1ca69eb7891b11bbbaa86355cc8f6b6
4
+ data.tar.gz: 458bc2ef48b75e7c9818195a486696281ef6b0d24b4ddb52c320f5ba4f37cd82
5
5
  SHA512:
6
- metadata.gz: db10c7885eb8b690b3500975ccb8e0f1dea6e65af88ae5f5a905231dbbb9ce0de648b932ceda6b44b15f71452e02313774bca20ef9cdcf508c3e3da920b5bfb6
7
- data.tar.gz: 82f649967e310399847ab549111ceec69054fc99f518e1b67bb24fd8c83eda587023c14f94d845d5df2e7b235275f0aee531483e9b2da64a234616034602d448
6
+ metadata.gz: 598980b63007e7f7c53201ba3fd124adbe4c809a5a6485bae521cb0d291d88d4bbed771b295a23321217f8fd8ab46d38cb2508826cf4838d11a154cbb028e11b
7
+ data.tar.gz: 75a0ddee7d87b554dc65743c73694756a6a78d2304880549bc27ac6e4fa0161c09c41b96ad4e41e009eb56e1f33b426ea8de490e62b334ac911e89e91c7ffa5b
@@ -448,13 +448,15 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
448
448
 
449
449
  def self.coords_from_address(address)
450
450
  begin
451
- uri = "https://maps.googleapis.com/maps/api/geocode/json?key=AIzaSyB9Wwx7sdWaUnFyLcdQ61NOV7DE2NZkDUE&address=#{address}"
451
+ config = YAML::load(File.open("#{Rails.root}/config/rets_importer.yml"))
452
+ api_key = config[Rails.env]['google_api_key']
453
+ uri = "https://maps.googleapis.com/maps/api/geocode/json?key=#{api_key}&address=#{address}"
452
454
  uri.gsub!(" ", "+")
453
455
  resp = HTTParty.get(uri)
454
456
  json = JSON.parse(resp.body)
455
457
  return json['results'][0]['geometry']['location']
456
458
  rescue
457
- self.log "Error: #{uri}"
459
+ self.log3("Property",nil,"Error with Geocoder API, url: #{uri}")
458
460
  sleep(2)
459
461
  return false
460
462
  end
@@ -362,12 +362,12 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
362
362
 
363
363
  p.latitude = coords['lat'].to_f
364
364
  p.longitude = coords['lng'].to_f
365
- p.save
365
+ p.save
366
366
  end
367
367
 
368
368
  def self.coords_from_address(address)
369
369
  begin
370
- uri = "https://maps.googleapis.com/maps/api/geocode/json?key=AIzaSyB9Wwx7sdWaUnFyLcdQ61NOV7DE2NZkDUE&address=#{address}"
370
+ uri = "https://maps.googleapis.com/maps/api/geocode/json?key=12345&address=#{address}"
371
371
  uri.gsub!(" ", "+")
372
372
  resp = HTTParty.get(uri)
373
373
  json = JSON.parse(resp.body)
@@ -1,3 +1,3 @@
1
1
  module CabooseRets
2
- VERSION = '0.1.196'
2
+ VERSION = '0.1.198'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-rets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.196
4
+ version: 0.1.198
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry