Class: PVN::Diff::LocalDiffer

Inherits:
Differ
  • Object
show all
Defined in:
lib/pvn/diff/local_differ.rb

Instance Attribute Summary

Attributes inherited from Differ

#revision, #whitespace

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ LocalDiffer

Returns a new instance of LocalDiffer.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/pvn/diff/local_differ.rb', line 12

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

  allentries = Array.new

  # we sort only the sub-entries, so the order in which paths were specified
  # is preserved

  paths.each do |path|
    elmt = PVN::IO::Element.new :local => path
    entries = elmt.find_files_by_status
    allentries.concat entries.sort_by { |n| n.path }
  end

  allentries.each do |entry|
    next if entry.status == 'unversioned'
    path = LocalPath.new entry
    path.show_diff @whitespace
  end
end

Instance Method Details

#use_cache?Boolean

$$$ todo: integrate these, from old diff/diffcmd

Returns:

  • (Boolean)


37
38
39
# File 'lib/pvn/diff/local_differ.rb', line 37

def use_cache?
  super && !against_head?
end