Class: Deployme::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/deployme/config.rb

Defined Under Namespace

Classes: Context

Instance Method Summary collapse

Constructor Details

#initialize(options:) ⇒ Config

Returns a new instance of Config.



6
7
8
# File 'lib/deployme/config.rb', line 6

def initialize(options:)
  @options = options
end

Instance Method Details

#loadObject



10
11
12
13
14
15
16
# File 'lib/deployme/config.rb', line 10

def load
  file = File.join(options.directory, "#{options.environment}.yml")

  raise "Cannot find environment #{file}" unless File.exist?(file)

  Util.deep_symbolize_keys(YAML.load(ERB.new(File.read(file)).result(Context.with(options))))
end