kennel 1.57.2 → 1.58.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: edff257eab30fa336ef8a067c7d02a5c4cfdb919b2381cbb88593e7292f4bef7
4
- data.tar.gz: d166cc4f9bba2c73edf292e5d2a6e1e4e190125a04b608594b0e78055755134c
3
+ metadata.gz: ffd28c1dcb7db623d9e93d2238e143e78c928f76573d97781c1bdcd058c0ab1c
4
+ data.tar.gz: 6948f95652b107a8ccf3f58585cd2e3c4e908554a8c99ecade86ad6233eb8d14
5
5
  SHA512:
6
- metadata.gz: b69c79b3ab7b34499bf4760d36ea54401b10e1bd0d68b37e4b39796b0a4fb48909a18fcbd724db619d95abf92f9585f094ec11c5d6c0332c3e4880c52654e977
7
- data.tar.gz: ec9060115f34e789d1706e0165cd30fd5fb72c1451c6fa4b5df00b57fec18335ed81b960444a03424c5cf727fab6d32184357e0a442b93d86b2405b246f073e5
6
+ metadata.gz: 3c5bbfb1b9bc9a9c32e9200b3572f01bb201aade69081dc651dbb499d35816d157593a41aa057669f0dc2fd6f9e2cd4d99235b88a7c7e09b70f032a5c2e0ae80
7
+ data.tar.gz: fdbfa3f3f8b9c654e60e072909bcb1f6d30580142a03a5365220f781b062e821f6d8313538b2aefc87ed64974f239df0f0c9b4a7798ca5ad4560d5aa3656c907
@@ -6,7 +6,8 @@ module Kennel
6
6
  DEFAULTS = {
7
7
  description: nil,
8
8
  query: nil,
9
- monitor_ids: []
9
+ monitor_ids: [],
10
+ thresholds: []
10
11
  }.freeze
11
12
 
12
13
  settings :type, :description, :thresholds, :query, :tags, :monitor_ids, :monitor_tags, :name
@@ -16,9 +17,17 @@ module Kennel
16
17
  tags: -> { @project.tags },
17
18
  query: -> { DEFAULTS.fetch(:query) },
18
19
  description: -> { DEFAULTS.fetch(:description) },
19
- monitor_ids: -> { DEFAULTS.fetch(:monitor_ids) }
20
+ monitor_ids: -> { DEFAULTS.fetch(:monitor_ids) },
21
+ thresholds: -> { DEFAULTS.fetch(:thresholds) }
20
22
  )
21
23
 
24
+ def initialize(*)
25
+ super
26
+ if thresholds.any? { |t| t[:warning] && t[:warning].to_f <= t[:critical].to_f }
27
+ raise ValidationError, "Threshold warning must be greater-than critical value"
28
+ end
29
+ end
30
+
22
31
  def as_json
23
32
  return @as_json if @as_json
24
33
  data = {
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.57.2"
3
+ VERSION = "1.58.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.57.2
4
+ version: 1.58.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: 2019-11-14 00:00:00.000000000 Z
11
+ date: 2019-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday