kennel 1.27.0 → 1.27.1
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/models/dash.rb +10 -4
- data/lib/kennel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 783c82a351d8f2efeb80dead1ba4fd62ac1676caa8879becd5d26e77e921309a
|
|
4
|
+
data.tar.gz: 47774b5a066f823b369253cbe7c0cc95b1bd74889551fcaf6d6f7d684ca59c8d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 034075071310f9d17fe75e5ca5a975fb6a9334d6b6ddbc3ecf571e645025260bac3deac3eb8a662ab5aea06a9857fead77f0a9a2246d942d057ee0946bc18da8
|
|
7
|
+
data.tar.gz: 0ef832236e352c1b170347ceef4e6df5c4476730eaf4f7b0b3531e0f208349006edf2063e9191a0a93d6b92c0974ff26a63a62a01557632b83a2d0bce0a9b14b
|
data/lib/kennel/models/dash.rb
CHANGED
|
@@ -6,7 +6,7 @@ module Kennel
|
|
|
6
6
|
include OptionalValidations
|
|
7
7
|
|
|
8
8
|
API_LIST_INCOMPLETE = true
|
|
9
|
-
SUPPORTED_GRAPH_OPTIONS = [:events, :markers].freeze
|
|
9
|
+
SUPPORTED_GRAPH_OPTIONS = [:events, :markers, :precision].freeze
|
|
10
10
|
READONLY_ATTRIBUTES = (Base::READONLY_ATTRIBUTES + [:resource, :created_by, :read_only]).freeze
|
|
11
11
|
DEFINITION_DEFAULTS = { autoscale: true }.freeze
|
|
12
12
|
DASH_DEFAULTS = { template_variables: [] }.freeze
|
|
@@ -50,7 +50,9 @@ module Kennel
|
|
|
50
50
|
def self.normalize(expected, actual)
|
|
51
51
|
super
|
|
52
52
|
|
|
53
|
+
actual[:template_variables] ||= [] # is nil when it never had template variables
|
|
53
54
|
ignore_default expected, actual, DASH_DEFAULTS
|
|
55
|
+
|
|
54
56
|
(actual[:graphs] || {}).each do |g|
|
|
55
57
|
g[:definition].delete(:status)
|
|
56
58
|
end
|
|
@@ -90,21 +92,25 @@ module Kennel
|
|
|
90
92
|
end
|
|
91
93
|
|
|
92
94
|
def render_template_variables
|
|
93
|
-
template_variables.map do |v|
|
|
95
|
+
(template_variables || []).map do |v|
|
|
94
96
|
v.is_a?(String) ? { default: "*", prefix: v, name: v } : v
|
|
95
97
|
end
|
|
96
98
|
end
|
|
97
99
|
|
|
98
100
|
def render_graphs
|
|
99
101
|
definitions.map do |title, viz, type, queries, options = {}, ignored = nil|
|
|
100
|
-
if ignored || (!title || !viz || !
|
|
102
|
+
if ignored || (!title || !viz || !queries || !options.is_a?(Hash))
|
|
101
103
|
raise ArgumentError, "Expected exactly 5 arguments for each definition (title, viz, type, queries, options)"
|
|
102
104
|
end
|
|
103
105
|
if options.each_key.any? { |k| !SUPPORTED_GRAPH_OPTIONS.include?(k) }
|
|
104
106
|
raise ArgumentError, "Supported options are: #{SUPPORTED_GRAPH_OPTIONS.map(&:inspect).join(", ")}"
|
|
105
107
|
end
|
|
106
108
|
|
|
107
|
-
requests = Array(queries).map
|
|
109
|
+
requests = Array(queries).map do |q|
|
|
110
|
+
request = { q: q }
|
|
111
|
+
request[:type] = type if type
|
|
112
|
+
request
|
|
113
|
+
end
|
|
108
114
|
graph = { title: title, definition: { viz: viz, requests: requests } }
|
|
109
115
|
SUPPORTED_GRAPH_OPTIONS.each do |key|
|
|
110
116
|
graph[:definition][key] = options[key] if options[key]
|
data/lib/kennel/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kennel
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.27.
|
|
4
|
+
version: 1.27.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Grosser
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-12-
|
|
11
|
+
date: 2018-12-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|