Sha256: 699e4f64d92575a053ffb533d476c812459229ab2faab03e4402a1cb80a6162c

Contents?: true

Size: 1.23 KB

Versions: 57

Compression:

Stored size: 1.23 KB

Contents

# frozen_string_literal: true

module Avm
  module EacWebappBase0
    module Instances
      class Deploy
        class FileUnit < ::SimpleDelegator
          attr_reader :data_key, :fs_path_subpath

          def initialize(deploy, data_key, fs_path_subpath)
            super(deploy)
            @data_key = data_key
            @fs_path_subpath = fs_path_subpath
          end

          def run
            assert_source_directory
            link_source_target
          end

          def assert_source_directory
            infom "Asserting \"#{data_key}\" source directory..."
            instance.host_env.command('mkdir', '-p', source_path).execute!
          end

          def source_path
            ::File.join(instance.install_data_path, data_key.to_s)
          end

          def target_path
            ::File.join(instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH),
                        fs_path_subpath.to_s)
          end

          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
        end
      end
    end
  end
end

Version data entries

57 entries across 57 versions & 2 rubygems

Version Path
eac_tools-0.50.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.49.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.48.1 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
avm-eac_webapp_base0-0.13.0 lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.48.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.47.2 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.47.1 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.47.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
avm-eac_webapp_base0-0.12.3 lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.46.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.45.2 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.45.1 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.45.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.44.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.43.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.42.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
avm-eac_webapp_base0-0.12.2 lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.41.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
avm-eac_webapp_base0-0.12.1 lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.40.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb