Sha256: 67e9ab73d3c151a8f50856c707e0d41016aa40fb6252b3e1b5913b7dd1529339

Contents?: true

Size: 758 Bytes

Versions: 15

Compression:

Stored size: 758 Bytes

Contents

# frozen_string_literal: true

module Ree::PackageDSL
  def self.included(base)
    base.extend(ClassMethods)
  end

  def self.extended(base)
    base.extend(ClassMethods)
  end

  module ClassMethods
    def package(&proc)
      dsl = Ree::BuildPackageDsl.new(
        Ree.container.packages_facade, self
      )

      if block_given?
        dsl.instance_exec(&proc)
        dsl.load_dependent_packages
      end

      return if dsl.package.preloaded?
      dsl.package.set_preloaded(true)

      dsl.package.preload.each do |env, list|
        next if !Ree.preload_for?(env)

        list.each do |object_name|
          Ree.container.compile_object(
            "#{dsl.package.name}/#{object_name}",
          )
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ree-1.0.47 lib/ree/package_dsl.rb
ree-1.0.46 lib/ree/package_dsl.rb
ree-1.0.45 lib/ree/package_dsl.rb
ree-1.0.44 lib/ree/package_dsl.rb
ree-1.0.43 lib/ree/package_dsl.rb
ree-1.0.42 lib/ree/package_dsl.rb
ree-1.0.41 lib/ree/package_dsl.rb
ree-1.0.40 lib/ree/package_dsl.rb
ree-1.0.39 lib/ree/package_dsl.rb
ree-1.0.38 lib/ree/package_dsl.rb
ree-1.0.37 lib/ree/package_dsl.rb
ree-1.0.36 lib/ree/package_dsl.rb
ree-1.0.35 lib/ree/package_dsl.rb
ree-1.0.34 lib/ree/package_dsl.rb
ree-1.0.33 lib/ree/package_dsl.rb