Module: MultiDir::PathnamePatch
- Defined in:
- lib/multi_dir/pathname_patch.rb
Overview
Provide additional function to operate on directories.
Instance Method Summary collapse
Instance Method Details
#[](path) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/multi_dir/pathname_patch.rb', line 12 def [](path) if MultiDir::Paths.instance.paths.include? path.to_sym return MultiDir::Paths.instance.resolve(path) end join path.to_s end |
#glob(*patterns) ⇒ Object
8 9 10 |
# File 'lib/multi_dir/pathname_patch.rb', line 8 def glob(*patterns) Dir.glob File.join(to_s, *patterns) end |
#tempname(prefix_suffix, n = nil) ⇒ Object
20 21 22 |
# File 'lib/multi_dir/pathname_patch.rb', line 20 def tempname(prefix_suffix, n = nil) join mktmpname prefix_suffix, n end |