Class: File

Inherits:
Object show all
Defined in:
lib/trellis/utils.rb

Class Method Summary collapse

Class Method Details

.find(dir, filename = "*.*", subdirs = true) ⇒ Object



181
182
183
# File 'lib/trellis/utils.rb', line 181

def self.find(dir, filename="*.*", subdirs=true) 
  Dir[ subdirs ? File.join(dir.split(/\\/), "**", filename) : File.join(dir.split(/\\/), filename)  ] 
end

.find_first(dir, filename, subdirs = false) ⇒ Object



185
186
187
# File 'lib/trellis/utils.rb', line 185

def self.find_first(dir, filename, subdirs=false)
  find(dir, filename, subdirs).first
end