Class: Avm::EacWebappBase0::Deploy::FileUnit
- Defined in:
- lib/avm/eac_webapp_base0/deploy/file_unit.rb
Instance Attribute Summary collapse
-
#data_key ⇒ Object
readonly
Returns the value of attribute data_key.
-
#fs_path_subpath ⇒ Object
readonly
Returns the value of attribute fs_path_subpath.
Instance Method Summary collapse
- #assert_source_directory ⇒ Object
-
#initialize(deploy, data_key, fs_path_subpath) ⇒ FileUnit
constructor
A new instance of FileUnit.
- #link_source_target ⇒ Object
- #run ⇒ Object
- #source_path ⇒ Object
- #target_path ⇒ Object
Constructor Details
#initialize(deploy, data_key, fs_path_subpath) ⇒ FileUnit
Returns a new instance of FileUnit.
9 10 11 12 13 |
# File 'lib/avm/eac_webapp_base0/deploy/file_unit.rb', line 9 def initialize(deploy, data_key, fs_path_subpath) super(deploy) @data_key = data_key @fs_path_subpath = fs_path_subpath end |
Instance Attribute Details
#data_key ⇒ Object (readonly)
Returns the value of attribute data_key.
7 8 9 |
# File 'lib/avm/eac_webapp_base0/deploy/file_unit.rb', line 7 def data_key @data_key end |
#fs_path_subpath ⇒ Object (readonly)
Returns the value of attribute fs_path_subpath.
7 8 9 |
# File 'lib/avm/eac_webapp_base0/deploy/file_unit.rb', line 7 def fs_path_subpath @fs_path_subpath end |
Instance Method Details
#assert_source_directory ⇒ Object
20 21 22 23 |
# File 'lib/avm/eac_webapp_base0/deploy/file_unit.rb', line 20 def assert_source_directory infom "Asserting \"#{data_key}\" source directory..." instance.host_env.command('mkdir', '-p', source_path).execute! end |
#link_source_target ⇒ Object
34 35 36 37 38 |
# File 'lib/avm/eac_webapp_base0/deploy/file_unit.rb', line 34 def link_source_target infom "Linking \"#{data_key}\" directory..." instance.host_env.command('rm', '-rf', target_path).execute! instance.host_env.command('ln', '-s', source_path, target_path).execute! end |
#run ⇒ Object
15 16 17 18 |
# File 'lib/avm/eac_webapp_base0/deploy/file_unit.rb', line 15 def run assert_source_directory link_source_target end |
#source_path ⇒ Object
25 26 27 |
# File 'lib/avm/eac_webapp_base0/deploy/file_unit.rb', line 25 def source_path ::File.join(instance.read_entry(:data_fs_path), data_key.to_s) end |