pigeon 0.4.3 → 0.4.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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.3
1
+ 0.4.4
data/lib/pigeon/task.rb CHANGED
@@ -4,7 +4,7 @@ class Pigeon::Task
4
4
  # == Properties ===========================================================
5
5
 
6
6
  attr_reader :state
7
- attr_reader :options
7
+ attr_accessor :context
8
8
  attr_reader :engine
9
9
  attr_reader :exception
10
10
  attr_reader :created_at
@@ -26,13 +26,13 @@ class Pigeon::Task
26
26
 
27
27
  # == Instance Methods =====================================================
28
28
 
29
- # Creates a new instance of a Task with a series of options.
30
- # * :engine => Engine
31
- # Other options can be specified which will persist in the options
32
- # accessor.
33
- def initialize(options = nil)
34
- @options = options ? options.dup : { }
35
- @engine = @options.delete(:engine) || Pigeon::Engine.default_engine
29
+ # Creates a new instance of a Task with a series of context. An optional
30
+ # engine parameter indicates which engine this task should be associated
31
+ # with. An arbitrary context object can be specified which will persist in
32
+ # the context property.
33
+ def initialize(context = nil, engine = nil)
34
+ @context = context
35
+ @engine = engine || Pigeon::Engine.default_engine
36
36
  @created_at = Time.now
37
37
 
38
38
  after_initialized
data/pigeon.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{pigeon}
8
- s.version = "0.4.3"
8
+ s.version = "0.4.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["tadman"]
@@ -77,7 +77,7 @@ class PigeonTaskTest < Test::Unit::TestCase
77
77
 
78
78
  def test_alternate_engine
79
79
  engine = Pigeon::Engine.new
80
- task = Pigeon::Task.new(:engine => engine)
80
+ task = Pigeon::Task.new(nil, engine)
81
81
 
82
82
  assert_equal engine.object_id, task.engine.object_id
83
83
  end
@@ -148,7 +148,7 @@ class PigeonTaskTest < Test::Unit::TestCase
148
148
 
149
149
  task = Pigeon::Task.new(options)
150
150
 
151
- assert_equal options, task.options
151
+ assert_equal options, task.context
152
152
  end
153
153
 
154
154
  def test_block_notification
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 3
9
- version: 0.4.3
8
+ - 4
9
+ version: 0.4.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - tadman