diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-09-01 15:54:29 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-09-01 15:54:29 -0700 |
commit | 66a4585f8830d8f37e62a63df3d095b6284b2a35 (patch) | |
tree | fe57b170898264bb91eadbfe8d091cf7acf17b74 /actionpack/lib/action_view | |
parent | bd53ebde72316abe2f4cdfd959a4e05bc0732b02 (diff) | |
download | rails-66a4585f8830d8f37e62a63df3d095b6284b2a35.tar.gz rails-66a4585f8830d8f37e62a63df3d095b6284b2a35.tar.bz2 rails-66a4585f8830d8f37e62a63df3d095b6284b2a35.zip |
Fix the */* with Net::HTTP bug [#3100 state:resolved]
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/template/resolver.rb | 31 |
1 files changed, 9 insertions, 22 deletions
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 - # ==== <suck> - 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 - # ==== </suck> + 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 |