Class: EY::Serverside::CLI::Workflows::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/engineyard-serverside/cli/workflows/base.rb

Overview

Base is the template from which all Workflows are derived

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.


15
16
17
# File 'lib/engineyard-serverside/cli/workflows/base.rb', line 15

def initialize(options = {})
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options


13
14
15
# File 'lib/engineyard-serverside/cli/workflows/base.rb', line 13

def options
  @options
end

Class Method Details

.perform(options = {}) ⇒ Object


33
34
35
# File 'lib/engineyard-serverside/cli/workflows/base.rb', line 33

def self.perform(options = {})
  new(options).perform
end

Instance Method Details

#performObject


19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/engineyard-serverside/cli/workflows/base.rb', line 19

def perform
  shell.debug "Initializing #{About.name_with_version}."

  begin
    procedure
  rescue EY::Serverside::RemoteFailure => remote_error
    shell.fatal(remote_error.message)
    raise
  rescue Exception => error
    shell.fatal("#{error.backtrace[0]}: #{error.message} (#{error.class})")
    raise
  end
end