module Olddoc::Readme

helpers for parsing the top-level README file

Public Instance Methods

readme_description() click to toggle source

returns a one-paragraph summary from the README

# File lib/olddoc/readme.rb, line 12
def readme_description
  File.read(readme_path).split(/\n\n/)[1]
end
readme_metadata() click to toggle source

parses the README file in the top-level directory for project metadata

# File lib/olddoc/readme.rb, line 17
def readme_metadata
  l = File.readlines(readme_path)[0].strip!
  l.gsub!(/^=\s+/, '')
  title = l.dup
  if l.gsub!(/^(\w+\!)\s+/, '') # special case for Rainbows!
    return $1, l, title
  else
    return (l.split(/\s*[:-]\s*/, 2)).push(title)
  end
end
readme_path() click to toggle source
# File lib/olddoc/readme.rb, line 7
def readme_path
  'README'
end