Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. class PathSet #:nodoc:
  2. def find_file(path, prefixes = [], *args)
  3. _find_all(path, prefixes, args, true).first || raise(MissingTemplate.new(self, path, prefixes, *args))
  4. end
  5. private
  6. def _find_all(path, prefixes, args, outside_app)
  7. prefixes = [prefixes] if String === prefixes
  8. prefixes.each do |prefix|
  9. paths.each do |resolver|
  10. if outside_app
  11. templates = resolver.find_all_anywhere(path, prefix, *args)
  12. else
  13. templates = resolver.find_all(path, prefix, *args)
  14. end
  15. return templates unless templates.empty?
  16. end
  17. end
  18. []
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement