kennel 1.27.1 → 1.27.2
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 +11 -0
- 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: 598e7e7bb22b0f94c1fee3ad74966419205919e9d1f5abcd78e1f6b0ce7be1bd
|
4
|
+
data.tar.gz: bf942537774eeae20519920d2e8c14b2734cbed8a8f7f2a3ca50964b4340207e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9665c3cfdcc60c0d54ae4abd840fda41d7d31ed0e5cfa70532bee8f2b94640d9fdb5a33c8553b076b88869e81192e370cee38f318df5377dcc803859816cc97
|
7
|
+
data.tar.gz: eeb28641ceb49f8281f3cfaa84049e6845d6f8aef77c503575d31a714dc7dc7bc6be86640d13c3c1bfb0101de60e4eb5805a1c37da087a3ae2b391db15e632ec
|
data/lib/kennel/models/dash.rb
CHANGED
@@ -99,6 +99,7 @@ module Kennel
|
|
99
99
|
|
100
100
|
def render_graphs
|
101
101
|
definitions.map do |title, viz, type, queries, options = {}, ignored = nil|
|
102
|
+
# validate inputs
|
102
103
|
if ignored || (!title || !viz || !queries || !options.is_a?(Hash))
|
103
104
|
raise ArgumentError, "Expected exactly 5 arguments for each definition (title, viz, type, queries, options)"
|
104
105
|
end
|
@@ -106,15 +107,25 @@ module Kennel
|
|
106
107
|
raise ArgumentError, "Supported options are: #{SUPPORTED_GRAPH_OPTIONS.map(&:inspect).join(", ")}"
|
107
108
|
end
|
108
109
|
|
110
|
+
# build graph
|
109
111
|
requests = Array(queries).map do |q|
|
110
112
|
request = { q: q }
|
111
113
|
request[:type] = type if type
|
112
114
|
request
|
113
115
|
end
|
116
|
+
|
114
117
|
graph = { title: title, definition: { viz: viz, requests: requests } }
|
118
|
+
|
119
|
+
# whitelist options that can be passed in, so we are flexible in the future
|
115
120
|
SUPPORTED_GRAPH_OPTIONS.each do |key|
|
116
121
|
graph[:definition][key] = options[key] if options[key]
|
117
122
|
end
|
123
|
+
|
124
|
+
# set default values so users do not have to pass them all the time
|
125
|
+
if type == "query_value"
|
126
|
+
graph[:definition][:precision] ||= 2
|
127
|
+
end
|
128
|
+
|
118
129
|
graph
|
119
130
|
end + graphs
|
120
131
|
end
|
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.2
|
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-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|