Module: Cts::Mpx::Aci

Defined in:
lib/cts/mpx/aci.rb,
lib/cts/mpx/aci/stencil.rb,
lib/cts/mpx/aci/version.rb,
lib/cts/mpx/aci/validators.rb,
lib/cts/mpx/aci/tasks/image.rb,
lib/cts/mpx/aci/tasks/deploy.rb,
lib/cts/mpx/aci/tasks/collect.rb,
lib/cts/mpx/aci/transformations.rb

Overview

Account Continuous Integration.

Defined Under Namespace

Modules: Tasks, Transformations, Validators Classes: Stencil

Constant Summary collapse

VERSION =

Current version of Cts::Mpx::ACI

"2.0.1".freeze

Class Method Summary collapse

Class Method Details

.configure_optionsnil

build a new object from the options provided

Returns:

  • (nil)

    nil



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/cts/mpx/aci.rb', line 42

def configure_options
  @logger.add_appenders Logging.appenders.file("cts-aci-mpx-#{Time.now.to_i}.log", layout: Logging.layouts.json) if @options[:log_to_file]

  @logger.add_appenders Logging.appenders.stdout level: :info, layout: Logging.layouts.pattern(pattern: '%m\n') if @options[:log_to_stdout] || @options[:colorize_stdout]

  return unless @options[:colorize_stdout]

  layout = Logging.layouts.pattern(pattern:      '[%d] %-5l %c: %m\n',
                                   color_scheme: 'bright')
  @logger.appenders.last.layout = layout
  nil
end

.loggerLogging::Logger

the logger

Returns:

  • (Logging::Logger)


58
59
60
# File 'lib/cts/mpx/aci.rb', line 58

def logger
  @logger
end

.options(key = nil, value = nil) ⇒ *, Hash

options method

Parameters:

  • key (String) (defaults to: nil)

    (optional) option to look up

  • value (*) (defaults to: nil)

    Value to assign to the option array

Returns:

  • (*)

    value of the option returned

  • (Hash)

    entire option hash (with no parameter)



68
69
70
71
72
73
# File 'lib/cts/mpx/aci.rb', line 68

def options(key = nil, value = nil)
  return @options unless key
  return @options[key] unless value

  @options[key] = value
end