Class: Nanoc::CLI::CompileListeners::DiffGenerator Private

Inherits:
Abstract
  • Object
show all
Defined in:
lib/nanoc/cli/compile_listeners/diff_generator.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Classes: Differ

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Abstract

#initialize, #on, #run_while, #start_safely, #stop_safely, #wrapped_start, #wrapped_stop

Constructor Details

This class inherits a constructor from Nanoc::CLI::CompileListeners::Abstract

Class Method Details

.enable_for?(command_runner, site) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

See Also:

  • Listener#enable_for?


49
50
51
# File 'lib/nanoc/cli/compile_listeners/diff_generator.rb', line 49

def self.enable_for?(command_runner, site)
  site.config[:enable_output_diff] || command_runner.options[:diff]
end

Instance Method Details

#startObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

See Also:

  • Listener#start


54
55
56
57
58
59
60
# File 'lib/nanoc/cli/compile_listeners/diff_generator.rb', line 54

def start
  setup_diffs

  on(:rep_ready_for_diff) do |raw_path, old_content, new_content|
    generate_diff_for(raw_path, old_content, new_content)
  end
end

#stopObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

See Also:

  • Listener#stop


63
64
65
# File 'lib/nanoc/cli/compile_listeners/diff_generator.rb', line 63

def stop
  teardown_diffs
end