kennel 1.59.2 → 1.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da2bef045b7b3b70aaf46ddf1254d31ea43fb0821276a05d08ffe1027d7dcd60
4
- data.tar.gz: ccdcb485de98385ecb58d2aa379550de5c44054b822232b36a678f034593629d
3
+ metadata.gz: f6b4a0efd1cc9562ad3fe039254ba48b197a392556105b3d56f66985105a8806
4
+ data.tar.gz: 8277eccfa9f48eec9ee8fe6dcf516fd4ad1e36c5760ec850dc4d60d71714ddcd
5
5
  SHA512:
6
- metadata.gz: 2e4132e556b0eb1a1bf4aaa0a3b7913a1e70f790be3b3226238e6d9d9e2771544b96d665ee668841fd7fa640ac22abd3b2467b91be6d70ca167d01e2af0bd426
7
- data.tar.gz: fda2c3268e6420c106ded560ca5fb59dc97fe783e385d2295588e2cabc3b367f0e1375a48355dbfd4968e19743ebcce60136bd2ba9dc483c7024326abee12828
6
+ metadata.gz: 405531a24f9f801592c687f4f2a2ca448785b8907e549eafde3d7ea02935db63aa010d955d0f0d86d50f75ae1f42344fcf5c7904500e5e6d049ba9cbb1b6483a
7
+ data.tar.gz: 6c1d454d24dd9b0fc313e0a208a52c2a8efc77258171aefc4df8a115beca66d681925095a4f4ac544792452d7e2e5c09557350a72f467cc38fcbfbceb699350d
@@ -27,7 +27,9 @@ module Kennel
27
27
  offset += limit
28
28
  end
29
29
  else
30
- request :get, "/api/v1/#{api_resource}", params: params
30
+ result = request :get, "/api/v1/#{api_resource}", params: params
31
+ result = result.fetch(:dashboards) if api_resource == "dashboard"
32
+ result
31
33
  end
32
34
  end
33
35
 
@@ -38,7 +38,6 @@ module Kennel
38
38
  def update
39
39
  @create.each do |_, e|
40
40
  reply = @api.create e.class.api_resource, e.as_json
41
- reply = unnest(e.class.api_resource, reply)
42
41
  Kennel.out.puts "Created #{e.class.api_resource} #{tracking_id(e.as_json)} #{e.url(reply.fetch(:id))}"
43
42
  end
44
43
 
@@ -101,21 +100,16 @@ module Kennel
101
100
  end
102
101
  end
103
102
 
104
- # Hack to get diff to work until we can mass-fetch definitions
103
+ # Make diff work even though we cannot mass-fetch definitions
105
104
  def fill_details(a, cache)
106
105
  resource = a.fetch(:api_resource)
107
106
  args = [resource, a.fetch(:id)]
108
107
  full = cache.fetch(args, a[:modified] || a.fetch(:modified_at)) do
109
- unnest(resource, @api.show(*args))
108
+ @api.show(*args)
110
109
  end
111
110
  a.merge!(full)
112
111
  end
113
112
 
114
- # dashes are nested, others are not
115
- def unnest(api_resource, result)
116
- result[api_resource.to_sym] || result[:data] || result
117
- end
118
-
119
113
  def details_cache(&block)
120
114
  cache = FileCache.new CACHE_FILE, Kennel::VERSION
121
115
  cache.open(&block)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.59.2"
3
+ VERSION = "1.60.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kennel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.59.2
4
+ version: 1.60.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser