Class: CHBuild::Config::Env
- Inherits:
-
Hash
- Object
- Hash
- CHBuild::Config::Env
- Defined in:
- lib/chbuild/config/env.rb
Overview
Env section
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(env = {}) ⇒ Env
constructor
A new instance of Env.
- #name ⇒ Object
- #to_bash_script ⇒ Object
- #validate!(_env) ⇒ Object
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
#errors ⇒ Object
16 17 18 |
# File 'lib/chbuild/config/env.rb', line 16 def errors [] end |
#name ⇒ Object
20 21 22 |
# File 'lib/chbuild/config/env.rb', line 20 def name "Section 'env'" end |
#to_bash_script ⇒ Object
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 |