Skip to content

Instantly share code, notes, and snippets.

@jacoelho
Created December 12, 2016 15:29
Show Gist options
  • Save jacoelho/8ff015018f7b4c90e0420606b52ef575 to your computer and use it in GitHub Desktop.
Save jacoelho/8ff015018f7b4c90e0420606b52ef575 to your computer and use it in GitHub Desktop.
self cookbook version
def cookbook_version
metadata = Chef::Cookbook::Metadata.new
metadata.from_json ::File.read ::File.join ::File.dirname(__dir__),
"metadata.json"
metadata.version
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment