Sha256: 2aade01a906d412a2731fa31159fb16fac6834e737f0588a61a2da9d87766cca

Contents?: true

Size: 1.65 KB

Versions: 30

Compression:

Stored size: 1.65 KB

Contents

# frozen_string_literal: true

require 'avm/instances/base'
require 'avm/eac_postgresql_base0/instance_with'
require 'avm/instances/data/files_unit'
require 'avm/instances/data/package'
require 'avm/eac_webapp_base0/instances/deploy/file_unit'
require 'avm/eac_webapp_base0/instances/runners'
require 'avm/eac_ubuntu_base0/instances/base'

module Avm
  module EacWebappBase0
    module Instances
      class Base < ::Avm::Instances::Base
        require_sub __FILE__
        include ::Avm::EacPostgresqlBase0::InstanceWith
        enable_simple_cache

        FILES_UNITS = [].freeze

        def data_dump(argv = [])
          run_subcommand(data_dump_runner_class, argv)
        end

        def data_dump_runner_class
          ::Avm::EacWebappBase0::Instances::Runners::Data::Dump
        end

        def run_subcommand(subcommand_class, argv)
          subcommand_class.create(
            argv: argv,
            parent: ::Avm::EacWebappBase0::Instances::Base::SubcommandParent.new(self)
          ).run
        end

        def data_package
          @data_package ||= ::Avm::Instances::Data::Package.new(
            self, units: { database: database_unit }.merge(files_units)
          )
        end

        def database_unit
          pg.data_unit
        end

        private

        # @return [Avm::EacUbuntuBase0::Instances::Base]
        def platform_instance_uncached
          ::Avm::EacUbuntuBase0::Instances::Base.by_id(id)
        end

        def files_units
          self.class.const_get('FILES_UNITS').transform_values do |fs_path_subpath|
            ::Avm::Instances::Data::FilesUnit.new(self, fs_path_subpath)
          end
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
eac_tools-0.60.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.59.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.58.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.57.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.56.1 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
avm-eac_webapp_base0-0.14.0 lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.56.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.55.7 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.55.6 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.55.5 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.55.4 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.55.3 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.55.2 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.55.1 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.55.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.54.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.53.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
avm-eac_webapp_base0-0.13.1 lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.52.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.51.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb