Class: Avm::Stereotypes::EacWebappBase0::Deploy::FilesUnit
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Avm::Stereotypes::EacWebappBase0::Deploy::FilesUnit
- Defined in:
- lib/avm/stereotypes/eac_webapp_base0/deploy.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.
120 121 122 123 124 |
# File 'lib/avm/stereotypes/eac_webapp_base0/deploy.rb', line 120 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.
118 119 120 |
# File 'lib/avm/stereotypes/eac_webapp_base0/deploy.rb', line 118 def data_key @data_key end |
#fs_path_subpath ⇒ Object (readonly)
Returns the value of attribute fs_path_subpath.
118 119 120 |
# File 'lib/avm/stereotypes/eac_webapp_base0/deploy.rb', line 118 def fs_path_subpath @fs_path_subpath end |
Instance Method Details
#assert_source_directory ⇒ Object
131 132 133 134 |
# File 'lib/avm/stereotypes/eac_webapp_base0/deploy.rb', line 131 def assert_source_directory infom "Asserting \"#{data_key}\" source directory..." instance.host_env.command('mkdir', '-p', source_path).execute! end |
#link_source_target ⇒ Object
144 145 146 147 148 |
# File 'lib/avm/stereotypes/eac_webapp_base0/deploy.rb', line 144 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
126 127 128 129 |
# File 'lib/avm/stereotypes/eac_webapp_base0/deploy.rb', line 126 def run assert_source_directory link_source_target end |
#source_path ⇒ Object
136 137 138 |
# File 'lib/avm/stereotypes/eac_webapp_base0/deploy.rb', line 136 def source_path ::File.join(instance.read_entry(:data_fs_path), data_key.to_s) end |
#target_path ⇒ Object
140 141 142 |
# File 'lib/avm/stereotypes/eac_webapp_base0/deploy.rb', line 140 def target_path ::File.join(instance.read_entry(:fs_path), fs_path_subpath.to_s) end |