alerty 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/README.md +2 -1
- data/alerty.gemspec +1 -1
- data/example.yml +1 -1
- data/lib/alerty/cli.rb +2 -2
- data/lib/alerty/config.rb +13 -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: 453543dbd00954cb81e72e140fdfc4e032ff69db
|
4
|
+
data.tar.gz: 49224e75b73369a2b943c87d3973aacfa6a123bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53f44b191c4e84f232fd795284f8893b13e594f8e32f2366866bc47542df9027c4ec360a32175e70a4e093d0fe85d85ec593a10a4403877247bc95dc47eb6abc
|
7
|
+
data.tar.gz: ad6dc6757731631ef8967c334fc810758984d139134003ea839f5dabd8dcfbc132df4cf37b8debae8ff3ba865006310a64ee14af9ba5afffff9d505d96871423
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -54,7 +54,7 @@ Usage: alerty [options] -- command
|
|
54
54
|
--lock LOCK_FILE exclusive lock file to prevent running a command duplicatedly (default: no lock)
|
55
55
|
--retry-limit NUMBER number of retries (default: 0)
|
56
56
|
--retry-wait SECONDS retry interval = retry wait +/- 12.5% randomness (default: 1.0)
|
57
|
-
-d, --debug debug mode
|
57
|
+
-d, --debug debug mode
|
58
58
|
```
|
59
59
|
|
60
60
|
## Plugins
|
@@ -66,6 +66,7 @@ Following plugins are available:
|
|
66
66
|
* [exec](./lib/alerty/plugin/exec.rb)
|
67
67
|
* [sonots/alerty-plugin-ikachan](https://github.com/sonots/alerty-plugin-ikachan)
|
68
68
|
* [sonots/alerty-plugin-amazon_sns](https://github.com/sonots/alerty-plugin-amazon_sns)
|
69
|
+
* [sonots/alerty-plugin-slack](https://github.com/sonots/alerty-plugin-slack)
|
69
70
|
* [civitaspo/alerty-plugin-mail](https://github.com/civitaspo/alerty-plugin-mail)
|
70
71
|
* [inokappa/alerty-plugin-datadog_event](https://github.com/inokappa/alerty-plugin-datadog_event)
|
71
72
|
* [inokappa/alerty-plugin-amazon_cloudwatch_logs](https://github.com/inokappa/alerty-plugin-amazon_cloudwatch_logs)
|
data/alerty.gemspec
CHANGED
data/example.yml
CHANGED
data/lib/alerty/cli.rb
CHANGED
@@ -43,8 +43,8 @@ class Alerty
|
|
43
43
|
op.on('--retry-wait SECONDS', "retry interval = retry wait +/- 12.5% randomness (default: 1.0)") {|v|
|
44
44
|
opts[:retry_wait] = v.to_f
|
45
45
|
}
|
46
|
-
op.on('-d', '--debug', "debug mode
|
47
|
-
opts[:
|
46
|
+
op.on('-d', '--debug', "debug mode") {|v|
|
47
|
+
opts[:debug] = true
|
48
48
|
}
|
49
49
|
|
50
50
|
op.parse!(argv)
|
data/lib/alerty/config.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'yaml'
|
2
|
+
require 'erb'
|
2
3
|
require 'hashie/mash'
|
3
4
|
|
4
5
|
class Alerty
|
@@ -15,7 +16,14 @@ class Alerty
|
|
15
16
|
end
|
16
17
|
|
17
18
|
def config
|
18
|
-
@config ||=
|
19
|
+
@config ||=
|
20
|
+
begin
|
21
|
+
content = File.read(config_path)
|
22
|
+
erb = ERB.new(content, nil, '-')
|
23
|
+
erb_content = erb.result
|
24
|
+
puts erb_content if debug?
|
25
|
+
Hashie::Mash.new(YAML.load(erb_content))
|
26
|
+
end
|
19
27
|
end
|
20
28
|
|
21
29
|
def log_path
|
@@ -50,6 +58,10 @@ class Alerty
|
|
50
58
|
opts[:retry_wait] || config.retry_wait || 1.0
|
51
59
|
end
|
52
60
|
|
61
|
+
def debug?
|
62
|
+
!!opts[:debug]
|
63
|
+
end
|
64
|
+
|
53
65
|
def retry_interval
|
54
66
|
@random ||= Random.new
|
55
67
|
randomness = retry_wait * 0.125
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alerty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|