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:
parent
fb4bb93d43
commit
2dd0ec48a5
6 changed files with 12 additions and 29 deletions
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
9
actionpack/lib/action_controller/vendor/html-scanner.rb
vendored
Normal file
9
actionpack/lib/action_controller/vendor/html-scanner.rb
vendored
Normal 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
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue