Class: Mona::Package::Builder

Inherits:
Object
  • Object
show all
Includes:
Deps[ "package.find_root", "package.factory" ], Mixins
Defined in:
lib/mona/package/builder.rb

Constant Summary collapse

Inject =
Mona::Deps[
  "package.find_root",
  "package.factory"
]

Instance Method Summary collapse

Methods included from Mixins

included

Instance Method Details

#call(package_path, project_root, package_dirname) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/mona/package/builder.rb', line 19

def call(package_path, project_root, package_dirname)
  package_root_path = find_root.call(package_path, project_root)
  package_file_path = "#{package_root_path}/#{Mona::PACKAGE_FILENAME}"

  package_init_proc = proc { instance_eval(File.read(package_file_path)) }

  package = factory.call(package_root_path, package_dirname, init_proc: package_init_proc)
end