From 66a4585f8830d8f37e62a63df3d095b6284b2a35 Mon Sep 17 00:00:00 2001 From: Yehuda Katz + Carl Lerche Date: Tue, 1 Sep 2009 15:54:29 -0700 Subject: Fix the */* with Net::HTTP bug [#3100 state:resolved] --- actionpack/lib/action_view/template/resolver.rb | 31 +++++++------------------ 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb index 0b4c62d4d0..4442db22f6 100644 --- a/actionpack/lib/action_view/template/resolver.rb +++ b/actionpack/lib/action_view/template/resolver.rb @@ -72,26 +72,10 @@ module ActionView @path = Pathname.new(path).expand_path end - # TODO: This is the currently needed API. Make this suck less - # ==== - attr_reader :path - def to_s - path.to_s - end - - def to_str - path.to_s - end - - def ==(path) - to_str == path.to_str - end - - def eql?(path) - to_str == path.to_str + @path.to_s end - # ==== + alias to_path to_s def find_templates(name, details, prefix, partial, root = "#{@path}/") if glob = details_to_glob(name, details, prefix, partial, root) @@ -118,13 +102,16 @@ module ActionView extensions = "" [:locales, :formats].each do |k| - extensions << if exts = details[k] - '{' + exts.map {|e| ".#{e},"}.join + '}' + # TODO: OMG NO + if details[k] == [:"*/*"] + extensions << formats_glob if k == :formats + elsif exts = details[k] + extensions << '{' + exts.map {|e| ".#{e},"}.join + '}' else - k == :formats ? formats_glob : '' + extensions << formats_glob if k == :formats end end - + "#{root}#{path}#{extensions}#{handler_glob}" end end -- cgit v1.2.3