apidae 0.1.5 → 0.1.6

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: 92ec7ce5a586513ed8c0ba161d3d9484555f9668
4
- data.tar.gz: f000d972759069c7c6a1ad8eb6a7048c728212f6
3
+ metadata.gz: 87cd9a41caead065a805e975fbe7fc5f4227cfdf
4
+ data.tar.gz: bf3ac2b75b2e4a2ee96d5a0a0298ce105460afc4
5
5
  SHA512:
6
- metadata.gz: ea85265ae673330192ee48320ceb138831144be753063290280ee37f2dd87435c09485a21c62fff2977c3e091a376e265e8ed5be2f4a8af4969d3048e960e4f9
7
- data.tar.gz: f235d3f3cae3c8f1cfffc09bedae71e7592849baccc240077bd033633453e43d19f6797f356bf646344d5afcb78b4fe562000949aef9937160dbcdea533c31ff
6
+ metadata.gz: 16697f8ea3872f0b10db80aa23df7f7e475945b56787b131d89875fdb31c4a340729376f35160fbc715af0f2da68a862c3336334a8e34fb699d3ea6fbea2f098
7
+ data.tar.gz: 89856a0a71ddf723f2a8dffd3631d9950d93523e406c63a1032bf1fdd761fb5f6310aab7440f863dbdd6ceb7b0f7803d7e8cdf00d0e24b457ef925b184f253c2
@@ -45,7 +45,7 @@ module Apidae
45
45
  e.update(status: Export::COMPLETE)
46
46
  rescue Exception => ex
47
47
  logger.error("Failed to import export file : #{e.file_url}")
48
- logger.error("Error is : #{ex}")
48
+ logger.error("Error is : #{ex} \n#{ex.backtrace.join("\n") unless ex.backtrace.blank?}")
49
49
  success = false
50
50
  end
51
51
  end
@@ -112,24 +112,30 @@ module Apidae
112
112
 
113
113
  def self.address(address_hash)
114
114
  computed_address = []
115
- computed_address << address_hash[:adresse1] unless address_hash[:adresse1].blank?
116
- computed_address << address_hash[:adresse2] unless address_hash[:adresse2].blank?
117
- computed_address << address_hash[:adresse3] unless address_hash[:adresse3].blank?
115
+ unless address_hash.blank?
116
+ computed_address << address_hash[:adresse1] unless address_hash[:adresse1].blank?
117
+ computed_address << address_hash[:adresse2] unless address_hash[:adresse2].blank?
118
+ computed_address << address_hash[:adresse3] unless address_hash[:adresse3].blank?
119
+ end
118
120
  {address_fields: computed_address}
119
121
  end
120
122
 
121
- def self.town(address_hash)
122
- address_hash[:commune] ? Town.find_by_apidae_id(address_hash[:commune][:id]) : nil
123
+ def self.town(address_hash = {})
124
+ (!address_hash.blank? && address_hash[:commune]) ? Town.find_by_apidae_id(address_hash[:commune][:id]) : nil
123
125
  end
124
126
 
125
127
  def self.latitude(location_hash)
126
- geoloc_details = location_hash[:geolocalisation]
127
- (geoloc_details && geoloc_details[:valide] && geoloc_details[:geoJson]) ? geoloc_details[:geoJson][:coordinates][1] : nil
128
+ unless location_hash.blank?
129
+ geoloc_details = location_hash[:geolocalisation]
130
+ (geoloc_details && geoloc_details[:valide] && geoloc_details[:geoJson]) ? geoloc_details[:geoJson][:coordinates][1] : nil
131
+ end
128
132
  end
129
133
 
130
- def self.longitude(location_hash)
131
- geoloc_details = location_hash[:geolocalisation]
132
- (geoloc_details && geoloc_details[:valide] && geoloc_details[:geoJson]) ? geoloc_details[:geoJson][:coordinates][0] : nil
134
+ def self.longitude(location_hash = {})
135
+ unless location_hash.blank?
136
+ geoloc_details = location_hash[:geolocalisation]
137
+ (geoloc_details && geoloc_details[:valide] && geoloc_details[:geoJson]) ? geoloc_details[:geoJson][:coordinates][0] : nil
138
+ end
133
139
  end
134
140
 
135
141
  def self.openings(openings_hash)
@@ -1,3 +1,3 @@
1
1
  module Apidae
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apidae
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Baptiste Vilain
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  version: '0'
207
207
  requirements: []
208
208
  rubyforge_project:
209
- rubygems_version: 2.6.13
209
+ rubygems_version: 2.5.1
210
210
  signing_key:
211
211
  specification_version: 4
212
212
  summary: A Ruby on Rails engine for projects that involve Apidae data