Class: Rstreet::FilesReader

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

Class Method Summary collapse

Class Method Details

.read_all(dir) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/files_reader.rb', line 5

def self.read_all(dir)
  dir = File.realpath dir
  # TODO: print if verbose
  # puts "Found files in #{@dir}:"

  files = Dir.glob("#{dir}/**/*").to_set
  dirs = Dir.glob("#{dir}/**/*/").map { |d| d[0..-2] }.to_set

  # puts files.inspect
  # puts ""
  # puts dirs.inspect

  files.subtract(dirs).to_a
end