Revision 66cff75f
Added by Marc Dequènes almost 14 years ago
- ID 66cff75ffeb78ddabe00544394e615b6cba600a4
lib/cyborghood/cyborg.rb | ||
---|---|---|
|
||
|
||
module CyborgHood
|
||
module TaskAspect
|
||
def task(name, &block)
|
||
DSL::Task.new(self, name, &block)
|
||
end
|
||
|
||
def schedule_task(callback, &task)
|
||
EventMachine.defer(task, callback)
|
||
end
|
||
end
|
||
|
||
class Cyborg
|
||
include I18nTranslation
|
||
bindtextdomain("cyborghood", {:path => Config::L10N_DIR, :charset => "UTF-8"})
|
||
|
||
include TaskAspect
|
||
|
||
attr_reader :name, :services
|
||
|
||
def initialize(services = nil)
|
||
... | ... | |
[]
|
||
end
|
||
|
||
def task(name, &block)
|
||
DSL::Task.new(self, name, &block)
|
||
end
|
||
|
||
def schedule_task(callback, &task)
|
||
EventMachine.defer(task, callback)
|
||
end
|
||
|
||
protected
|
||
|
||
def process_system_notification(msg)
|
lib/cyborghood/cyborg/botnet/interface.rb | ||
---|---|---|
class ServerApiNode < BaseDSL
|
||
attr_reader :bot, :node_name, :parent_node, :store
|
||
|
||
include TaskAspect
|
||
|
||
# needed for testing node existence
|
||
reveal :nil?
|
||
reveal :respond_to?
|
Also available in: Unified diff
[evol] ServerApiNode: added task ability