Method: Path#glob
- Defined in:
- lib/path/dir.rb
#glob(pattern, flags = 0) {|path| ... } ⇒ Object
Returns or yields Path objects. Prepends the (escaped for globbing) path to the pattern. See Dir.glob.
69 70 71 72 73 74 75 76 |
# File 'lib/path/dir.rb', line 69 def glob(pattern, flags = 0) pattern = "#{Path.glob_escape(@path)}/#{pattern}" if block_given? Dir.glob(pattern, flags) { |f| yield Path.new(f) } else Dir.glob(pattern, flags).map(&Path) end end |