lib/rake/funnel/tasks/timing.rb in rake-funnel-0.0.6.pre vs lib/rake/funnel/tasks/timing.rb in rake-funnel-0.1.0.pre
- old
+ new
@@ -1,20 +1,17 @@
-require 'rake'
require 'rake/tasklib'
-Dir["#{File.dirname(__FILE__)}/timing_support/*.rb"].each do |path|
- require path
-end
-
module Rake::Funnel::Tasks
class Timing < Rake::TaskLib
+ include Rake::Funnel::Support::Timing
+
attr_accessor :name
attr_reader :stats
def initialize(name = :timing)
@name = name
- @stats = TimingSupport::Statistics.new
+ @stats = Statistics.new
yield self if block_given?
define
end
@@ -26,11 +23,11 @@
private
def define
patches.each { |p| p.apply! }
task @name, :failed do |task, args|
- TimingSupport::Report.new(@stats, args).render
+ Report.new(@stats, args).render
end
timing_task = Rake.application.current_scope.path_with_task_name(@name)
Rake.application.top_level_tasks.push(timing_task)
@@ -41,10 +38,10 @@
@patches ||= [report, benchmark]
end
def report
Rake::Funnel::Support::Patch.new do |p|
- report_invoker = -> (opts) { TimingSupport::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)