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


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

def address
  "localhost"
end

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


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

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

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

#runObject


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

def run
  outcome = CommandOutcome.new

  begin
    outcome.command_started!

    yield
  rescue => error
    outcome.error = error
  end

  outcome.command_finished!
  outcome
end