Class/Module Index [+]

Quicksearch

Nanoc::CLI::Commands::Compile::TimingRecorder

Records the time spent per filter and per item representation

Public Class Methods

enable_for?(command_runner) click to toggle source

@see Listener#enable_for?

# File lib/nanoc/cli/commands/compile.rb, line 158
def self.enable_for?(command_runner)
  command_runner.options.fetch(:verbose, false)
end
new(params={}) click to toggle source

@option params [Array<Nanoc::ItemRep>] :reps The list of item representations in the site

# File lib/nanoc/cli/commands/compile.rb, line 163
def initialize(params={})
  @filter_times = {}

  @reps       = params.fetch(:reps)
end

Public Instance Methods

start() click to toggle source

@see Listener#start

# File lib/nanoc/cli/commands/compile.rb, line 170
def start
  Nanoc::NotificationCenter.on(:filtering_started) do |rep, filter_name|
    @filter_times[filter_name] ||= []
    @filter_times[filter_name] << Time.now
  end
  Nanoc::NotificationCenter.on(:filtering_ended) do |rep, filter_name|
    @filter_times[filter_name] << Time.now - @filter_times[filter_name].pop
  end
end
stop() click to toggle source

@see Listener#stop

# File lib/nanoc/cli/commands/compile.rb, line 181
def stop
  super
  self.print_profiling_feedback
end

Protected Instance Methods

[Validate]

Generated with the Darkfish Rdoc Generator 2.