Revision af81fa28
Added by Marc Dequènes over 13 years ago
- ID af81fa280c02180753a03bbb49599ccdd72b2e8e
lib/cyborghood/cyborg/dsl.rb | ||
---|---|---|
end
|
||
|
||
class TaskBase < BaseDSL
|
||
attr_reader :bot, :name, :errors, :results, :preferred_locales, :locale
|
||
attr_reader :bot, :name, :errors, :results, :preferred_locales, :locale, :user
|
||
|
||
@@task_wip = 0
|
||
|
||
... | ... | |
@notification_name = "task/#{@name}"
|
||
@preferred_locales = nil
|
||
@locale = nil
|
||
@user = nil
|
||
|
||
_setup
|
||
_start_dsl &block
|
||
... | ... | |
end
|
||
end
|
||
|
||
# temporary setting until Guard is created
|
||
def set_user(user)
|
||
_add_subtask("setting/user") do |subtask|
|
||
logger.debug "Task '#{@name}': setting user to: #{user}"
|
||
@user = user
|
||
|
||
subtask.finish
|
||
end
|
||
end
|
||
|
||
# may return a Hash of results
|
||
def schedule(&job)
|
||
_add_subtask("job/#{job.hash}") do |subtask|
|
Also available in: Unified diff
[evol] Cyborg/DSL: temporary setting to know which user we are working for