9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/rake_bubbler/bubble_task.rb', line 9
def self.included(klass)
klass.class_eval do
def invoke_with_output_capture(*params)
return invoke_without_output_capture(*params) unless RakeBubbler.capture_task?(name)
duration, error = nil
started = Time.now
output = RakeBubbler.capture_output do
time = Benchmark.measure(name) do
begin
invoke_without_output_capture(*params)
rescue Exception => e
error = e
end
end
duration = time.real
end
RakeBubbler.executed(name, duration, output, started, error)
raise error if error
end
alias_method :invoke_without_output_capture, :invoke
alias_method :invoke, :invoke_with_output_capture
end
end
|