ace-eye 0.6.3 → 0.6.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/CHANGES.md +6 -0
- data/lib/eye.rb +1 -1
- data/lib/eye/dsl/main.rb +7 -0
- data/lib/eye/notify.rb +1 -1
- data/lib/eye/process/notify.rb +7 -1
- data/lib/eye/process/validate.rb +10 -0
- 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: c4d8c99104efffae767e2edb44b6f1413a036037
|
|
4
|
+
data.tar.gz: 00d8ac5e9563620d175283e7473d9d2b982bfb16
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1fae32093dceebf1c7e4f75fdf5b2dc42e5920336989d02c059e42b08544842cda1d1f6d11a32c19ec7990f10fd83f60025a9d4b175f66af73b452b571d9bc8f
|
|
7
|
+
data.tar.gz: e7c09a473d1762765f3a2b11d0afce81af029a62a54c5f18e29b90572eb01c8a600a27cdc4ec605a216a755dc5d5c9f1ae5326d4b723df8afe697c2eeb6aa407
|
data/CHANGES.md
CHANGED
data/lib/eye.rb
CHANGED
data/lib/eye/dsl/main.rb
CHANGED
|
@@ -25,8 +25,10 @@ module Eye::Dsl::Main
|
|
|
25
25
|
def load(glob = '')
|
|
26
26
|
return if glob.blank?
|
|
27
27
|
|
|
28
|
+
loaded = false
|
|
28
29
|
Eye::Dsl::Opts.with_parsed_file(glob) do |mask|
|
|
29
30
|
Dir[mask].each do |path|
|
|
31
|
+
loaded = true
|
|
30
32
|
Eye::Dsl.debug "=> load #{path}"
|
|
31
33
|
Eye.parsed_filename = path
|
|
32
34
|
res = Kernel.load(path)
|
|
@@ -34,6 +36,11 @@ module Eye::Dsl::Main
|
|
|
34
36
|
Eye::Dsl.debug "<= load #{path}"
|
|
35
37
|
end
|
|
36
38
|
end
|
|
39
|
+
|
|
40
|
+
unless loaded
|
|
41
|
+
puts "Warning! Eye.load not found: '#{glob}'"
|
|
42
|
+
warn "not found: '#{glob}'"
|
|
43
|
+
end
|
|
37
44
|
end
|
|
38
45
|
|
|
39
46
|
def config(&block)
|
data/lib/eye/notify.rb
CHANGED
|
@@ -36,7 +36,7 @@ class Eye::Notify
|
|
|
36
36
|
type = nh[:type]
|
|
37
37
|
config = (settings[type] || {}).merge(nh[:opts] || {}).merge(:contact => nh[:contact])
|
|
38
38
|
klass = get_class(type)
|
|
39
|
-
notify = klass.
|
|
39
|
+
notify = klass.new_link(config, message_h)
|
|
40
40
|
notify.async_notify if notify
|
|
41
41
|
end
|
|
42
42
|
|
data/lib/eye/process/notify.rb
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
module Eye::Process::Notify
|
|
2
2
|
|
|
3
|
+
trap_exit :notify_died
|
|
4
|
+
|
|
3
5
|
# notify to user:
|
|
4
6
|
# 1) process crashed by itself, and we restart it [:info]
|
|
5
7
|
# 2) checker bounded to restart process [:warn]
|
|
@@ -23,10 +25,14 @@ module Eye::Process::Notify
|
|
|
23
25
|
end
|
|
24
26
|
end
|
|
25
27
|
|
|
28
|
+
def notify_died(actor, reason)
|
|
29
|
+
error "NOTIFY DIED: #{actor.inspect} has died because of a #{reason.class}"
|
|
30
|
+
end
|
|
31
|
+
|
|
26
32
|
private
|
|
27
33
|
|
|
28
34
|
def ilevel(level)
|
|
29
35
|
LEVELS[level].to_i
|
|
30
36
|
end
|
|
31
37
|
|
|
32
|
-
end
|
|
38
|
+
end
|
data/lib/eye/process/validate.rb
CHANGED
|
@@ -28,6 +28,16 @@ module Eye::Process::Validate
|
|
|
28
28
|
raise Error, "working_dir '#{config[:working_dir]}' is invalid" unless File.directory?(config[:working_dir])
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
|
+
|
|
32
|
+
if config[:stop_signals]
|
|
33
|
+
s = config[:stop_signals].clone
|
|
34
|
+
while s.present?
|
|
35
|
+
sig = s.shift
|
|
36
|
+
timeout = s.shift
|
|
37
|
+
raise Error, "signal should be String, Symbol, Fixnum, not #{sig.inspect}" if sig && ![String, Symbol, Fixnum].include?(sig.class)
|
|
38
|
+
raise Error, "signal sleep should be Numeric, not #{timeout.inspect}" if timeout && ![Fixnum, Float].include?(timeout.class)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
31
41
|
end
|
|
32
42
|
|
|
33
43
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ace-eye
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Konstantin Makarchev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-06-
|
|
11
|
+
date: 2014-06-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: celluloid
|