From 9853134b4fec468962260f0e713d2f87046eb8b3 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Tue, 26 Aug 2008 15:13:28 -0500 Subject: Require missing libraries and check for defined ActionController constant so ActionView can be used standalone --- actionpack/lib/action_view/helpers/text_helper.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/helpers/text_helper.rb') diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index f9096d0029..ccd6c54cc8 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -1,5 +1,14 @@ require 'action_view/helpers/tag_helper' -require 'html/document' + +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: -- cgit v1.2.3