warcorrespondent 0.2.3 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/warcorrespondent/reporter.rb +5 -3
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.5
|
@@ -2,19 +2,21 @@ module WarCorrespondent
|
|
2
2
|
class Reporter
|
3
3
|
attr_accessor :timeout
|
4
4
|
attr_accessor :identifier
|
5
|
+
attr_accessor :options
|
6
|
+
|
5
7
|
def initialize(args, &block)
|
6
8
|
@timeout = 300
|
7
9
|
[:timeout, :identifier].each do |key|
|
8
10
|
if args[key] && self.respond_to?("#{key}=")
|
9
|
-
|
10
|
-
|
11
|
+
self.send("#{key}=",args[key])
|
12
|
+
end
|
11
13
|
end
|
12
14
|
@block = block if block
|
13
15
|
WarCorrespondent::register_reporter(self)
|
14
16
|
end
|
15
17
|
|
16
18
|
def update
|
17
|
-
data =
|
19
|
+
data = instance_eval(&@block)
|
18
20
|
data = [data] if data.class == Hash
|
19
21
|
data.map! do |e|
|
20
22
|
e = {:timestamp => Time.now.to_i}.merge(e)
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 5
|
9
|
+
version: 0.2.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Stefan Maier
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-06-
|
17
|
+
date: 2010-06-18 00:00:00 +02:00
|
18
18
|
default_executable: warcorrespondent
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|