Module: PathList::Finder
- Included in:
- PathList
- Defined in:
- lib/more/facets/pathlist.rb
Instance Attribute Summary collapse
-
#find_ext ⇒ Object
Returns the value of attribute find_ext.
Instance Method Summary collapse
- #find(filename, use_ext = true) ⇒ Object (also: #include?)
Instance Attribute Details
#find_ext ⇒ Object
Returns the value of attribute find_ext.
63 64 65 |
# File 'lib/more/facets/pathlist.rb', line 63 def find_ext @find_ext end |
Instance Method Details
#find(filename, use_ext = true) ⇒ Object Also known as: include?
65 66 67 68 69 70 71 72 |
# File 'lib/more/facets/pathlist.rb', line 65 def find(filename, use_ext=true) filename += '.' + @find_ext if @find_ext and use_ext to_a.each do |path| filepath = File.join(path, filename) return filepath if File.exist?( filepath ) end return nil end |