Class: Fixman::RawTask

Inherits:
Object
  • Object
show all
Includes:
Utilities
Defined in:
lib/fixman/raw_task.rb

Instance Method Summary collapse

Methods included from Utilities

#error

Constructor Details

#initialize(params) ⇒ RawTask

Returns a new instance of RawTask.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/fixman/raw_task.rb', line 8

def initialize params
  # Common to commands, cleanup, condition
  @name = params[:name]
  @target_placeholder = params[:target_placeholder]

  # Command to execute and check exit status
  @command = params[:command]
  @variables = params[:variables] || []

  # Condition to run the task
  @condition = params[:condition]

  # Clean up
  @cleanup = params[:cleanup]
end

Instance Method Details

#refineObject



24
25
26
27
28
29
30
31
32
# File 'lib/fixman/raw_task.rb', line 24

def refine
  condition_proc = refine_condition
  cleanup_proc = refine_cleanup
  command_procs = refine_command

  command_procs.map do |command_proc|
    Task.new @name, condition_proc, command_proc, cleanup_proc
  end
end