Sha256: 254eeb7f91e72a6c58e54a07693b692b7e1dbfd38d141c90ecd8fe722a265256

Contents?: true

Size: 671 Bytes

Versions: 2

Compression:

Stored size: 671 Bytes

Contents

class Mona::Package::Builder
  include Mona::Mixins

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

  include Inject

  sig do
    params(
      package_path: String,
      project_root: String,
      package_dirname: String
    )
    .returns(Mona::Package)
  end
  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
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mona-0.2.3 lib/mona/package/builder.rb
mona-0.2.2 lib/mona/package/builder.rb