Class/Module Index [+]

Quicksearch

Nanoc::CLI::Commands::Compile::GCController

Controls garbage collection so that it only occurs once every 20 items

Public Class Methods

enable_for?(command_runner) click to toggle source

@see Listener#enable_for?

# File lib/nanoc/cli/commands/compile.rb, line 262
def self.enable_for?(command_runner)
  !ENV.key?('TRAVIS')
end
new(params = {}) click to toggle source
# File lib/nanoc/cli/commands/compile.rb, line 266
def initialize(params = {})
  @gc_count = 0
end

Public Instance Methods

start() click to toggle source

@see Listener#start

# File lib/nanoc/cli/commands/compile.rb, line 271
def start
  Nanoc::NotificationCenter.on(:compilation_started) do |rep|
    if @gc_count % 20 == 0
      GC.enable
      GC.start
      GC.disable
    end
    @gc_count += 1
  end
end
stop() click to toggle source

@see Listener#stop

# File lib/nanoc/cli/commands/compile.rb, line 283
def stop
  super
  GC.enable
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.