Module: RakeAudit::TaskPatch

Defined in:
lib/rake_audit/task_patch.rb

Overview

Module prepended into Rake::Task so that every executed task is routed through an ExecutionRecorder. Prepending lets us wrap #execute while still delegating to the original implementation via super.

Instance Method Summary collapse

Instance Method Details

#execute(args = nil) ⇒ Object

Intercept Rake task execution.

Parameters:

  • args (Object, nil) (defaults to: nil)

    arguments Rake passes to the task.

Returns:

  • (Object)

    the original #execute return value.

Raises:

  • (Exception)

    propagates whatever the underlying task raised.



15
16
17
# File 'lib/rake_audit/task_patch.rb', line 15

def execute(args = nil)
  ExecutionRecorder.new(task: self, args: args).record { super }
end