Class: RubyYacht::Hook::CommandBehavior

Inherits:
Behavior
  • Object
show all
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

#context

Instance Method Summary collapse

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_commandObject

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_commandObject

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