Sha256: eaf04a67637bba8d37e4f2a2cbcb45726adee03a24cad95e790e09b3d6fbb8ac

Contents?: true

Size: 1.28 KB

Versions: 20

Compression:

Stored size: 1.28 KB

Contents

# frozen_string_literal: true

require 'avm/instances/base'
require 'avm/postgresql/instance_with'
require 'avm/data/instance/files_unit'
require 'avm/data/instance/package'
require 'avm/eac_webapp_base0/deploy/file_unit'

module Avm
  module EacWebappBase0
    class Instance < ::Avm::Instances::Base
      include ::Avm::Postgresql::InstanceWith

      def stereotype_name
        self.class.name.desconstantize.demodulize
      end

      def data_dump(argv = [])
        run_subcommand(::Avm::Tools::Runner::EacWordpressBase0::Data::Dump, argv)
      end

      def data_dump_runner_class
        "::Avm::Tools::Runner::#{stereotype_name}::Data::Dump".constantize
      end

      def run_subcommand(subcommand_class, argv)
        parent = ::OpenStruct.new(instance: self)
        subcommand_class.new(argv: argv, parent: parent).run
      end

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

      def database_unit
        pg.data_unit
      end

      private

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
avm-tools-0.88.0 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.87.1 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.87.0 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.86.0 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.85.1 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.85.0 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.84.0 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.83.0 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.82.1 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.82.0 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.81.0 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.80.0 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.79.0 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.78.0 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.77.0 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.76.1 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.76.0 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.75.1 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.75.0 lib/avm/eac_webapp_base0/instance.rb
avm-tools-0.74.1 lib/avm/eac_webapp_base0/instance.rb