Skip to content

Commit

Permalink
Passes in 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Yehuda Katz + Carl Lerche committed Jun 23, 2009
1 parent 4417a19 commit 1b844e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions actionpack/test/lib/fixture_template.rb
Expand Up @@ -12,7 +12,7 @@ def find_templates(name, details, prefix, partial)
@hash.select { |k,v| k =~ regexp }.each do |path, source|
templates << Template.new(source, path, *path_to_details(path))
end
templates
templates.sort_by {|t| -t.details.values.compact.size }
end
end
end
Expand Down Expand Up @@ -44,15 +44,15 @@ def details_to_regexp(name, details, prefix, partial)
k == :formats ? formats_regexp : ''
end
end

%r'^#{Regexp.escape(path)}#{extensions}#{handler_regexp}$'
end

# TODO: fix me
# :api: plugin
def path_to_details(path)
# [:erb, :format => :html, :locale => :en, :partial => true/false]
if m = path.match(%r'(_)?[\w-]+(\.[\w-]+)*\.(\w+)$')
if m = path.match(%r'(_)?[\w-]+((?:\.[\w-]+)*)\.(\w+)$')
partial = m[1] == '_'
details = (m[2]||"").split('.').reject { |e| e.empty? }
handler = Template.handler_class_for_extension(m[3])
Expand Down

0 comments on commit 1b844e4

Please sign in to comment.