Class: FileSetWorks::Population::EveryPath

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

Direct Known Subclasses

HighestPath, LowestPath

Instance Method Summary collapse

Constructor Details

#initialize(file_rep, search_paths) ⇒ EveryPath

Returns a new instance of EveryPath.



33
34
35
36
# File 'lib/fileset.rb', line 33

def initialize(file_rep, search_paths)
  @rep = file_rep
  @search_paths = search_paths
end

Instance Method Details

#pathsObject



51
52
53
54
55
# File 'lib/fileset.rb', line 51

def paths
  @search_paths.each do |sp|
    yield sp
  end
end

#per_path(search_path) ⇒ Object



57
58
59
# File 'lib/fileset.rb', line 57

def per_path(search_path)
  @rep.create_in(search_path)
end

#populateObject



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/fileset.rb', line 39

def populate
  catch :done do
    paths do |sp|
      begin
        per_path(sp)
      rescue SystemCallError
        next
      end
    end
  end
end