Method: Rake::Task#execute

Defined in:
lib/rake/task.rb

#execute(args = nil) ⇒ Object

Execute the actions associated with this task.



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/rake/task.rb', line 227

def execute(args=nil)
  args ||= EMPTY_TASK_ARGS
  if application.options.dryrun
    application.trace "** Execute (dry run) #{name}"
    return
  end
  application.trace "** Execute #{name}" if application.options.trace
  application.enhance_with_matching_rule(name) if @actions.empty?
  @actions.each do |act|
    case act.arity
    when 1
      act.call(self)
    else
      act.call(self, args)
    end
  end
end