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:
parent
2514c74440
commit
2ad522d36e
3 changed files with 3 additions and 3 deletions
|
@ -23,7 +23,7 @@ unless defined?(AwesomePrint)
|
||||||
require File.dirname(__FILE__) + "/awesome_print/ext/active_support" if defined?(ActiveSupport) || (defined?(IRB) && ENV['RAILS_ENV'])
|
require File.dirname(__FILE__) + "/awesome_print/ext/active_support" if defined?(ActiveSupport) || (defined?(IRB) && ENV['RAILS_ENV'])
|
||||||
|
|
||||||
# Load remaining extensions.
|
# 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/mongo_mapper" if defined?(MongoMapper)
|
||||||
require File.dirname(__FILE__) + "/awesome_print/ext/mongoid" if defined?(Mongoid)
|
require File.dirname(__FILE__) + "/awesome_print/ext/mongoid" if defined?(Mongoid)
|
||||||
require File.dirname(__FILE__) + "/awesome_print/ext/nokogiri" if defined?(Nokogiri)
|
require File.dirname(__FILE__) + "/awesome_print/ext/nokogiri" if defined?(Nokogiri)
|
||||||
|
|
|
@ -17,4 +17,4 @@ module AwesomePrint
|
||||||
end
|
end
|
||||||
|
|
||||||
Logger.send(:include, AwesomePrint::Logger)
|
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)
|
||||||
|
|
|
@ -15,4 +15,4 @@ module AwesomePrint
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ActionView::Base.send(:include, AwesomePrint::ActionView) if defined?(ActionView)
|
ActionView::Base.send(:include, AwesomePrint::ActionView)
|
||||||
|
|
Loading…
Reference in a new issue