Class: Souschef::Berkshelf
- Inherits:
-
Object
- Object
- Souschef::Berkshelf
- Defined in:
- lib/souschef/berkshelf.rb
Overview
Includes slave functions that do all the work
Instance Attribute Summary collapse
-
#cookbook_dir ⇒ Object
Returns the value of attribute cookbook_dir.
-
#opts ⇒ Object
Returns the value of attribute opts.
Instance Method Summary collapse
-
#berks_create ⇒ Object
Public - Tell Berkshelf to create a cookbook.
-
#initialize(opts) ⇒ Berkshelf
constructor
A new instance of Berkshelf.
Constructor Details
#initialize(opts) ⇒ Berkshelf
Returns a new instance of Berkshelf.
6 7 8 |
# File 'lib/souschef/berkshelf.rb', line 6 def initialize(opts) @opts = opts end |
Instance Attribute Details
#cookbook_dir ⇒ Object
Returns the value of attribute cookbook_dir.
4 5 6 |
# File 'lib/souschef/berkshelf.rb', line 4 def cookbook_dir @cookbook_dir end |
#opts ⇒ Object
Returns the value of attribute opts.
4 5 6 |
# File 'lib/souschef/berkshelf.rb', line 4 def opts @opts end |
Instance Method Details
#berks_create ⇒ Object
Public - Tell Berkshelf to create a cookbook
Returns nil
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/souschef/berkshelf.rb', line 13 def berks_create remove_old_readme Souschef::Print.info 'Creating cookbook structure' if @opts[:verbose] i, o, e, w = Open3.popen3(berks_cmd) print_open3_stdout(o) if @opts[:verbose] remove_vagrantfile print_open3_stdout(e) i.close fail 'Berks failed' unless w.value == 0 end |