Sha256: 6679105adaa842a6e2e439c205cbc46875ab381a6f43d0955e90c018fb4405f5

Contents?: true

Size: 760 Bytes

Versions: 13

Compression:

Stored size: 760 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

13 entries across 13 versions & 1 rubygems

Version Path
ree-1.0.32 lib/ree/package_dsl.rb
ree-1.0.31 lib/ree/package_dsl.rb
ree-1.0.30 lib/ree/package_dsl.rb
ree-1.0.29 lib/ree/package_dsl.rb
ree-1.0.28 lib/ree/package_dsl.rb
ree-1.0.27 lib/ree/package_dsl.rb
ree-1.0.26 lib/ree/package_dsl.rb
ree-1.0.25 lib/ree/package_dsl.rb
ree-1.0.24 lib/ree/package_dsl.rb
ree-1.0.23 lib/ree/package_dsl.rb
ree-1.0.22 lib/ree/package_dsl.rb
ree-1.0.21 lib/ree/package_dsl.rb
ree-1.0.20 lib/ree/package_dsl.rb