Class: RubyYacht::Hook::CopyFileBehavior

Inherits:
Behavior
  • Object
show all
Defined in:
lib/ruby_yacht/dsl/hook.rb

Overview

This class provides a behavior for copying a file from the host machine to the image.

Instance Attribute Summary collapse

Attributes inherited from Behavior

#context

Instance Method Summary collapse

Methods inherited from Behavior

#shell_command

Constructor Details

#initialize(file_path) ⇒ CopyFileBehavior

This initialize creates the behavior.

Parameters

  • file_path: String The path to the file, relative to the root of the project.


214
215
216
# File 'lib/ruby_yacht/dsl/hook.rb', line 214

def initialize(file_path)
  @file_path = file_path
end

Instance Attribute Details

#file_pathObject (readonly)

:method: file_path The path to the file that this behavior copies.



225
226
227
# File 'lib/ruby_yacht/dsl/hook.rb', line 225

def file_path
  @file_path
end

Instance Method Details

#dockerfile_commandObject

The command that should be run in a Dockerfile for this behavior.



219
220
221
# File 'lib/ruby_yacht/dsl/hook.rb', line 219

def dockerfile_command
  "COPY #{File.basename(file_path)} /var/docker/"
end