blertr 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/blertr/control.rb +16 -5
- data/lib/blertr/version.rb +1 -1
- data/scripts/blertr +1 -1
- metadata +11 -11
data/lib/blertr/control.rb
CHANGED
@@ -11,22 +11,33 @@ module Blertr
|
|
11
11
|
# Sends out alert from each notifier if
|
12
12
|
# time passed is long enough
|
13
13
|
def self.alert command_name, command_time
|
14
|
+
# trap interrupt so as to not output
|
15
|
+
# error messages if execution is interrupted
|
16
|
+
interrupted = false
|
17
|
+
trap("INT") {interrupted = true}
|
18
|
+
|
14
19
|
blacklist = Blacklist.new
|
15
20
|
if !blacklist.blacklisted?(command_name)
|
16
21
|
message = Message.new(command_name, command_time)
|
17
22
|
notifiers.each do |notifier|
|
23
|
+
# check if interrupted first and exit
|
24
|
+
# as soon as possible
|
25
|
+
if interrupted
|
26
|
+
exit
|
27
|
+
end
|
28
|
+
|
18
29
|
if notifier.will_alert?(message.command, message.seconds)
|
19
30
|
fork do
|
20
31
|
begin
|
21
32
|
notifier.alert message
|
22
33
|
rescue
|
23
34
|
puts "problem with #{notifier.name} alert"
|
24
|
-
end
|
35
|
+
end #begin
|
25
36
|
exit
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
37
|
+
end #fork
|
38
|
+
end #will_alert?
|
39
|
+
end #each
|
40
|
+
end #!blacklisted?
|
30
41
|
end
|
31
42
|
|
32
43
|
def self.notifiers
|
data/lib/blertr/version.rb
CHANGED
data/scripts/blertr
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blertr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-07-22 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
|
-
requirement: &
|
16
|
+
requirement: &2788470 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '1.0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2788470
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rdoc
|
27
|
-
requirement: &
|
27
|
+
requirement: &2788200 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '2.5'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2788200
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &2787950 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '2.3'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2787950
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: simplecov
|
49
|
-
requirement: &
|
49
|
+
requirement: &2787710 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0.4'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2787710
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: twitter
|
60
|
-
requirement: &
|
60
|
+
requirement: &2787450 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: 1.6.0
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2787450
|
69
69
|
description: Automatic alerts for when bash scripts and commands complete
|
70
70
|
email: vvv@gmail.com
|
71
71
|
executables:
|