Class: Kitchen::Provisioner::Chef::Librarian
- Inherits:
-
Object
- Object
- Kitchen::Provisioner::Chef::Librarian
- Includes:
- Logging
- Defined in:
- lib/kitchen/provisioner/chef/librarian.rb
Overview
Chef cookbook resolver that uses Librarian-Chef and a Cheffile to calculate dependencies.
Class Method Summary collapse
-
.load!(logger: Kitchen.logger) ⇒ Object
Loads the library code required to use the resolver.
Instance Method Summary collapse
-
#initialize(cheffile, path, logger: Kitchen.logger) ⇒ Librarian
constructor
Creates a new cookbook resolver.
-
#resolve ⇒ Object
Performs the cookbook resolution and vendors the resulting cookbooks in the desired path.
Methods included from Logging
#banner, #debug, #error, #fatal, #info, #warn
Constructor Details
Class Method Details
Instance Method Details
#resolve ⇒ Object
Performs the cookbook resolution and vendors the resulting cookbooks in the desired path.
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/kitchen/provisioner/chef/librarian.rb', line 55 def resolve version = ::Librarian::Chef::VERSION info("Resolving cookbook dependencies with Librarian-Chef #{version}...") debug("Using Cheffile from #{cheffile}") env = ::Librarian::Chef::Environment.new( project_path: File.dirname(cheffile)) env.config_db.local["path"] = path ::Librarian::Action::Resolve.new(env).run ::Librarian::Action::Install.new(env).run end |