Sha256: 5ac182a80463cef1d903ee6be055c22857a8fe981083acc60986c85ae64c5abc

Contents?: true

Size: 1.18 KB

Versions: 16

Compression:

Stored size: 1.18 KB

Contents

# frozen_string_literal: true

module Avm
  module EacWebappBase0
    module Instances
      class Base < ::Avm::Instances::Base
        module Apache
          common_concern

          class_methods do
            # @return [Class]
            def apache_path_class
              ancestors.lazy.map { |ancestor| apache_path_class_by_ancestor(ancestor) }
                       .find(&:present?) || raise("No apache patch class found for \"#{self}\"")
            end

            private

            # @param ancestor [Module]
            # @return [Class]
            def apache_path_class_by_ancestor(ancestor)
              "#{ancestor.name.deconstantize}::ApachePath".constantize
            rescue ::NameError
              nil
            end
          end

          # @return [Class]
          def apache_path_class
            self.class.apache_path_class
          end

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

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
eac_tools-0.84.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/apache.rb
eac_tools-0.83.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/apache.rb
eac_tools-0.82.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/apache.rb
eac_tools-0.81.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/apache.rb
eac_tools-0.80.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/apache.rb
eac_tools-0.79.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/apache.rb
eac_tools-0.78.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/apache.rb
eac_tools-0.77.1 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/apache.rb
eac_tools-0.77.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/apache.rb
eac_tools-0.76.1 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/apache.rb
eac_tools-0.76.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/apache.rb
eac_tools-0.75.2 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/apache.rb
eac_tools-0.75.1 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/apache.rb
eac_tools-0.75.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/apache.rb
avm-eac_webapp_base0-0.18.2 lib/avm/eac_webapp_base0/instances/base/apache.rb
eac_tools-0.74.1 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/apache.rb