wrongdoc.git  about / heads / tags
RDoc done right (IMNSHO)
blob 8c5f5b66728999631b912d07896d8bb2771db211 602 bytes (raw)
$ git show HEAD:lib/wrongdoc/readme.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
 
# helpers for parsing the top-level README file (no suffix support :P)
module Wrongdoc::Readme

  # returns a one-paragraph summary from the README
  def readme_description
    File.read("README").split(/\n\n/)[1]
  end

  # parses the README file in the top-level directory for project metadata
  def readme_metadata
    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
end

git clone https://yhbt.net/wrongdoc.git