Class: Collector

Inherits:
Object
  • Object
show all
Includes:
Methadone::CLILogging
Defined in:
lib/filentory/collector.rb

Instance Method Summary collapse

Instance Method Details

#collect(path) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/filentory/collector.rb', line 9

def collect(path)
  result = Array.new
  @pathname = Pathname.new(path)

  Find.find(path) do |file|
    if File.directory?(file)
      info "skipping #{file}"
      next
    end
    result << extract_file_infos(file)
  end

  result
end