Class: Warg::Localhost

Inherits:
Object
  • Object
show all
Defined in:
lib/warg.rb

Defined Under Namespace

Classes: BlockProxy, CollectionProxy, CommandOutcome

Instance Method Summary collapse

Instance Method Details

#addressObject



578
579
580
# File 'lib/warg.rb', line 578

def address
  "localhost"
end

#defer(command, banner, &block) ⇒ Object



597
598
599
600
601
602
# File 'lib/warg.rb', line 597

def defer(command, banner, &block)
  run_object = BlockProxy.new(banner, &block)
  hosts = CollectionProxy.new

  Executor::Deferred.new(command, run_object, hosts, :serial)
end

#runObject



582
583
584
585
586
587
588
589
590
591
592
593
594
595
# File 'lib/warg.rb', line 582

def run
  outcome = CommandOutcome.new

  begin
    outcome.command_started!

    yield
  rescue => error
    outcome.error = error
  end

  outcome.command_finished!
  outcome
end