Module: MotherBrain::Berkshelf
- Defined in:
- lib/mb/berkshelf.rb
Overview
This module contains integration code for Berkshelf into motherbrain
Defined Under Namespace
Classes: Lockfile
Class Method Summary collapse
-
.cookbooks(options = {}) ⇒ Array<Pathname>
An array of Pathnames representing cookbooks in the Berkshelf.
-
.cookbooks_path ⇒ Pathname
Location of the cookbooks directory in the Berkshelf.
-
.default_path ⇒ String
The default location of the Berkshelf.
-
.init ⇒ Object
Create the directory structure for the Berkshelf.
-
.path ⇒ Pathname
The location of the Berkshelf.
Class Method Details
.cookbooks(options = {}) ⇒ Array<Pathname>
An array of Pathnames representing cookbooks in the Berkshelf
11 12 13 14 15 16 17 18 19 |
# File 'lib/mb/berkshelf.rb', line 11 def cookbooks( = {}) cookbooks = cookbooks_path.children if [:with_plugin] cookbooks.select! { |cb_path| Dir.has_mb_plugin?(cb_path) } end cookbooks end |
.cookbooks_path ⇒ Pathname
Location of the cookbooks directory in the Berkshelf
24 25 26 |
# File 'lib/mb/berkshelf.rb', line 24 def cookbooks_path path.join('cookbooks') end |
.default_path ⇒ String
The default location of the Berkshelf. This is in your user directory unless explicitly specified by the environment variable ‘BERKSHELF_PATH’
32 33 34 |
# File 'lib/mb/berkshelf.rb', line 32 def default_path ENV["BERKSHELF_PATH"] || File.("~/.berkshelf") end |
.init ⇒ Object
Create the directory structure for the Berkshelf
37 38 39 40 |
# File 'lib/mb/berkshelf.rb', line 37 def init FileUtils.mkdir_p(path) FileUtils.mkdir_p(cookbooks_path) end |
.path ⇒ Pathname
The location of the Berkshelf
45 46 47 |
# File 'lib/mb/berkshelf.rb', line 45 def path Pathname.new(Application.config.berkshelf.path || default_path) end |