Sha256: e7539d88a3cd49f2e1f91a1f59317606dc366a8208be4793cfe722ef36b811ae

Contents?: true

Size: 1011 Bytes

Versions: 31

Compression:

Stored size: 1011 Bytes

Contents

# frozen_string_literal: true

require 'avm/eac_ubuntu_base0/apache'
require 'eac_ruby_utils/core_ext'

module Avm
  module EacRailsBase0
    class ApachePath
      enable_console_speaker
      enable_simple_cache
      common_constructor :instance, :options, default: [{}]

      def run
        write_available_conf
        enable_conf
        reload_apache
        ::Avm::Result.success('Done')
      end

      def content
        template.child('default.conf').apply(instance)
      end

      private

      def apache_uncached
        ::Avm::EacUbuntuBase0::Apache.new(instance.host_env)
      end

      def enable_conf
        infom 'Enabling configuration...'
        conf.enable
      end

      def reload_apache
        infom 'Reloading Apache...'
        apache.service('reload')
      end

      def conf_uncached
        apache.conf(instance.id)
      end

      def write_available_conf
        infom 'Writing available configuration...'
        conf.write(content)
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
avm-tools-0.92.0 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.91.0 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.90.0 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.89.0 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.88.0 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.87.1 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.87.0 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.86.0 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.85.1 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.85.0 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.84.0 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.83.0 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.82.1 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.82.0 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.81.0 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.80.0 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.79.0 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.78.0 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.77.0 lib/avm/eac_rails_base0/apache_path.rb
avm-tools-0.76.1 lib/avm/eac_rails_base0/apache_path.rb