Class: Composer::Package::Loader::ProjectRootPackageLoader
- Inherits:
-
Object
- Object
- Composer::Package::Loader::ProjectRootPackageLoader
- Defined in:
- lib/composer/package/loader/project_root_package_loader.rb
Overview
Loads a package from the project root package
Instance Method Summary collapse
-
#initialize(loader) ⇒ ProjectRootPackageLoader
constructor
A new instance of ProjectRootPackageLoader.
-
#load(project, ref) ⇒ Object
Load a project ref Param: string|JsonFile json A filename, json string or JsonFile instance to load the package from Returns: Composer::Package::Package.
Constructor Details
#initialize(loader) ⇒ ProjectRootPackageLoader
Returns a new instance of ProjectRootPackageLoader.
9 10 11 |
# File 'lib/composer/package/loader/project_root_package_loader.rb', line 9 def initialize(loader) @loader = loader end |
Instance Method Details
#load(project, ref) ⇒ Object
Load a project ref Param: string|JsonFile json A filename, json string or JsonFile instance to load the package from Returns: Composer::Package::Package
16 17 18 19 20 21 22 23 |
# File 'lib/composer/package/loader/project_root_package_loader.rb', line 16 def load(project, ref) config = Composer::Json::JsonFile.parse_json( project.repository.blob_at(ref.target, 'composer.json') ) @loader.load(config) end |