Skip to content

Instantly share code, notes, and snippets.

@chrislopresto
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrislopresto/db58389ecbe09d0abf8e to your computer and use it in GitHub Desktop.
Save chrislopresto/db58389ecbe09d0abf8e to your computer and use it in GitHub Desktop.
Cookbook Placeholder README Files
def rfp(directory)
"cookbooks/#{directory}/README.md"
end
def md(directory)
"# #{directory} Cookbook\n\nThis is a placeholder README for the #{directory} cookbook.\n\n## TODO\n\n- [ ] Replace me"
end
def wf(directory)
File.open(rfp(directory), 'w+') { |file| file.write(md(directory)) }
end
directories = Dir.entries('cookbooks').reject { |f| File.directory?(f) || f == '.gitignore' }
directories.each { |d| wf(d) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment