Module: LogicalConstruct::SatisfiableManager

Included in:
Manifest, ResolvingTask
Defined in:
lib/logical-construct/resolving-task.rb

Overview

Ensures that all it's deps are satisfied before proceeding - the action for ResolvingTasks is all about satisfying deps.

Key is how Rake invokes tasks: Task runner calls Task#invoke Which is "setup args" and #invoke_with_call_chain which is return if @already_invoked and #invoke_prerequisites which is prereqs.each{|pr| pr.invoke_with_call_chain } and #execute if needed

So, of note: you'll only get invoked once, ever You'll only be executed if #needed? Deps will get invoked (ish) even if not #needed?

Instance Method Summary collapse

Instance Method Details

#add_satisfiable(task) ⇒ Object



36
37
38
39
40
# File 'lib/logical-construct/resolving-task.rb', line 36

def add_satisfiable(task)
  task = task.rake_task if task.respond_to? :rake_task
  satisfiables << task
  task.enhance([rake_task.name])
end

#default_configuration(*configurables) ⇒ Object



22
23
24
25
26
27
# File 'lib/logical-construct/resolving-task.rb', line 22

def default_configuration(*configurables)
  super
  self.satisfiables = configurables.find_all do |conf|
    conf.is_a? SatisfiableTask
  end.map{|sat| sat.rake_task}
end

#defineObject



29
30
31
32
33
34
# File 'lib/logical-construct/resolving-task.rb', line 29

def define
  super
  satisfiables.each do |sat|
    sat.enhance([rake_task.name])
  end
end