Class: Fudge::Tasks::CompositeTask

Inherits:
Task
  • Object
show all
Defined in:
lib/fudge/tasks/composite_task.rb

Overview

Allow for tasks to be combined

Direct Known Subclasses

Build, CleanBundlerEnv, EachDirectory, InDirectory

Instance Attribute Summary collapse

Attributes inherited from Task

#args, #options

Instance Method Summary collapse

Methods inherited from Task

#initialize, name

Constructor Details

This class inherits a constructor from Fudge::Tasks::Task

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



7
8
9
# File 'lib/fudge/tasks/composite_task.rb', line 7

def description
  @description
end

Instance Method Details

#run(options = {}) ⇒ Object

Runs the task (by default running all other tasks in order)



15
16
17
18
19
20
21
22
# File 'lib/fudge/tasks/composite_task.rb', line 15

def run(options={})
  formatter = get_formatter(options)
  tasks.each do |t|
    apply_directory_settings(t)
    output_message(t, formatter)
    return unless t.run(options)
  end
end

#tasksObject

Define task array



10
11
12
# File 'lib/fudge/tasks/composite_task.rb', line 10

def tasks
  @tasks ||= []
end