Class: OpsBuild::Berkshelf
- Inherits:
-
Object
- Object
- OpsBuild::Berkshelf
- Defined in:
- lib/ops_build/berkshelf.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Instance Method Summary collapse
-
#cleanup ⇒ Object
Cleanup Berks directory.
-
#initialize(dir: nil, silent: true) ⇒ Berkshelf
constructor
A new instance of Berkshelf.
-
#install ⇒ Object
Run berks install.
-
#vendor ⇒ Object
Run berks vendor.
Constructor Details
#initialize(dir: nil, silent: true) ⇒ Berkshelf
Returns a new instance of Berkshelf.
8 9 10 11 12 13 14 15 |
# File 'lib/ops_build/berkshelf.rb', line 8 def initialize(dir: nil, silent: true) Validations::check_binary!('berks') @dir = dir || Dir.mktmpdir('berks') @opts = '' @opts << '-q' if silent end |
Instance Attribute Details
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
6 7 8 |
# File 'lib/ops_build/berkshelf.rb', line 6 def dir @dir end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
6 7 8 |
# File 'lib/ops_build/berkshelf.rb', line 6 def opts @opts end |
Instance Method Details
#cleanup ⇒ Object
Cleanup Berks directory
33 34 35 |
# File 'lib/ops_build/berkshelf.rb', line 33 def cleanup FileUtils.rm_rf(@dir) end |