Module: Wrongdoc::Readme

Included in:
Gemspec, NewsAtom, Prepare, RdocOptions
Defined in:
lib/wrongdoc/readme.rb

Overview

helpers for parsing the top-level README file (no suffix support :P)

Instance Method Summary collapse

Instance Method Details

#readme_descriptionObject

returns a one-paragraph summary from the README



5
6
7
# File 'lib/wrongdoc/readme.rb', line 5

def readme_description
  File.read("README").split(/\n\n/)[1]
end

#readme_metadataObject

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



10
11
12
13
14
15
16
17
18
19
# File 'lib/wrongdoc/readme.rb', line 10

def 
  l = File.readlines("README")[0].strip!
  l.gsub!(/^=\s+/, '') or abort "#{l.inspect} doesn't start with '='"
  title = l.dup
  if l.gsub!(/^(\w+\!)\s+/, '') # Rainbows!
    return $1, l, title
  else
    return (l.split(/\s*[:-]\s*/, 2)).push(title)
  end
end