Sha256: f17f4bd7a0259d12050815cd3c8600930dd76ced8bebc8b5e47ea76d942491b0

Contents?: true

Size: 859 Bytes

Versions: 1

Compression:

Stored size: 859 Bytes

Contents

module PopulateEnv
  module Heroku
    class Compilation
      attr_reader :options

      def initialize(options)
        @options = options
      end

      def manifest
        Manifest.new(options.manifest)
      end

      def attribute_definitions
        manifest.attribute_definitions_for(options.manifest_environment)
      end

      def remote_config
        @remote_config ||= RemoteConfig.new(options)
      end

      def sections
        attribute_definitions.map do |definition|
          attribute = AttributeCompilation.new(definition, options, remote_config).perform
          Formatters::EnvShellSection.new(attribute, export: options.export) if attribute
        end
      end

      def content
        sections.compact.join("\n")
      end
      
      def perform
        options.destination.write(content)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
populate-env-0.1.1 lib/populate_env/heroku/compilation.rb