Module: Remoting::Task

Defined in:
lib/remoting/task.rb

Instance Method Summary collapse

Instance Method Details

#_remoting_task_includedObject



9
10
# File 'lib/remoting/task.rb', line 9

def _remoting_task_included
end

#configObject



12
13
14
# File 'lib/remoting/task.rb', line 12

def config
  ::Remoting.config
end

#local(name, *args, &block) ⇒ Object



16
17
18
19
20
21
# File 'lib/remoting/task.rb', line 16

def local(name, *args, &block)
  bold("Executing '#{name}' on local ...")
  commands  = ::Remoting::Dsl::ScriptBuilder.build(&block)
  commander = LocalCommander.new(*args)
  run(commander, commands) 
end

#remote(name, login, *args, &block) ⇒ Object



23
24
25
26
27
28
# File 'lib/remoting/task.rb', line 23

def remote(name, , *args, &block)
  bold("Executing '#{name}' on '#{}' ...")
  commands = ::Remoting::Dsl::ScriptBuilder.build(&block)      
  commander = RemoteCommander.new(, *args)
  run(commander, commands)
end

#run(commander, commands) ⇒ Object



30
31
32
# File 'lib/remoting/task.rb', line 30

def run(commander, commands)
  commander.exec(commands)
end

#shellObject



34
35
36
# File 'lib/remoting/task.rb', line 34

def shell
  @shell ||= ::Remoting::Shell.new
end