Skip to content

Commit

Permalink
Move action_controller/vendor/html-scanner to action_view
Browse files Browse the repository at this point in the history
This is another step in moving Action View's dependencies in Action Pack
to Action View itself. Also, HtmlScanner seems to be better suited for
views rather than controllers.
  • Loading branch information
drogus committed Aug 25, 2012
1 parent 42bea41 commit 044d0c7
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 27 deletions.
2 changes: 1 addition & 1 deletion actionpack/lib/action_controller.rb
Expand Up @@ -59,7 +59,7 @@ def self.eager_load!

# All of these simply register additional autoloads
require 'action_view'
require 'action_controller/vendor/html-scanner'
require 'action_view/vendor/html-scanner'

# Common Active Support usage in Action Controller
require 'active_support/core_ext/class/attribute_accessors'
Expand Down
22 changes: 3 additions & 19 deletions actionpack/lib/action_controller/vendor/html-scanner.rb
@@ -1,20 +1,4 @@
$LOAD_PATH << "#{File.dirname(__FILE__)}/html-scanner"
require 'action_view/vendor/html-scanner'
require 'active_support/deprecation'

module HTML
extend ActiveSupport::Autoload

eager_autoload do
autoload :CDATA, 'html/node'
autoload :Document, 'html/document'
autoload :FullSanitizer, 'html/sanitizer'
autoload :LinkSanitizer, 'html/sanitizer'
autoload :Node, 'html/node'
autoload :Sanitizer, 'html/sanitizer'
autoload :Selector, 'html/selector'
autoload :Tag, 'html/node'
autoload :Text, 'html/node'
autoload :Tokenizer, 'html/tokenizer'
autoload :Version, 'html/version'
autoload :WhiteListSanitizer, 'html/sanitizer'
end
end
ActiveSupport::Deprecation.warn 'vendored html-scanner was moved to action_view, please require "action_view/vendor/html-scanner" instead'
2 changes: 1 addition & 1 deletion actionpack/lib/action_dispatch/testing/assertions/dom.rb
@@ -1,4 +1,4 @@
require 'action_controller/vendor/html-scanner'
require 'action_view/vendor/html-scanner'

module ActionDispatch
module Assertions
Expand Down
@@ -1,4 +1,5 @@
require 'action_controller/vendor/html-scanner'
require 'action_view/vendor/html-scanner'
require 'active_support/core_ext/object/inclusion'

#--
# Copyright (c) 2006 Assaf Arkin (http://labnotes.org)
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_dispatch/testing/assertions/tag.rb
@@ -1,4 +1,4 @@
require 'action_controller/vendor/html-scanner'
require 'action_view/vendor/html-scanner'

module ActionDispatch
module Assertions
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/helpers/sanitize_helper.rb
@@ -1,5 +1,5 @@
require 'active_support/core_ext/object/try'
require 'action_controller/vendor/html-scanner'
require 'action_view/vendor/html-scanner'

module ActionView
# = Action View Sanitize Helpers
Expand Down
20 changes: 20 additions & 0 deletions actionpack/lib/action_view/vendor/html-scanner.rb
@@ -0,0 +1,20 @@
$LOAD_PATH << "#{File.dirname(__FILE__)}/html-scanner"

module HTML
extend ActiveSupport::Autoload

eager_autoload do
autoload :CDATA, 'html/node'
autoload :Document, 'html/document'
autoload :FullSanitizer, 'html/sanitizer'
autoload :LinkSanitizer, 'html/sanitizer'
autoload :Node, 'html/node'
autoload :Sanitizer, 'html/sanitizer'
autoload :Selector, 'html/selector'
autoload :Tag, 'html/node'
autoload :Text, 'html/node'
autoload :Tokenizer, 'html/tokenizer'
autoload :Version, 'html/version'
autoload :WhiteListSanitizer, 'html/sanitizer'
end
end
2 changes: 1 addition & 1 deletion actionpack/test/controller/action_pack_assertions_test.rb
@@ -1,5 +1,5 @@
require 'abstract_unit'
require 'action_controller/vendor/html-scanner'
require 'action_view/vendor/html-scanner'
require 'controller/fake_controllers'

class ActionPackAssertionsController < ActionController::Base
Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/controller/integration_test.rb
@@ -1,6 +1,6 @@
require 'abstract_unit'
require 'controller/fake_controllers'
require 'action_controller/vendor/html-scanner'
require 'action_view/vendor/html-scanner'

class SessionTest < ActiveSupport::TestCase
StubApp = lambda { |env|
Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/controller/selector_test.rb
Expand Up @@ -5,7 +5,7 @@

require 'abstract_unit'
require 'controller/fake_controllers'
require 'action_controller/vendor/html-scanner'
require 'action_view/vendor/html-scanner'

class SelectorTest < ActiveSupport::TestCase
#
Expand Down

0 comments on commit 044d0c7

Please sign in to comment.