eye-patch 0.0.3 → 0.0.4
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 +4 -4
- data/lib/eye/notify/ses.rb +3 -2
- data/lib/eye/patch/application.rb +20 -16
- data/lib/eye/patch/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: 6ccc9b1afad17fb6c48380c118b5b98fef372f38
|
4
|
+
data.tar.gz: caf7686b488014a72041764a33d546cd862048e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc8f68ecfb3fe72e52227190422287b9b379c958421640b0bad27626816fb546b933400b21b7fe65dfb6eb938c68e21261a6e64d9877f6f4b82bcec145a699e5
|
7
|
+
data.tar.gz: 780c1b16f806ca7222fb2936ff0ed759230fcc9745d80bb46bff115264b8bebec1fb8a4e7def2e49e7a6fb8c04603014b7ed0a847f11f50d4f19daf40676b485
|
data/lib/eye/notify/ses.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
require "celluloid"
|
2
1
|
require "aws/ses"
|
3
2
|
|
4
|
-
class Eye::Notify::SES < Eye::Notify
|
3
|
+
class Eye::Notify::SES < Eye::Notify
|
5
4
|
|
6
5
|
param :access_key_id, String, true
|
7
6
|
param :secret_access_key, String, true
|
@@ -20,3 +19,5 @@ class Eye::Notify::SES < Eye::Notify::Custom
|
|
20
19
|
text_body: message_body }
|
21
20
|
end
|
22
21
|
end
|
22
|
+
|
23
|
+
Eye::Notify::TYPES[:ses] = "SES"
|
@@ -11,39 +11,43 @@ class Eye::Patch::Application < Hash
|
|
11
11
|
def parse
|
12
12
|
@config = {}
|
13
13
|
|
14
|
-
|
15
|
-
parse_notifications
|
16
|
-
parse_triggers
|
14
|
+
parse_configuration
|
17
15
|
parse_processes
|
18
16
|
|
19
17
|
@config
|
20
18
|
end
|
21
19
|
|
22
20
|
def root_settings
|
23
|
-
@settings[:application] || {}
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
@config.merge!(root_settings)
|
21
|
+
@root_settings ||= (@settings[:application] || {}).merge(
|
22
|
+
notify: parse_notifications,
|
23
|
+
triggers: parse_triggers,
|
24
|
+
checks: parse_checks )
|
28
25
|
end
|
29
26
|
|
30
27
|
def parse_notifications
|
31
|
-
@
|
32
|
-
|
33
|
-
Array(@settings[:notifications]).each do |monitor|
|
34
|
-
@config[:notify][monitor[:name].to_s] = monitor[:level].to_sym
|
28
|
+
Array(@settings[:notifications]).each_with_object({}) do |notify, monitors|
|
29
|
+
monitors[notify[:name].to_s] = notify[:level].to_sym
|
35
30
|
end
|
36
31
|
end
|
37
32
|
|
38
33
|
def parse_triggers
|
39
|
-
@
|
34
|
+
Array(@settings[:triggers]).each_with_object({}) do |trigger, triggers|
|
35
|
+
trigger_data = Eye::Trigger.name_and_class(trigger[:name].to_sym)
|
36
|
+
triggers[trigger_data[:name]] = trigger[:config].merge(type: trigger_data[:type])
|
37
|
+
end
|
38
|
+
end
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
40
|
+
def parse_checks
|
41
|
+
Array(@settings[:checks]).each_with_object({}) do |check, checks|
|
42
|
+
check_data = Eye::Checker.name_and_class(check[:name].to_sym)
|
43
|
+
checks[check_data[:name]] = check[:config].merge(type: check_data[:type])
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
+
def parse_configuration
|
48
|
+
@config.merge!(root_settings)
|
49
|
+
end
|
50
|
+
|
47
51
|
def parse_processes
|
48
52
|
@config[:groups] = {}
|
49
53
|
|
data/lib/eye/patch/version.rb
CHANGED