cronitor 0.4.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/cronitor.rb +12 -2
- data/lib/cronitor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfb4bc2a6d6edac6fd2f95844f1960ed7fb1386b
|
4
|
+
data.tar.gz: 95ba43106ee758681c6e681e9e0a388bbe810437
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12995df33e43f2a6959b2662eb4a99c3162fa869376a09c3795ed3b2a78c5fedf8b87bac7d2d275930a6d6f6aabe1e9bfe783e5c05e9496f19f8283a394ee3cd
|
7
|
+
data.tar.gz: e237a122016b09638091f012a7a03e902310e01e8fe0aa9aacdf91e7042481cf96f1e0e584835e919fe5cc7739ecdfab711949eb6e89623f4f67b8ff0664c1dc
|
data/README.md
CHANGED
data/lib/cronitor.rb
CHANGED
@@ -16,8 +16,6 @@ class Cronitor
|
|
16
16
|
@opts = opts
|
17
17
|
@code = code
|
18
18
|
|
19
|
-
exists? opts[:name] if opts && opts.key?(:name)
|
20
|
-
|
21
19
|
if token.nil? && @code.nil?
|
22
20
|
fail(
|
23
21
|
Cronitor::Error,
|
@@ -25,6 +23,9 @@ class Cronitor
|
|
25
23
|
'provided')
|
26
24
|
end
|
27
25
|
|
26
|
+
exists? opts[:name] if opts && opts.key?(:name)
|
27
|
+
human_readable opts[:rules] if opts && opts.key?(:rules)
|
28
|
+
|
28
29
|
create if @code.nil?
|
29
30
|
end
|
30
31
|
|
@@ -58,6 +59,15 @@ class Cronitor
|
|
58
59
|
valid? response
|
59
60
|
end
|
60
61
|
|
62
|
+
def human_readable(rules)
|
63
|
+
rules.each do |rule|
|
64
|
+
unless rule[:human_readable]
|
65
|
+
rule[:human_readable] = "#{rule[:rule_type]} #{rule[:duration]} " \
|
66
|
+
"#{rule[:time_unit]}"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
61
71
|
private
|
62
72
|
|
63
73
|
def valid?(response)
|
data/lib/cronitor/version.rb
CHANGED