warcorrespondent 0.2.3 → 0.2.5

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
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
- self.send("#{key}=",args[key])
10
- end
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 = @block.call
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
- - 3
9
- version: 0.2.3
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-14 00:00:00 +02:00
17
+ date: 2010-06-18 00:00:00 +02:00
18
18
  default_executable: warcorrespondent
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency