watchdoge 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 52f1684d0e1df194ec63148666c3521b2aefe6d45487856aa3ddc635571f969b
|
|
4
|
+
data.tar.gz: 7aa8813c72f767d42a519880321614f13c7b126febf03506ac4e4e2efe24827c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2acb9f4d48a18d0ed10460a549698725915d52f513d23091df00cbcc7fb112b959bae22cbf3e995337f85e6d1559ef394934d65247c1b456212daa3396ce1fb6
|
|
7
|
+
data.tar.gz: 0cfd2e6ba9ea0f1f16d45fb7709b4e51faf3ff3944f5e8276e7e49bce595c67f86478db9296732d7b66e389828c910408ee069a9f824d65c82a37017b6f9b1e5
|
|
@@ -76,11 +76,11 @@ module WatchDoge
|
|
|
76
76
|
# key: must be stringify of its class name
|
|
77
77
|
# value: hash struct, will passed to constructor while push message
|
|
78
78
|
@notifications = {
|
|
79
|
-
#
|
|
79
|
+
# slack_webhook: {
|
|
80
80
|
# incoming_url: SLACK_WEBHOOK
|
|
81
81
|
# }
|
|
82
82
|
|
|
83
|
-
#
|
|
83
|
+
# mattermost: {
|
|
84
84
|
# host: HOST,
|
|
85
85
|
# channel_id: CHANNEL_ID,
|
|
86
86
|
# auth_token: AUTH_TOKEN
|
|
@@ -32,8 +32,8 @@ module WatchDoge
|
|
|
32
32
|
|
|
33
33
|
raise "can't find notification sources in configuration" if sources.empty?
|
|
34
34
|
|
|
35
|
-
sources.each do |
|
|
36
|
-
source_class = get_source_class
|
|
35
|
+
sources.each do |klass_sym, source_args|
|
|
36
|
+
source_class = get_source_class klass_sym
|
|
37
37
|
source = source_class.new source_args
|
|
38
38
|
source.push message
|
|
39
39
|
end
|
|
@@ -41,7 +41,9 @@ module WatchDoge
|
|
|
41
41
|
|
|
42
42
|
private
|
|
43
43
|
|
|
44
|
-
def get_source_class
|
|
44
|
+
def get_source_class klass_sym
|
|
45
|
+
klass = klass_sym.to_s.split('_').collect(&:capitalize).join
|
|
46
|
+
|
|
45
47
|
"WatchDoge::Notification::#{klass}".constantize
|
|
46
48
|
end
|
|
47
49
|
end
|
data/lib/watchdoge/version.rb
CHANGED
data/watchdoge.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: watchdoge
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Shen Lee
|
|
@@ -116,7 +116,7 @@ files:
|
|
|
116
116
|
- lib/watchdoge/cookie_pool.rb
|
|
117
117
|
- lib/watchdoge/image_diff.rb
|
|
118
118
|
- lib/watchdoge/notification.rb
|
|
119
|
-
- lib/watchdoge/notification/
|
|
119
|
+
- lib/watchdoge/notification/mattermost.rb
|
|
120
120
|
- lib/watchdoge/notification/slack_webhook.rb
|
|
121
121
|
- lib/watchdoge/rails/generator.rb
|
|
122
122
|
- lib/watchdoge/rails/railtie.rb
|