rec 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -2
- data/lib/rec/correlator.rb +5 -1
- data/lib/rec/state.rb +5 -0
- metadata +3 -3
data/CHANGELOG
CHANGED
data/lib/rec/correlator.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'rec/rule'
|
2
|
+
require 'io/wait'
|
2
3
|
|
3
4
|
module REC # :nodoc:
|
4
5
|
|
@@ -59,7 +60,10 @@ class Correlator
|
|
59
60
|
def run()
|
60
61
|
while @running and !$stdin.closed? do
|
61
62
|
logLine = gets()
|
62
|
-
|
63
|
+
if logLine.nil? # wait nicely for more input
|
64
|
+
sleep 1
|
65
|
+
next
|
66
|
+
end
|
63
67
|
logLine.strip!()
|
64
68
|
next if logLine.empty?
|
65
69
|
@@eventsIn += 1
|
data/lib/rec/state.rb
CHANGED
@@ -22,6 +22,11 @@ class State
|
|
22
22
|
state.generate()
|
23
23
|
}
|
24
24
|
|
25
|
+
# shortcut action to ignore an event
|
26
|
+
Ignore = Proc.new { |state|
|
27
|
+
state.release()
|
28
|
+
}
|
29
|
+
|
25
30
|
# shortcut action to generate a message and release the state immediately
|
26
31
|
Generate_and_release = Proc.new { |state|
|
27
32
|
state.generate()
|
metadata
CHANGED