Class: IronWorkerNG::Feature::Common::SetEnv::Feature
- Defined in:
- lib/iron_worker_ng/feature/common/set_env.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #build_command ⇒ Object
- #bundle(container) ⇒ Object
-
#initialize(code, key, value) ⇒ Feature
constructor
A new instance of Feature.
Methods inherited from Base
Constructor Details
#initialize(code, key, value) ⇒ Feature
Returns a new instance of Feature.
9 10 11 12 13 14 |
# File 'lib/iron_worker_ng/feature/common/set_env.rb', line 9 def initialize(code, key, value) super(code) @key = key @value = value end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
6 7 8 |
# File 'lib/iron_worker_ng/feature/common/set_env.rb', line 6 def key @key end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/iron_worker_ng/feature/common/set_env.rb', line 7 def value @value end |
Instance Method Details
#build_command ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/iron_worker_ng/feature/common/set_env.rb', line 20 def build_command if @code.remote_build_command || @code.full_remote_build "set_env \"#{@key}\", \"#{@value.to_s.gsub('"','\\"')}\"" else nil end end |
#bundle(container) ⇒ Object
16 17 18 |
# File 'lib/iron_worker_ng/feature/common/set_env.rb', line 16 def bundle(container) container.runner_add "export #{@key}=\"#{@value.to_s.gsub('"','\\"')}\"" end |