Prefer File.extname to regexp
FromPathLoader already calls expand_path
Combine conditional branches that do the same thing