Class: PVN::Pct::Differ

Inherits:
Object
  • Object
show all
Includes:
Logue::Loggable
Defined in:
lib/pvn/pct/differ.rb

Direct Known Subclasses

LocalDiffer, RepositoryDiffer

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Differ

Returns a new instance of Differ.



11
12
13
# File 'lib/pvn/pct/differ.rb', line 11

def initialize options
  show_diff_counts options
end

Instance Method Details

#show_diff_counts(options) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/pvn/pct/differ.rb', line 15

def show_diff_counts options
  paths = options.paths
  paths = %w{ . } if paths.empty?

  total = PVN::DiffCount.new 0, 0, 'total'

  paths.each do |path|
    diff_counts = get_diff_counts path, options
    
    diff_counts.each do |dc|
      total << dc
      dc.print
    end
  end

  total.print
end