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 +4 -4
- data/lib/kennel/api.rb +3 -1
- data/lib/kennel/syncer.rb +2 -8
- data/lib/kennel/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6b4a0efd1cc9562ad3fe039254ba48b197a392556105b3d56f66985105a8806
|
4
|
+
data.tar.gz: 8277eccfa9f48eec9ee8fe6dcf516fd4ad1e36c5760ec850dc4d60d71714ddcd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 405531a24f9f801592c687f4f2a2ca448785b8907e549eafde3d7ea02935db63aa010d955d0f0d86d50f75ae1f42344fcf5c7904500e5e6d049ba9cbb1b6483a
|
7
|
+
data.tar.gz: 6c1d454d24dd9b0fc313e0a208a52c2a8efc77258171aefc4df8a115beca66d681925095a4f4ac544792452d7e2e5c09557350a72f467cc38fcbfbceb699350d
|
data/lib/kennel/api.rb
CHANGED
@@ -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
|
|
data/lib/kennel/syncer.rb
CHANGED
@@ -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
|
-
#
|
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
|
-
|
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)
|
data/lib/kennel/version.rb
CHANGED