In Files

Files

POM::News

News / Release Notes

This class provides access to the latest news / release notes, for a project. These notes are either extracted from a NEWS file or from the lastest entry in the HISTORY file.

Constants

FILE_PATTERN

Search glob if any files exist in project from which the Release class can gather information.

Attributes

file[R]

Release file, if any.

root[R]

Root directory of project.

Public Class Methods

file_pattern() click to toggle source
# File lib/pom/news.rb, line 19
def self.file_pattern
  FILE_PATTERN
end
find(root) click to toggle source
# File lib/pom/news.rb, line 24
def self.find(root)
  root = Pathname.new(root)
  root.glob(file_pattern, :casefold).first
end
new(root, opts={}) click to toggle source

New News ;)

# File lib/pom/news.rb, line 36
def initialize(root, opts={})
  @root    = Pathname.new(root)
  @history = opts[:history]

  @file = opts[:file] || self.class.find(root)

  if @file
    super(File.read(@file))
  end

  #if opts[:history]
  #  @history = opts[:history]
  #elsif History.find(root)
  #  @history = History.new(root)
  #end

  if !file && history
    @header   = history.release.header
    @notes    = history.release.notes
    @change   = history.release.changes

    @version  = history.release.version
    @date     = history.release.date
    @nickname = history.release.nickname
  end
end

Public Instance Methods

history() click to toggle source

Lazy access to HISTORY file.

# File lib/pom/news.rb, line 69
def history
  return @history unless @history.nil?
  @history = (
    if History.find(root)
      History.new(root)
    else
      false
    end
  )
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.