Module: Ree::PackageDSL::ClassMethods

Defined in:
lib/ree/package_dsl.rb

Instance Method Summary collapse

Instance Method Details

#package(&proc) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/ree/package_dsl.rb', line 13

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