Parent

Files

POM::Dependency::VName

VName encapsulates a name-verison pair.

TODO: Need to support version “from-to” spans.

Attributes

name[R]

Package name.

version[R]

Package verison with constraint.

Public Class Methods

new(name) click to toggle source

New VName object.

# File lib/pom/require.rb, line 351
def initialize(name)
  @name, @version = parse(name)
end

Public Instance Methods

constraint() click to toggle source

Converts the version into a constraint recognizable by RubyGems.

# File lib/pom/require.rb, line 356
def constraint
  case version
  when /^(.*?)\~$/
    "~> #{$1}"
  when /^(.*?)\+$/
    ">= #{$1}"
  when /^(.*?)\-$/
    "< #{$1}"
  else
    version
  end
end
to_s() click to toggle source

Returns a String with name and version.

# File lib/pom/require.rb, line 370
def to_s
  "#{name} #{version}"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.