Class: CHBuild::Config::Env

Inherits:
Hash
  • Object
show all
Defined in:
lib/chbuild/config/env.rb

Overview

Env section

Instance Method Summary collapse

Constructor Details

#initialize(env = {}) ⇒ Env

Returns a new instance of Env.



6
7
8
9
10
# File 'lib/chbuild/config/env.rb', line 6

def initialize(env = {})
  validate!(env)
  super
  replace(env) unless env.nil?
end

Instance Method Details

#errorsObject



16
17
18
# File 'lib/chbuild/config/env.rb', line 16

def errors
  []
end

#nameObject



20
21
22
# File 'lib/chbuild/config/env.rb', line 20

def name
  "Section 'env'"
end

#to_bash_scriptObject



24
25
26
# File 'lib/chbuild/config/env.rb', line 24

def to_bash_script
  reduce('') { |a, (k, v)| a + "export #{k}=\"#{v}\"\n" }
end

#validate!(_env) ⇒ Object



12
13
14
# File 'lib/chbuild/config/env.rb', line 12

def validate!(_env)
  true
end