data_kitten 1.3.2 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTg3MWUzZWM3MDJiMjM3YjRjM2NiNGNjMmEyNWQ2ZGI0ZDk4YTYyZg==
4
+ M2ZhMGNkNzFlOWI5NmY5YzU4MDEyZTYzNTZiNzNlM2E1OTgzNTYwMA==
5
5
  data.tar.gz: !binary |-
6
- MTk4YWMxMWRlODZiNmQ0ODQxOTMxMDJhZmZlODFlZDY1MjZlYWZkNQ==
6
+ YjE1NDFhMDE3Mzc1ZmEyOTU5MWE0YmYxNjdmMmMwYmEwYjVhZTFjNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZWM1NTRhZWUwMzg0ZGM4YzhkYmZkNWVjZDI0ZDQ4MDRlMzYzYWFkMWY5NjRi
10
- ODYwOGExM2U3ZmZmZTdlYTQ4ZDYyYWFmMWUxOTI2NDUwMWI1NDRmZThkMWJm
11
- ZWRjNzI5YWQxZDExMmM2Yjg2M2NhNmVlNTMzMDUwMTk3MTAxNTk=
9
+ NDczMTBmYjJiMTVmMWIyYTk3YzNmNWQ5ZTg4ODM1Njc4ZWJiNTZkMzRjYTU4
10
+ MTRhN2FiOTA5YTAzM2YwZGM3NDk2MWU2NGRiZDJlYTViOTgxMGQ2YjljODBi
11
+ MzkyMDhlYWI5MTI1YmZmYTc0YjI0YmM4MzIzNWM3YjVkNGY0YTM=
12
12
  data.tar.gz: !binary |-
13
- ZmJhMzc0MjU3NGExODUwYTczZjVlNWNkMmI5NjgyYjZhZWVhNDA5YjdlZDFi
14
- YTBmNjg2OGJmNzdlMGE1YTU4OTE4YzJhNzc5Mzg3OGI3MzlmYWRkZWIyY2Zl
15
- OTM3NjY3YTNkMWY5YzU1MjRkMDJjZTIzN2MxM2Q3Y2VlYTc2OWM=
13
+ NDNhZjE2YjJlM2Q2MTYyYzkyNmQ5ZGRhYjZkOTM1ZTFmMzNlZTI5ZTM3MWJm
14
+ ZmU5NTcwZjM1ZjgzZmRkYzQxZmQzZjc2MTdlNDgzYWVhZmI2YTdkNGFiNjUw
15
+ MmU5OGY0MDNlMDA1ZGQyMzZlMTUzNTkxZDY2M2U3NWE4ODA1MmE=
@@ -236,6 +236,10 @@ module DataKitten
236
236
 
237
237
  private
238
238
 
239
+ def without_empty_values(h)
240
+ h.reject { |k, v| v.nil? || v.empty? }
241
+ end
242
+
239
243
  def select_extras(group, key)
240
244
  extra = group["extras"][key] rescue ""
241
245
  if extra == ""
@@ -276,12 +280,12 @@ module DataKitten
276
280
  uri = base_uri.merge("api/3/action/organization_show")
277
281
  result = RestClient.get(uri.to_s, params: {id: org['id']})
278
282
  org_data = JSON.parse(result)['result']
279
- extras = CKAN3Hash.new(org_data['extras'], "key", "value")
283
+ extras = CKAN3Hash.new(without_empty_values(org_data['extras']), "key", "value")
280
284
  rescue
281
285
  uri = base_uri.merge("api/rest/group/#{org['id']}")
282
286
  result = RestClient.get(uri.to_s)
283
287
  org_data = JSON.parse(result)
284
- extras = org_data['extras']
288
+ extras = without_empty_values(org_data['extras'])
285
289
  end
286
290
  Agent.new(
287
291
  :name => org_data['title'],
@@ -1,3 +1,3 @@
1
1
  module DataKitten
2
- VERSION = "1.3.2"
2
+ VERSION = "1.3.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_kitten
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Smith