Class: RakeCommandFilter::RakeCommandDefinition

Inherits:
CommandDefinition show all
Defined in:
lib/rake_command_definition.rb

Overview

command that runs a rake task

Instance Attribute Summary collapse

Attributes inherited from CommandDefinition

#default_line_handling, #filter, #name

Instance Method Summary collapse

Methods inherited from CommandDefinition

#add_filter, #add_parameter, create_result, find_worst_result, result_failure, result_success, result_warning

Constructor Details

#initialize(name, test_command) ⇒ RakeCommandDefinition

Returns a new instance of RakeCommandDefinition.

Parameters:

  • name

    will invoke rake <name> to run the command



8
9
10
11
# File 'lib/rake_command_definition.rb', line 8

def initialize(name, test_command)
  super(name)
  @test_command = test_command
end

Instance Attribute Details

#test_commandObject

Returns the value of attribute test_command.



4
5
6
# File 'lib/rake_command_definition.rb', line 4

def test_command
  @test_command
end

Instance Method Details

#executeObject

Executes a rake task in a subprocess, and captures and parses the output using the filters associated with this command



16
17
18
19
# File 'lib/rake_command_definition.rb', line 16

def execute
  command = RakeCommandFilter.testing? ? test_command : "rake #{@name}"
  return execute_system(command)
end