Class: Pec::Command::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/pec/command/base.rb

Direct Known Subclasses

Config, Destroy, Init, List, Status, Up

Class Method Summary collapse

Class Method Details

.before_doObject



19
# File 'lib/pec/command/base.rb', line 19

def self.before_do; end


13
14
15
16
# File 'lib/pec/command/base.rb', line 13

def self.print_exception(e)
  Pec::Logger.critical(e)
  Pec::Logger.info("\t" + e.backtrace.join("\n\t"))
end

.run(host_name, options) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/pec/command/base.rb', line 4

def self.run(host_name, options)
  before_do
  Pec.servers(host_name, options, @fetch) do |server,config|
    task(host_name, options, server, config)
  end
  rescue => e
    print_exception(e)
end

.task(host_name, options, server, config) ⇒ Object



18
# File 'lib/pec/command/base.rb', line 18

def self.task(host_name, options, server, config); end