| Class | Pathname |
| In: |
lib/standard/facets/pathname.rb
|
| Parent: | Object |
| to_s | -> | to_str |
| Alias to_s to to_str when to_str is not defined. | ||
| + | -> | / |
| Try to get this into standard Pathname class. | ||
Home constant for building paths from root directory onward.
TODO: Pathname#home needs to be more robust.
Recursively visit a directory located by its path, yielding each resource as its full matching pathname object. If called on a file, yield the file.
Example use case:
# Locate any file but *.haml within app/**/*
Pathname.new("app").visit do |f|
next unless f.to_s =~ /\.haml$/
f
end
TODO: Use map instead of each ?
CREDIT: Jean-Denis Vauguet