Last active
July 22, 2016 00:39
-
-
Save gboone/cd1b01c8501759418a5fd64f9b33072d to your computer and use it in GitHub Desktop.
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
# Strips the body out of a document. Quick and dirty, assumes ARGV is a real directory with markdown or YAML files in it. | |
# I hard coded the directory and am not really a rubyist so there's a chance I screwed up this ARGV thing. | |
#!/usr/bin/env ruby | |
require 'yaml' | |
files = Dir.glob("#{ARGV[0]}/*") | |
for file in files | |
yaml = YAML.load(File.read(file)) | |
File.open(file, 'w') { |f| | |
f.write(yaml.to_yaml + "---") | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment