Class: Avm::EacWebappBase0::Instances::Deploy::SetupFilesUnit
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Avm::EacWebappBase0::Instances::Deploy::SetupFilesUnit
- Defined in:
- lib/avm/eac_webapp_base0/instances/deploy/setup_files_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) ⇒ SetupFilesUnit
constructor
A new instance of SetupFilesUnit.
- #link_source_target ⇒ Object
- #result ⇒ Object
- #source_path ⇒ Object
- #target_path ⇒ Object
Constructor Details
#initialize(deploy, data_key, fs_path_subpath) ⇒ SetupFilesUnit
Returns a new instance of SetupFilesUnit.
11 12 13 14 15 |
# File 'lib/avm/eac_webapp_base0/instances/deploy/setup_files_unit.rb', line 11 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.
9 10 11 |
# File 'lib/avm/eac_webapp_base0/instances/deploy/setup_files_unit.rb', line 9 def data_key @data_key end |
#fs_path_subpath ⇒ Object (readonly)
Returns the value of attribute fs_path_subpath.
9 10 11 |
# File 'lib/avm/eac_webapp_base0/instances/deploy/setup_files_unit.rb', line 9 def fs_path_subpath @fs_path_subpath end |
Instance Method Details
#assert_source_directory ⇒ Object
22 23 24 25 |
# File 'lib/avm/eac_webapp_base0/instances/deploy/setup_files_unit.rb', line 22 def assert_source_directory infom "Asserting \"#{data_key}\" source directory..." instance.host_env.command('mkdir', '-p', source_path).execute! end |
#link_source_target ⇒ Object
36 37 38 39 40 41 |
# File 'lib/avm/eac_webapp_base0/instances/deploy/setup_files_unit.rb', line 36 def link_source_target infom "Linking \"#{data_key}\" directory..." return unless remove_target instance.host_env.command('ln', '-s', source_path, target_path).execute! end |
#result ⇒ Object
17 18 19 20 |
# File 'lib/avm/eac_webapp_base0/instances/deploy/setup_files_unit.rb', line 17 def result assert_source_directory link_source_target end |
#source_path ⇒ Object
27 28 29 |
# File 'lib/avm/eac_webapp_base0/instances/deploy/setup_files_unit.rb', line 27 def source_path ::File.join(instance.install_data_path, data_key.to_s) end |
#target_path ⇒ Object
31 32 33 34 |
# File 'lib/avm/eac_webapp_base0/instances/deploy/setup_files_unit.rb', line 31 def target_path ::File.join(instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH), fs_path_subpath.to_s) end |