Created
September 11, 2014 03:50
-
-
Save ravibhure/08fec818e5f0184ae858 to your computer and use it in GitHub Desktop.
Chef metadata parser to show dependancies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# @Author: Ravi Bhure <[email protected]> | |
require 'chef/cookbook/metadata' | |
metadata_file = ARGV.first || 'metadata.rb' | |
# read in metadata | |
metadata = Chef::Cookbook::Metadata.new | |
metadata.from_file(metadata_file) | |
# output cookbook name and version | |
puts "#{metadata.name} #{metadata.version}" | |
# output cookbook dependencies | |
metadata.dependencies.each { |cookbook, version| puts "#{cookbook} #{version}" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment