2016-06-07 20:17:31 -04:00
|
|
|
# Copyright (c) 2010-2016 Michael Dvorkin and contributors
|
2010-11-08 22:24:07 -05:00
|
|
|
#
|
|
|
|
# Awesome Print is freely distributable under the terms of MIT license.
|
|
|
|
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
#
|
2012-09-05 22:41:54 -04:00
|
|
|
# AwesomePrint might be loaded implicitly through ~/.irbrc or ~/.pryrc
|
|
|
|
# so do nothing for subsequent requires.
|
2010-11-08 22:24:07 -05:00
|
|
|
#
|
2012-09-03 14:54:32 -04:00
|
|
|
unless defined?(AwesomePrint::Inspector)
|
2016-08-31 14:26:24 -04:00
|
|
|
%w(awesome_method_array string method object class kernel).each do |file|
|
2016-06-07 20:42:48 -04:00
|
|
|
require "awesome_print/core_ext/#{file}"
|
2011-05-13 17:42:04 -04:00
|
|
|
end
|
2010-11-08 22:24:07 -05:00
|
|
|
|
2016-06-07 21:12:55 -04:00
|
|
|
require 'awesome_print/custom_defaults'
|
|
|
|
require 'awesome_print/inspector'
|
|
|
|
require 'awesome_print/formatter'
|
|
|
|
require 'awesome_print/version'
|
|
|
|
require 'awesome_print/core_ext/logger' if defined?(Logger)
|
2012-09-05 22:41:54 -04:00
|
|
|
#
|
2011-11-09 01:03:16 -05:00
|
|
|
# Load the following under normal circumstances as well as in Rails
|
2012-09-05 22:41:54 -04:00
|
|
|
# console when required from ~/.irbrc or ~/.pryrc.
|
|
|
|
#
|
2016-06-07 21:12:55 -04:00
|
|
|
require 'awesome_print/ext/active_record' if defined?(ActiveRecord) || AwesomePrint.rails_console?
|
|
|
|
require 'awesome_print/ext/active_support' if defined?(ActiveSupport) || AwesomePrint.rails_console?
|
2012-09-05 22:41:54 -04:00
|
|
|
#
|
2011-11-29 22:58:55 -05:00
|
|
|
# Load remaining extensions.
|
2012-09-05 22:41:54 -04:00
|
|
|
#
|
2015-07-31 17:44:05 -04:00
|
|
|
if defined?(ActiveSupport.on_load)
|
2014-02-14 14:17:18 -05:00
|
|
|
ActiveSupport.on_load(:action_view) do
|
2016-06-07 21:12:55 -04:00
|
|
|
require 'awesome_print/ext/action_view'
|
2014-02-14 14:17:18 -05:00
|
|
|
end
|
|
|
|
end
|
2016-06-07 21:12:55 -04:00
|
|
|
require 'awesome_print/ext/mongo_mapper' if defined?(MongoMapper)
|
|
|
|
require 'awesome_print/ext/mongoid' if defined?(Mongoid)
|
|
|
|
require 'awesome_print/ext/nokogiri' if defined?(Nokogiri)
|
|
|
|
require 'awesome_print/ext/nobrainer' if defined?(NoBrainer)
|
|
|
|
require 'awesome_print/ext/ripple' if defined?(Ripple)
|
|
|
|
require 'awesome_print/ext/sequel' if defined?(Sequel)
|
|
|
|
require 'awesome_print/ext/ostruct' if defined?(OpenStruct)
|
2011-05-13 17:42:04 -04:00
|
|
|
end
|