1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Autoload HTML::Document and sanitizers

This commit is contained in:
Jeremy Kemper 2008-11-23 19:12:00 -08:00
parent fb4bb93d43
commit 2dd0ec48a5
6 changed files with 12 additions and 29 deletions

View file

@ -1,6 +1,3 @@
require 'rexml/document'
require 'html/document'
module ActionController
module Assertions
# A small suite of assertions that test responses from Rails applications.

View file

@ -3,8 +3,7 @@
# Under MIT and/or CC By license.
#++
require 'rexml/document'
require 'html/document'
require 'action_controller/vendor/html-scanner'
module ActionController
module Assertions

View file

@ -1,6 +1,3 @@
require 'rexml/document'
require 'html/document'
module ActionController
module Assertions
# Pair of assertions to testing elements in the HTML output of the response.
@ -127,4 +124,4 @@ module ActionController
end
end
end
end
end

View file

@ -0,0 +1,9 @@
$LOAD_PATH << "#{File.dirname(__FILE__)}/html-scanner"
module HTML
autoload :Document, 'html/document'
autoload :Sanitizer, 'html/sanitizer'
autoload :FullSanitizer, 'html/sanitizer'
autoload :LinkSanitizer, 'html/sanitizer'
autoload :WhiteListSanitizer, 'html/sanitizer'
end

View file

@ -1,14 +1,5 @@
require 'action_view/helpers/tag_helper'
begin
require 'html/document'
rescue LoadError
html_scanner_path = "#{File.dirname(__FILE__)}/../../action_controller/vendor/html-scanner"
if File.directory?(html_scanner_path)
$:.unshift html_scanner_path
require 'html/document'
end
end
require 'action_controller/vendor/html-scanner'
module ActionView
module Helpers #:nodoc:

View file

@ -1,15 +1,5 @@
require 'action_view/helpers/tag_helper'
begin
require 'html/document'
rescue LoadError
html_scanner_path = "#{File.dirname(__FILE__)}/../../action_controller/vendor/html-scanner"
if File.directory?(html_scanner_path)
$:.unshift html_scanner_path
require 'html/document'
end
end
module ActionView
module Helpers #:nodoc:
# The TextHelper module provides a set of methods for filtering, formatting