Class: Rake::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/ext/rake.rb,
lib/ext/rake.rb

Direct Known Subclasses

RemoteTask

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.invoke_if_defined(task_name, module_name, error_message = nil) ⇒ Object

Invokes the task named task_name if the module_name has been defined. It is the mechanism for delegating commands out of the core to modules specific for your application



45
46
47
48
49
50
51
52
53
54
# File 'lib/ext/rake.rb', line 45

def self.invoke_if_defined(task_name, module_name, error_message = nil)
  module_value = Rake::RemoteTask.fetch(module_name, false)
  if module_value
    # define delegated tasks
    eval("Yad::#{module_name.to_s.classify}::#{module_value.to_s.classify}.define_tasks")
    Rake::Task[task_name].invoke
  elsif error_message
    raise ArgumentError, error_message
  end
end

Instance Method Details

#execute(args = nil) ⇒ Object



62
63
64
# File 'lib/ext/rake.rb', line 62

def execute(args = nil)
  task_original_execute
end

#task_original_executeObject



60
# File 'lib/ext/rake.rb', line 60

alias task_original_execute execute