diff options
author | David Chelimsky <dchelimsky@gmail.com> | 2010-05-02 09:20:17 -0500 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-05-02 22:45:54 +0200 |
commit | 91125f9927ffbe1a16494910ae0e8228a4400439 (patch) | |
tree | 1af9a8f241007153e6c35bd3cc41489dccd043c7 /actionpack/test/lib | |
parent | a76c7e68d5e39f5962d9cb85c98e6a8e96f8b3af (diff) | |
download | rails-91125f9927ffbe1a16494910ae0e8228a4400439.tar.gz rails-91125f9927ffbe1a16494910ae0e8228a4400439.tar.bz2 rails-91125f9927ffbe1a16494910ae0e8228a4400439.zip |
move FixtureResolver to a file that is accessible outside Rails' own tests
[#4522 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/test/lib')
-rw-r--r-- | actionpack/test/lib/fixture_template.rb | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/actionpack/test/lib/fixture_template.rb b/actionpack/test/lib/fixture_template.rb deleted file mode 100644 index b49ccd39ca..0000000000 --- a/actionpack/test/lib/fixture_template.rb +++ /dev/null @@ -1,29 +0,0 @@ -module ActionView #:nodoc: - class FixtureResolver < PathResolver - attr_reader :hash - - def initialize(hash = {}) - super() - @hash = hash - end - - private - - def query(path, exts, formats) - query = Regexp.escape(path) - exts.each do |ext| - query << '(' << ext.map {|e| e && Regexp.escape(".#{e}") }.join('|') << '|)' - end - - templates = [] - @hash.select { |k,v| k =~ /^#{query}$/ }.each do |path, source| - handler, format = extract_handler_and_format(path, formats) - templates << Template.new(source, path, handler, - :virtual_path => path, :format => format) - end - - templates.sort_by {|t| -t.identifier.match(/^#{query}$/).captures.reject(&:blank?).size } - end - - end -end
\ No newline at end of file |