Module: Murk

Included in:
Model::Stack, Model::Template
Defined in:
lib/murk.rb,
lib/murk/aws.rb,
lib/murk/model/stack.rb,
lib/murk/model/template.rb,
lib/murk/builder/murk_builder.rb,
lib/murk/builder/stack_builder.rb,
lib/murk/model/stack_parameter.rb,
lib/murk/model/stack_collection.rb,
lib/murk/builder/options_builder.rb,
lib/murk/builder/parameters_builder.rb

Defined Under Namespace

Modules: AWS, Builder, Model

Constant Summary collapse

DEFAULT_OPTIONS =
{
  template_path: ENV['MURK_PATH'] || '',
  stack_prefix: ENV['MURK_PREFIX']
}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.config_dirObject

rubocop:ensable Style/ClassVars



50
51
52
# File 'lib/murk.rb', line 50

def self.config_dir
  File.dirname(config_file)
end

.config_fileObject



41
42
43
# File 'lib/murk.rb', line 41

def self.config_file
  @@config_file ||= File.absolute_path('./config')
end

.config_file=(config_file) ⇒ Object



45
46
47
# File 'lib/murk.rb', line 45

def self.config_file=(config_file)
  @@config_file = config_file
end

.configure(options = {}) ⇒ Object



11
12
13
# File 'lib/murk.rb', line 11

def self.configure(options = {})
  @options = self.options.merge(options)
end

.load(file, user) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/murk.rb', line 19

def self.load(file, user)
  self.config_file = file
  config = File.read(config_file)
  builder = Murk::Builder::MurkBuilder.new user
  builder.instance_eval(config)
  builder.build
end

.loggerObject

rubocop:disable Style/ClassVars



28
29
30
31
32
33
# File 'lib/murk.rb', line 28

def self.logger
  @@logger ||= Logger.new(STDOUT).tap do |log|
    log.level = Logger::INFO
    log.progname = 'Murk'
  end
end

.logger=(logger) ⇒ Object



35
36
37
38
39
# File 'lib/murk.rb', line 35

def self.logger=(logger)
  @@logger = logger.tap do |log|
    log.progname = 'Murk'
  end
end

.optionsObject



15
16
17
# File 'lib/murk.rb', line 15

def self.options
  @options ||= DEFAULT_OPTIONS
end

Instance Method Details

#loggerObject



54
55
56
# File 'lib/murk.rb', line 54

def logger
  Murk.logger
end