lib/rake/funnel/tasks/timing.rb in rake-funnel-0.18.0 vs lib/rake/funnel/tasks/timing.rb in rake-funnel-0.19.0
- old
+ new
@@ -18,23 +18,24 @@
def reset!
patches.each(&:revert!)
end
private
+
def setup_ivars(args)
@name = args.shift || :timing
@stats = Statistics.new
end
- def define(_args, &task_block)
+ def define(_args, &task_block) # rubocop:disable Metrics/AbcSize
patches.each(&:apply!)
desc 'Output task timing information' unless Rake.application.last_description
task name, :failed do |_, task_args|
- task_block.call(*[self, task_args].slice(0, task_block.arity)) if task_block
+ yield(*[self, task_args].slice(0, task_block.arity)) if task_block
Report.new(@stats, task_args).render
end
timing_task = Rake.application.current_scope.path_with_task_name(@name)
@@ -45,13 +46,13 @@
def patches
@patches ||= [report, benchmark]
end
- def report
+ def report # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
Rake::Funnel::Support::Patch.new do |p|
- report_invoker = -> (opts) { Report.new(@stats, opts).render }
+ report_invoker = ->(opts) { Report.new(@stats, opts).render }
p.setup do
Rake::Application.class_eval do
orig_display_error_message = instance_method(:display_error_message)
@@ -73,12 +74,12 @@
end
end
end
end
- def benchmark
+ def benchmark # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
Rake::Funnel::Support::Patch.new do |p|
- benchmark_invoker = -> (task, &block) { @stats.benchmark(task, &block) }
+ benchmark_invoker = ->(task, &block) { @stats.benchmark(task, &block) }
p.setup do
Rake::Task.class_eval do
orig_execute = instance_method(:execute)