Add logic to update Markdown file

This commit is contained in:
Alhadis
2016-09-07 00:21:05 +10:00
parent 49e9ee48d0
commit 09612ae42e
2 changed files with 317 additions and 1 deletions

View File

@@ -93,8 +93,17 @@ class GrammarList
markdown
end
# Update the file displaying the reader-friendly list of grammar repos
def update_readme
readme = "#{ROOT}/vendor/README.md"
preamble = File.read(readme).match(/\A.+?<!--.+?-->\n/ms)
list = self.to_markdown
File.write(readme, preamble.to_s + list)
end
end
list = GrammarList.new
puts list.to_markdown()
puts list.update_readme()