Class: Maven::Plugin

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

Instance Attribute Summary collapse

Attributes inherited from Base

#parent

Instance Method Summary collapse

Methods inherited from Base

#skip_to, #until

Constructor Details

#initialize(name) ⇒ Plugin

Returns a new instance of Plugin.



283
284
285
# File 'lib/maven.rb', line 283

def initialize(name)
  @name = name
end

Instance Attribute Details

#artifact_idObject

Returns the value of attribute artifact_id.



280
281
282
# File 'lib/maven.rb', line 280

def artifact_id
  @artifact_id
end

#descriptionObject

Returns the value of attribute description.



279
280
281
# File 'lib/maven.rb', line 279

def description
  @description
end

#goal_prefixObject

Returns the value of attribute goal_prefix.



280
281
282
# File 'lib/maven.rb', line 280

def goal_prefix
  @goal_prefix
end

#goalsObject

Returns the value of attribute goals.



281
282
283
# File 'lib/maven.rb', line 281

def goals
  @goals
end

#group_idObject

Returns the value of attribute group_id.



280
281
282
# File 'lib/maven.rb', line 280

def group_id
  @group_id
end

#nameObject

Returns the value of attribute name.



279
280
281
# File 'lib/maven.rb', line 279

def name
  @name
end

#versionObject

Returns the value of attribute version.



280
281
282
# File 'lib/maven.rb', line 280

def version
  @version
end

Instance Method Details

#prepareObject



287
288
289
290
# File 'lib/maven.rb', line 287

def prepare
  super
  goals.each{|goal| goal.prepare}
end

#process(line) ⇒ Object



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'lib/maven.rb', line 292

def process(line)
  case @status || :none
  when :none
    skip_to(/^#{'-' * 40}/, :header)
  when :header
    self.until(line, /^Description\:/, :description) do
      key, value = *line.split(':', 2)
      words = *key.split(' ')
      send("#{words.map{|s|s.downcase}.join('_')}=", value.strip)
    end
  when :description
    self.until(line, /^Mojos\:/, :to_mojos) do
      self.description ||= []
      self.description << line.strip
    end
  when :to_mojos
    skip_to(/^#{'=' * 40}/, :goals)
  when :goals
    if /^Goal\: \'(.*)\'/ =~ line
      goal = Goal.new(self, $1)
      self.goals ||= []
      self.goals << goal
      goal
    else
      self
    end
  else
    raise "unimplemented"
  end
end