Class: RubyYacht::Hook::CopyFileBehavior
- 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
-
#file_path ⇒ Object
readonly
:method: file_path The path to the file that this behavior copies.
Attributes inherited from Behavior
Instance Method Summary collapse
-
#dockerfile_command ⇒ Object
The command that should be run in a Dockerfile for this behavior.
-
#initialize(file_path) ⇒ CopyFileBehavior
constructor
This initialize creates the behavior.
Methods inherited from Behavior
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_path ⇒ Object (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_command ⇒ Object
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 |