kennel 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- 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: 63bd43d9372d2d92f5123b896583d212f8c30902878a182765610ab0012016fc
|
4
|
+
data.tar.gz: 438a19088b46d37e5738702868373abba331cdf44459841bd07443724cb10416
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 766bdb5f1370bf27a0f560521df0da7c9589b904820676e81f5e4f12f9671baa4719fd0c44aac92df100db0bca59165d11acbcc6a3687c824307a62fbbf198f4
|
7
|
+
data.tar.gz: '07806de1603fadb136e81b5226f006e6efcdc429876b859717b48761dc64d03ed1b1a82447650efa081c114bb2940881d04b97453b69a664831d07faec8745f4'
|
data/lib/kennel/models/dash.rb
CHANGED
@@ -6,6 +6,7 @@ module Kennel
|
|
6
6
|
include OptionalValidations
|
7
7
|
|
8
8
|
API_LIST_INCOMPLETE = true
|
9
|
+
SUPPORTED_GRAPH_OPTIONS = [:events].freeze
|
9
10
|
settings :id, :title, :description, :graphs, :kennel_id, :graphs, :definitions
|
10
11
|
|
11
12
|
defaults(
|
@@ -76,13 +77,18 @@ module Kennel
|
|
76
77
|
end
|
77
78
|
|
78
79
|
def render_graphs
|
79
|
-
all = definitions.map do |title, viz, type, queries, ignored|
|
80
|
-
if ignored || (!title || !viz || !type || !queries)
|
81
|
-
raise ArgumentError, "Expected exactly
|
80
|
+
all = definitions.map do |title, viz, type, queries, options = {}, ignored = nil|
|
81
|
+
if ignored || (!title || !viz || !type || !queries || !options.is_a?(Hash))
|
82
|
+
raise ArgumentError, "Expected exactly 5 arguments for each definition (title, viz, type, queries, options)"
|
83
|
+
end
|
84
|
+
if options.each_key.any? { |k| !SUPPORTED_GRAPH_OPTIONS.include?(k) }
|
85
|
+
raise ArgumentError, "Supported options are: #{SUPPORTED_GRAPH_OPTIONS.map(&:inspect).join(", ")}"
|
82
86
|
end
|
83
87
|
|
84
88
|
requests = Array(queries).map { |q| { q: q, type: type } }
|
85
|
-
{ title: title, definition: { viz: viz, requests: requests } }
|
89
|
+
graph = { title: title, definition: { viz: viz, requests: requests } }
|
90
|
+
graph[:definition][:events] = options[:events] if options[:events]
|
91
|
+
graph
|
86
92
|
end + graphs
|
87
93
|
|
88
94
|
all.each do |g|
|
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.
|
4
|
+
version: 1.6.0
|
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-06-
|
11
|
+
date: 2018-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|