bumbleworks 0.0.30 → 0.0.31
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bumbleworks/task/finder.rb +2 -1
- data/lib/bumbleworks/version.rb +1 -1
- data/spec/lib/bumbleworks/task_spec.rb +14 -0
- metadata +2 -2
@@ -28,9 +28,10 @@ module Bumbleworks
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def for_entity(entity)
|
31
|
+
entity_id = entity.respond_to?(:identifier) ? entity.identifier : entity.id
|
31
32
|
@queries << proc { |wi|
|
32
33
|
(wi['fields'][:entity_type] || wi['fields']['entity_type']) == entity.class.name &&
|
33
|
-
(wi['fields'][:entity_id] || wi['fields']['entity_id']) ==
|
34
|
+
(wi['fields'][:entity_id] || wi['fields']['entity_id']) == entity_id
|
34
35
|
}
|
35
36
|
self
|
36
37
|
end
|
data/lib/bumbleworks/version.rb
CHANGED
@@ -359,6 +359,20 @@ describe Bumbleworks::Task do
|
|
359
359
|
tasks = described_class.for_entity(fake_sandwich)
|
360
360
|
tasks.should have(2).items
|
361
361
|
end
|
362
|
+
|
363
|
+
it 'queries for id if entity does not respond to identifier' do
|
364
|
+
fake_mauvebelt = OpenStruct.new(:id => 'television_hat')
|
365
|
+
Bumbleworks.define_process 'tautological_mauvebelt' do
|
366
|
+
concurrence do
|
367
|
+
mauvebelt :task => 'wear_oneself'
|
368
|
+
mauvebelt :task => 'be_worn_by_oneself'
|
369
|
+
end
|
370
|
+
end
|
371
|
+
Bumbleworks.launch!('tautological_mauvebelt', :entity => fake_mauvebelt)
|
372
|
+
Bumbleworks.dashboard.wait_for(:mauvebelt)
|
373
|
+
tasks = described_class.for_entity(fake_mauvebelt)
|
374
|
+
tasks.should have(2).items
|
375
|
+
end
|
362
376
|
end
|
363
377
|
|
364
378
|
context '.by_nickname' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bumbleworks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.31
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-08-
|
15
|
+
date: 2013-08-12 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: ruote
|