From 9a650a6547d2a83004db1bf913e26a8daa1c0b6e Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 28 Dec 2009 16:28:26 -0800 Subject: Silence some trivial warnings: shadowed local vars, indentation mismatches --- actionpack/lib/action_view/template/handler.rb | 4 ++-- actionpack/lib/action_view/template/resolver.rb | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'actionpack/lib/action_view/template') 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 -- cgit v1.2.3