Class: CapsuleCD::Chef::ChefHelper
- Inherits:
-
Object
- Object
- CapsuleCD::Chef::ChefHelper
- Defined in:
- lib/capsulecd/chef/chef_helper.rb
Class Method Summary collapse
- .parse_berksfile_from_repo(repo_path, berksfile_filename = 'Berksfile') ⇒ Object
- .parse_berksfile_lock_from_repo(repo_path, lockfile_filename = 'Berksfile.lock') ⇒ Object
- .parse_metadata(metadata_str) ⇒ Object
- .read_repo_metadata(repo_path, metadata_filename = 'metadata.rb') ⇒ Object
- .write_repo_metadata(repo_path, metadata_str, metadata_filename = 'metadata.rb') ⇒ Object
Class Method Details
.parse_berksfile_from_repo(repo_path, berksfile_filename = 'Berksfile') ⇒ Object
24 25 26 |
# File 'lib/capsulecd/chef/chef_helper.rb', line 24 def self.parse_berksfile_from_repo(repo_path, berksfile_filename = 'Berksfile') Berkshelf::Lockfile.from_file("#{repo_path}/#{berksfile_filename}") end |
.parse_berksfile_lock_from_repo(repo_path, lockfile_filename = 'Berksfile.lock') ⇒ Object
20 21 22 |
# File 'lib/capsulecd/chef/chef_helper.rb', line 20 def self.parse_berksfile_lock_from_repo(repo_path, lockfile_filename = 'Berksfile.lock') Berkshelf::Lockfile.from_file("#{repo_path}/#{lockfile_filename}") end |
.parse_metadata(metadata_str) ⇒ Object
14 15 16 17 18 |
# File 'lib/capsulecd/chef/chef_helper.rb', line 14 def self.() = Ridley::Chef::Cookbook::Metadata.new .instance_eval() end |
.read_repo_metadata(repo_path, metadata_filename = 'metadata.rb') ⇒ Object
7 8 9 |
# File 'lib/capsulecd/chef/chef_helper.rb', line 7 def self.(repo_path, = 'metadata.rb') File.read("#{repo_path}/#{}") end |
.write_repo_metadata(repo_path, metadata_str, metadata_filename = 'metadata.rb') ⇒ Object
11 12 13 |
# File 'lib/capsulecd/chef/chef_helper.rb', line 11 def self.(repo_path, , = 'metadata.rb') File.open("#{repo_path}/#{}", 'w') { |file| file.write() } end |