Last active
August 29, 2015 14:12
-
-
Save chrislopresto/db58389ecbe09d0abf8e to your computer and use it in GitHub Desktop.
Cookbook Placeholder README Files
This file contains 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
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