Parent

Included Modules

Files

POM::Manifest

Manifest file.

Constants

DEFAULT_FILE

File glob use for locating the MANIFEST file.

Attributes

file[R]

Stores the path of the amnifest file.

Public Class Methods

new(root) click to toggle source

Instantiate a new Manifest object, provided the root directory of the project.

# File lib/pom/manifest.rb, line 18
def initialize(root)
  @root = root
  @file = root.glob(DEFAULT_FILE, :casefold).first
end

Public Instance Methods

each(&block) click to toggle source

Iterate over each file in the manifest.

# File lib/pom/manifest.rb, line 41
def each(&block)
  list.each(&block)
end
empty?() click to toggle source
# File lib/pom/manifest.rb, line 50
def empty?
  list.empty?
end
exist?() click to toggle source
# File lib/pom/manifest.rb, line 45
def exist?
  file
end
files() click to toggle source

Alternate reference to the manifest list.

Alias for: list
list() click to toggle source

Parses the MANIFEST file and returns it as an array of file names. Blank lines and commented lines (using ‘#’) are ignored.

# File lib/pom/manifest.rb, line 26
def list
  @list ||= (
    if exist?
      files = File.readlines(file).map{ |line| line.strip }
      files.reject{|line| line == '' or line =~ /^[#]/ }
    else
      []
    end
  )
end
Also aliased as: files
size() click to toggle source

Size of the manifest.

# File lib/pom/manifest.rb, line 55
def size ; list.size ; end

[Validate]

Generated with the Darkfish Rdoc Generator 2.