pigeon 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/pigeon/task.rb +8 -8
- data/pigeon.gemspec +1 -1
- data/test/unit/pigeon_task_test.rb +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
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
|
-
|
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
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
def initialize(
|
34
|
-
@
|
35
|
-
@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
@@ -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(
|
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.
|
151
|
+
assert_equal options, task.context
|
152
152
|
end
|
153
153
|
|
154
154
|
def test_block_notification
|