Class: RubyYacht::Hook::CommandBehavior
- Defined in:
- lib/ruby_yacht/dsl/hook.rb
Overview
This class provides a behavior for running a command in the image.
Instance Attribute Summary
Attributes inherited from Behavior
Instance Method Summary collapse
-
#dockerfile_command ⇒ Object
The command that should be run in a Dockerfile for this behavior.
-
#initialize(command) ⇒ CommandBehavior
constructor
This initializer creates the behavior.
-
#shell_command ⇒ Object
The command that should be run in a shell script for this behavior.
Constructor Details
#initialize(command) ⇒ CommandBehavior
This initializer creates the behavior.
Parameters
- command: String The command to run.
190 191 192 |
# File 'lib/ruby_yacht/dsl/hook.rb', line 190 def initialize(command) @command = command end |
Instance Method Details
#dockerfile_command ⇒ Object
The command that should be run in a Dockerfile for this behavior.
195 196 197 |
# File 'lib/ruby_yacht/dsl/hook.rb', line 195 def dockerfile_command "RUN #{@command}" end |
#shell_command ⇒ Object
The command that should be run in a shell script for this behavior.
200 201 202 |
# File 'lib/ruby_yacht/dsl/hook.rb', line 200 def shell_command @command end |