Class: Flow::Build::Service::Env
- Defined in:
- lib/flow/build/service/env.rb,
lib/flow/build/service/env/var.rb,
lib/flow/build/service/env/builtin.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#custom_envs ⇒ Object
readonly
Returns the value of attribute custom_envs.
-
#script ⇒ Object
Returns the value of attribute script.
Instance Method Summary collapse
- #add_builtin_envs ⇒ Object
- #add_custom_envs ⇒ Object
- #apply ⇒ Object
-
#initialize(custom_envs = {}) ⇒ Env
constructor
A new instance of Env.
Constructor Details
#initialize(custom_envs = {}) ⇒ Env
Returns a new instance of Env.
16 17 18 19 |
# File 'lib/flow/build/service/env.rb', line 16 def initialize(custom_envs = {}) @custom_envs = custom_envs @script = [] end |
Instance Attribute Details
#custom_envs ⇒ Object (readonly)
Returns the value of attribute custom_envs.
13 14 15 |
# File 'lib/flow/build/service/env.rb', line 13 def custom_envs @custom_envs end |
#script ⇒ Object
Returns the value of attribute script.
14 15 16 |
# File 'lib/flow/build/service/env.rb', line 14 def script @script end |
Instance Method Details
#add_builtin_envs ⇒ Object
27 28 |
# File 'lib/flow/build/service/env.rb', line 27 def add_builtin_envs end |
#add_custom_envs ⇒ Object
30 31 32 33 34 35 |
# File 'lib/flow/build/service/env.rb', line 30 def add_custom_envs custom_envs.each do |key, value| script << "export #{key.upcase}=#{value}" end script << "\n" end |
#apply ⇒ Object
21 22 23 24 25 |
# File 'lib/flow/build/service/env.rb', line 21 def apply add_builtin_envs add_custom_envs script.join("\n") end |