doggy 2.0.18 → 2.0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/doggy/model.rb +5 -1
- data/lib/doggy/models/monitor.rb +13 -7
- data/lib/doggy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6be667ac225b597c970d76e5ecad61a39e8d1c1e
|
4
|
+
data.tar.gz: ea50d8647a1f8df3d43d5016300e4168745939f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72be3cf15ab9a796e6592983267992ca9e01bf7df4e47f57929870b6fa471f3b702203b8e0fcdb0359a6ffc31b7f507119f3d37c31bce9d649a7b55809e0eeca
|
7
|
+
data.tar.gz: 6b5dbde6cf5c502db7f176fc724074f2b897a372a1d645f2eba0428a3c612e2b490a91ac200ea2fd45334806c4c22a1abe9a6a8e37cdc3afd088b6934dbafb6e
|
data/Gemfile.lock
CHANGED
data/lib/doggy/model.rb
CHANGED
@@ -180,9 +180,13 @@ module Doggy
|
|
180
180
|
Doggy::Model.sort_by_key(super)
|
181
181
|
end
|
182
182
|
|
183
|
+
def validate
|
184
|
+
# NotImplemented
|
185
|
+
end
|
186
|
+
|
183
187
|
def save
|
184
188
|
ensure_managed_emoji!
|
185
|
-
|
189
|
+
validate
|
186
190
|
|
187
191
|
body = JSON.dump(to_h)
|
188
192
|
if !id then
|
data/lib/doggy/models/monitor.rb
CHANGED
@@ -59,13 +59,8 @@ module Doggy
|
|
59
59
|
self.name += " \xF0\x9F\x90\xB6"
|
60
60
|
end
|
61
61
|
|
62
|
-
def
|
63
|
-
|
64
|
-
|
65
|
-
allowed_renotify_intervals = [10,20,30,40,50,60,90,120,180,240,300,360,720,1440] # minutes
|
66
|
-
best_matching_interval = allowed_renotify_intervals.min_by { |x| (x.to_f - options.renotify_interval).abs }
|
67
|
-
puts "WARN: Monitor #{self.id} uses invalid escalation interval (renotify_interval) #{options.renotify_interval}, using #{best_matching_interval} instead"
|
68
|
-
options.renotify_interval = best_matching_interval
|
62
|
+
def validate
|
63
|
+
ensure_renotify_interval_valid
|
69
64
|
end
|
70
65
|
|
71
66
|
def mute
|
@@ -89,6 +84,17 @@ module Doggy
|
|
89
84
|
def to_h
|
90
85
|
super.merge(options: options.to_h)
|
91
86
|
end
|
87
|
+
|
88
|
+
private
|
89
|
+
|
90
|
+
def ensure_renotify_interval_valid
|
91
|
+
return unless options && options.renotify_interval && options.renotify_interval.to_i > 0
|
92
|
+
|
93
|
+
allowed_renotify_intervals = [10,20,30,40,50,60,90,120,180,240,300,360,720,1440] # minutes
|
94
|
+
best_matching_interval = allowed_renotify_intervals.min_by { |x| (x.to_f - options.renotify_interval).abs }
|
95
|
+
puts "WARN: Monitor #{self.id} uses invalid escalation interval (renotify_interval) #{options.renotify_interval}, using #{best_matching_interval} instead"
|
96
|
+
options.renotify_interval = best_matching_interval
|
97
|
+
end
|
92
98
|
end # Monitor
|
93
99
|
end # Models
|
94
100
|
end # Doggy
|
data/lib/doggy/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doggy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vlad Gorodetsky
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-11-
|
12
|
+
date: 2015-11-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|