class Mvnizer::Project

Class representing a project coordinates. The elements of the coordinates are read-only.

Attributes

artifact_id[R]
dependencies[R]
docker[R]
group_id[R]
main[R]
plugins[R]
scope[R]
type[R]
version[R]

Public Class Methods

new(group_id, artifact_id, version, type, dependencies = [], scope = nil, plugins = [], main = nil, docker = false) click to toggle source
# File lib/mvnizer/project.rb, line 8
def initialize(group_id, artifact_id, version, type, dependencies = [],
               scope = nil, plugins = [], main = nil, docker = false)
  @group_id = group_id
  @artifact_id = artifact_id
  @version = version
  @type = type
  @dependencies = dependencies
  @scope = scope
  @plugins = plugins
  @main = main
  @docker = docker
end

Public Instance Methods

==(other) click to toggle source

Check whether the project coordinates of this project match the ones of the other project.

# File lib/mvnizer/project.rb, line 31
def ==(other)
  (group_id == other.group_id \
   && artifact_id == other.artifact_id \
   && version == other.version \
   && type == other.type)
end
add_dependency(dependency) click to toggle source
# File lib/mvnizer/project.rb, line 21
def add_dependency(dependency)
  @dependencies << dependency
end
add_plugin(plugin) click to toggle source
# File lib/mvnizer/project.rb, line 25
def add_plugin(plugin)
  @plugins << plugin
end
package_name() click to toggle source
# File lib/mvnizer/project.rb, line 38
def package_name
  package = artifact_id
  package = "#{group_id}.#{package}" unless group_id == nil
  package.gsub(/\-/, "")
end
to_s() click to toggle source

Converts project into its coordinates representation.

# File lib/mvnizer/project.rb, line 45
def to_s
  "#{group_id}:#{artifact_id}:#{version}:#{type}:#{scope}"
end