eye-patch 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51751ccdad8b978ea9e2489b76c34bfa9a510758
4
- data.tar.gz: 0ec2abc778aaa2f70418fcad34a002ecd24489c9
3
+ metadata.gz: 6ccc9b1afad17fb6c48380c118b5b98fef372f38
4
+ data.tar.gz: caf7686b488014a72041764a33d546cd862048e2
5
5
  SHA512:
6
- metadata.gz: 742a6f5209e667b387687c0ad32be02b77e1f984e1615670737a770153b298c4451bc773ff1ac2b4b6688f1bd137d8392249737527faeec3e2671175d818bddc
7
- data.tar.gz: 5f3265ace2224dddf60ce2057feb81eacc67fa2d4688a4d32eea961cecbcb4fb3450bfe548cf29a9ff458565ca8bf40cfe7c5684e2cf453ffa173c9e6b00c451
6
+ metadata.gz: cc8f68ecfb3fe72e52227190422287b9b379c958421640b0bad27626816fb546b933400b21b7fe65dfb6eb938c68e21261a6e64d9877f6f4b82bcec145a699e5
7
+ data.tar.gz: 780c1b16f806ca7222fb2936ff0ed759230fcc9745d80bb46bff115264b8bebec1fb8a4e7def2e49e7a6fb8c04603014b7ed0a847f11f50d4f19daf40676b485
@@ -1,7 +1,6 @@
1
- require "celluloid"
2
1
  require "aws/ses"
3
2
 
4
- class Eye::Notify::SES < Eye::Notify::Custom
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
- parse_application
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
- end
25
-
26
- def parse_application
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
- @config[:notify] = {}
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
- @config[:triggers] = {}
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
- Array(@settings[:triggers]).each do |item|
42
- trigger_data = Eye::Trigger.name_and_class(item[:name].to_sym)
43
- @config[:triggers][trigger_data[:name]] = item[:config].merge(type: trigger_data[:type])
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
 
@@ -1,5 +1,5 @@
1
1
  module Eye
2
2
  module Patch
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eye-patch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Horner