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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4507d1d7aaf3337291a14d4caa161d2b9c66bc1512a27d793c7b37342ac3a2f9
4
- data.tar.gz: 6d85fbcc645f2069e6e5f00c03dab2984a61a1c0651560584bb0a02dbb6aef02
3
+ metadata.gz: 63bd43d9372d2d92f5123b896583d212f8c30902878a182765610ab0012016fc
4
+ data.tar.gz: 438a19088b46d37e5738702868373abba331cdf44459841bd07443724cb10416
5
5
  SHA512:
6
- metadata.gz: 48f54e8ba4d1fabb07daf24d87cdccf9cff0a91001140473a83a6f8127d74e72a86b366d5f8442f93fa7074f8ec26e93d5857002bbd816048740368ece38f2b2
7
- data.tar.gz: bb9a2db2f3e78e0573f01b478b5394c644179d7ef34bf7a3d93430bf80882347b09476414c9eec782406cb84ffc859b9f3b28ff756be175a66febbe98096427b
6
+ metadata.gz: 766bdb5f1370bf27a0f560521df0da7c9589b904820676e81f5e4f12f9671baa4719fd0c44aac92df100db0bca59165d11acbcc6a3687c824307a62fbbf198f4
7
+ data.tar.gz: '07806de1603fadb136e81b5226f006e6efcdc429876b859717b48761dc64d03ed1b1a82447650efa081c114bb2940881d04b97453b69a664831d07faec8745f4'
@@ -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 4 arguments for each definition (title, viz, type, queries)"
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|
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.5.0"
3
+ VERSION = "1.6.0"
4
4
  end
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.5.0
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-04 00:00:00.000000000 Z
11
+ date: 2018-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday