aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/template/handler.rb4
-rw-r--r--actionpack/lib/action_view/template/resolver.rb12
2 files changed, 6 insertions, 10 deletions
diff --git a/actionpack/lib/action_view/template/handler.rb b/actionpack/lib/action_view/template/handler.rb
index 5a46a27893..221d1bd5c5 100644
--- a/actionpack/lib/action_view/template/handler.rb
+++ b/actionpack/lib/action_view/template/handler.rb
@@ -17,8 +17,8 @@ module ActionView
end
def compile(template)
- raise "Need to implement #{self.class.name}#compile(template)"
- end
+ raise "Need to implement #{self.class.name}#compile(template)"
+ end
end
end
diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb
index a2f4ab2ef5..c6a17907ff 100644
--- a/actionpack/lib/action_view/template/resolver.rb
+++ b/actionpack/lib/action_view/template/resolver.rb
@@ -108,13 +108,9 @@ module ActionView
query << '{' << ext.map {|e| e && ".#{e}" }.join(',') << '}'
end
- Dir[query].map do |path|
- next if File.directory?(path)
- source = File.read(path)
- identifier = Pathname.new(path).expand_path.to_s
-
- Template.new(source, identifier, *path_to_details(path))
- end.compact
+ Dir[query].reject { |p| File.directory?(p) }.map do |p|
+ Template.new(File.read(p), File.expand_path(p), *path_to_details(p))
+ end
end
# # TODO: fix me
@@ -162,4 +158,4 @@ module ActionView
@paths.first.to_s
end
end
-end \ No newline at end of file
+end