1
0
Fork 0
mirror of https://github.com/awesome-print/awesome_print synced 2023-03-27 23:22:34 -04:00

Don't load ActionView extension unless ActionView::Base is defined

This commit is contained in:
Mike Dvorkin 2011-12-05 13:33:05 -08:00
parent 2514c74440
commit 2ad522d36e
3 changed files with 3 additions and 3 deletions

View file

@ -23,7 +23,7 @@ unless defined?(AwesomePrint)
require File.dirname(__FILE__) + "/awesome_print/ext/active_support" if defined?(ActiveSupport) || (defined?(IRB) && ENV['RAILS_ENV'])
# Load remaining extensions.
require File.dirname(__FILE__) + "/awesome_print/ext/action_view" if defined?(ActionView)
require File.dirname(__FILE__) + "/awesome_print/ext/action_view" if defined?(ActionView::Base)
require File.dirname(__FILE__) + "/awesome_print/ext/mongo_mapper" if defined?(MongoMapper)
require File.dirname(__FILE__) + "/awesome_print/ext/mongoid" if defined?(Mongoid)
require File.dirname(__FILE__) + "/awesome_print/ext/nokogiri" if defined?(Nokogiri)

View file

@ -17,4 +17,4 @@ module AwesomePrint
end
Logger.send(:include, AwesomePrint::Logger)
ActiveSupport::BufferedLogger.send(:include, AwesomePrint::Logger) if defined?(::ActiveSupport::BufferedLogger)
ActiveSupport::BufferedLogger.send(:include, AwesomePrint::Logger) if defined?(ActiveSupport::BufferedLogger)

View file

@ -15,4 +15,4 @@ module AwesomePrint
end
end
ActionView::Base.send(:include, AwesomePrint::ActionView) if defined?(ActionView)
ActionView::Base.send(:include, AwesomePrint::ActionView)