Class: Cerberus::Builder::Maven2

Inherits:
Object
  • Object
show all
Defined in:
lib/cerberus/builder/maven2.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Maven2

Returns a new instance of Maven2.



6
7
8
# File 'lib/cerberus/builder/maven2.rb', line 6

def initialize(config)
  @config = config
end

Instance Attribute Details

#brokenessObject (readonly)

Returns the value of attribute brokeness.



4
5
6
# File 'lib/cerberus/builder/maven2.rb', line 4

def brokeness
  @brokeness
end

#outputObject (readonly)

Returns the value of attribute output.



4
5
6
# File 'lib/cerberus/builder/maven2.rb', line 4

def output
  @output
end

Instance Method Details

#runObject



10
11
12
13
14
15
16
# File 'lib/cerberus/builder/maven2.rb', line 10

def run
  cmd = @config[:builder, :maven2, :cmd] || 'mvn'
  task = @config[:builder, :maven2, :task] || 'test'
  @output = `#{@config[:bin_path]}#{cmd} #{system_properties} #{settings} #{task} 2>&1`
  add_error_information
  successful?
end

#successful?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/cerberus/builder/maven2.rb', line 18

def successful?
  $?.exitstatus == 0 and not @output.include?('[ERROR] BUILD FAILURE')
end