Class: Compath::Finder

Inherits:
Object
  • Object
show all
Defined in:
lib/compath/finder.rb

Instance Method Summary collapse

Instance Method Details

#filesObject



3
4
5
6
7
8
# File 'lib/compath/finder.rb', line 3

def files
  @files ||= begin
               files = `git ls-files -z`.split("\x0")
               files.map {|file| Pathname.new(file) }
             end
end

#pathsObject



10
11
12
13
14
15
16
# File 'lib/compath/finder.rb', line 10

def paths
  files.each_with_object({}) do |file, hash|
    file.descend do |pathname|
      hash[pathname.to_path] = true
    end
  end
end