Parent

Files

POM::Readme

Readme is designed to parse a README file applying various hueristics in order to descern metadata about a project.

Attributes

file[R]
root[R]
text[R]

Public Class Methods

load(path) click to toggle source
# File lib/pom/readme.rb, line 18
def self.load(path)
  path = Pathname.new(path)
  if path.directory?
    path = path.first('{README,README.*}', :casefold)
  end
  new(path.read)
end
new(text) click to toggle source
# File lib/pom/readme.rb, line 27
def initialize(text)
  @text  = text
  @cache = {}
  parse
end

Public Instance Methods

[](name) click to toggle source
# File lib/pom/readme.rb, line 34
def [](name)
  return nil unless file
  if respond_to?(name)
    send(name)
  else
    nil
  end
end
authors() click to toggle source
# File lib/pom/readme.rb, line 62
def authors ; @cache[:authors] ; end
description() click to toggle source
# File lib/pom/readme.rb, line 53
def description ; @cache[:description] ; end
homepage() click to toggle source
# File lib/pom/readme.rb, line 65
def homepage ; @cache[:homepage] ; end
issues() click to toggle source
# File lib/pom/readme.rb, line 71
def issues ; @cache[:issues] ; end
license() click to toggle source
# File lib/pom/readme.rb, line 56
def license ; @cache[:license] ; end
name() click to toggle source
# File lib/pom/readme.rb, line 44
def name ; @cache[:name] ; end
Also aliased as: project
project() click to toggle source

DEPRECATE

Alias for: name
title() click to toggle source
# File lib/pom/readme.rb, line 50
def title ; @cache[:title] ; end
wiki() click to toggle source
# File lib/pom/readme.rb, line 68
def wiki ; @cache[:wiki] ; end

[Validate]

Generated with the Darkfish Rdoc Generator 2.