Class: Avm::Stereotypes::EacWebappBase0::Deploy::FilesUnit
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Avm::Stereotypes::EacWebappBase0::Deploy::FilesUnit
- Defined in:
- lib/avm/stereotypes/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) ⇒ FilesUnit
constructor
A new instance of FilesUnit.
- #link_source_target ⇒ Object
- #run ⇒ Object
- #source_path ⇒ Object
- #target_path ⇒ Object
Constructor Details
#initialize(deploy, data_key, fs_path_subpath) ⇒ FilesUnit
Returns a new instance of FilesUnit.
10 11 12 13 14 |
# File 'lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb', line 10 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.
8 9 10 |
# File 'lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb', line 8 def data_key @data_key end |
#fs_path_subpath ⇒ Object (readonly)
Returns the value of attribute fs_path_subpath.
8 9 10 |
# File 'lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb', line 8 def fs_path_subpath @fs_path_subpath end |
Instance Method Details
#assert_source_directory ⇒ Object
21 22 23 24 |
# File 'lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb', line 21 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/stereotypes/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
16 17 18 19 |
# File 'lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb', line 16 def run assert_source_directory link_source_target end |
#source_path ⇒ Object
26 27 28 |
# File 'lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb', line 26 def source_path ::File.join(instance.read_entry(:data_fs_path), data_key.to_s) end |
#target_path ⇒ Object
30 31 32 |
# File 'lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb', line 30 def target_path ::File.join(instance.read_entry(:fs_path), fs_path_subpath.to_s) end |