Class: Factor::Commands::Command

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

Overview

Base command with common methods used by all commands

Direct Known Subclasses

Workflow

Constant Summary collapse

DEFAULT_FILENAME =
{
  connectors:   File.expand_path('./connectors.yml'),
  credentials:  File.expand_path('./credentials.yml')
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#destination_streamObject

Returns the value of attribute destination_stream.



18
19
20
# File 'lib/commands/base.rb', line 18

def destination_stream
  @destination_stream
end

Instance Method Details

#debug(options = {}) ⇒ Object



36
37
# File 'lib/commands/base.rb', line 36

def debug(options = {})
end

#error(options = {}) ⇒ Object



24
25
26
# File 'lib/commands/base.rb', line 24

def error(options = {})
  log_line :error, options
end

#exception(message, exception) ⇒ Object



39
40
41
42
43
44
45
# File 'lib/commands/base.rb', line 39

def exception(message, exception)
  error 'message' => message
  error 'message' => "  #{exception.message}"
  exception.backtrace.each do |line|
    error 'message' => "    #{line}"
  end
end

#info(options = {}) ⇒ Object



20
21
22
# File 'lib/commands/base.rb', line 20

def info(options = {})
  log_line :info, options
end

#load_config(options = {}) ⇒ Object



47
48
49
50
# File 'lib/commands/base.rb', line 47

def load_config(options = {})
  load_config_data :credentials, options
  load_config_data :connectors, options
end

#success(options = {}) ⇒ Object



32
33
34
# File 'lib/commands/base.rb', line 32

def success(options = {})
  log_line :success, options
end

#warn(options = {}) ⇒ Object



28
29
30
# File 'lib/commands/base.rb', line 28

def warn(options = {})
  log_line :warn, options
end