lib/forgery/file_reader.rb
# Search a file in all load_paths, starting from last to first, so
# last takes precedence over first.
Search a file in all load_paths, starting from last to first, so
last takes precedence over first.
Search a file in all load_paths starting from last to first so last takes precedence over first .
def find(name)
      Forgery.load_paths.reverse.each do |path|
        file = "#{path}/#{@folder}/#{name}"
        return file if File.exists?(file)
      end
      raise ArgumentError.new("File '#{name}' wasn't found in '#{@folder}' folder. Searched paths: \n#{Forgery.load_paths.join('\n')}")
    end
def find ( name ) Forgery . load_paths . reverse . each do | path | file = "#{path}/#{@folder}/#{name}" return file if File . exists? ( file ) end raise ArgumentError . new ( "File '#{name}' wasn't found in '#{@folder}' folder. Searched paths: \n#{Forgery.load_paths.join('\n')}" ) end
Search a file in all load_paths, starting from last to first, so
last takes precedence over first.
Search a file in all load_paths starting from last to first so last takes precedence over first .
name
<not_specific>