Sha256: 38687bbe6c6aee8cc306ceb66e1548f6bf9ae78344736e13ece4ee0d0c4b4b6a

Contents?: true

Size: 1.47 KB

Versions: 7

Compression:

Stored size: 1.47 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/processes/web_server'
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_modules: true
        include ::Avm::EacPostgresqlBase0::InstanceWith
        enable_simple_cache

        # @return [Avm::EacUbuntuBase0::Apache::Resource, nil]
        def apache_resource
          %i[conf site]
            .lazy
            .map { |type| platform_instance.apache.send(type, install_apache_resource_name) }
            .find(&:available?)
        end

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

        def database_unit
          pg_data_unit
        end

        # @return [Array<Avm::Instances::Process>]
        def processes
          super + [::Avm::EacWebappBase0::Instances::Processes::WebServer.new(self)]
        end

        private

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

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
eac_tools-0.74.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.73.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.72.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
avm-eac_webapp_base0-0.18.1 lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.70.1 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
avm-eac_webapp_base0-0.18.0 lib/avm/eac_webapp_base0/instances/base.rb
eac_tools-0.70.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb