Class: Maven::Tools::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/maven/tools/project.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source = nil) ⇒ Project

Returns a new instance of Project.



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/maven/tools/project.rb', line 29

def initialize( source = nil )
  @source = source
  if @source
    @basedir ||= ::File.directory?( @source ) ? @source : 
      ::File.dirname( ::File.expand_path( @source ) )
  end
  @basedir ||= ::File.expand_path( '.' )

  @model = Model.new
  @model.model_version = '4.0.0'
  @model.name = ::File.basename( @basedir )
  @model.group_id = 'no_group_id_given'
  @model.artifact_id = model.name
  @model.version = '0.0.0'
  @current = @model
  # TODO remove once legacy code is gone
  @context = :project
end

Instance Attribute Details

#basedirObject (readonly)

Returns the value of attribute basedir.



27
28
29
# File 'lib/maven/tools/project.rb', line 27

def basedir
  @basedir
end

#currentObject (readonly)

Returns the value of attribute current.



27
28
29
# File 'lib/maven/tools/project.rb', line 27

def current
  @current
end

#modelObject (readonly)

Returns the value of attribute model.



27
28
29
# File 'lib/maven/tools/project.rb', line 27

def model
  @model
end