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

Improve require readability

This commit is contained in:
Mauro George 2016-06-07 21:42:48 -03:00 committed by Waldyr de Souza
parent 532249d05c
commit 46ba51bd19

View file

@ -9,32 +9,32 @@
# #
unless defined?(AwesomePrint::Inspector) unless defined?(AwesomePrint::Inspector)
%w(array string method object class kernel).each do |file| %w(array string method object class kernel).each do |file|
require File.dirname(__FILE__) + "/awesome_print/core_ext/#{file}" require "awesome_print/core_ext/#{file}"
end end
require File.dirname(__FILE__) + "/awesome_print/inspector" require "awesome_print/inspector"
require File.dirname(__FILE__) + "/awesome_print/formatter" require "awesome_print/formatter"
require File.dirname(__FILE__) + "/awesome_print/version" require "awesome_print/version"
require File.dirname(__FILE__) + "/awesome_print/core_ext/logger" if defined?(Logger) require "awesome_print/core_ext/logger" if defined?(Logger)
# #
# Load the following under normal circumstances as well as in Rails # Load the following under normal circumstances as well as in Rails
# console when required from ~/.irbrc or ~/.pryrc. # console when required from ~/.irbrc or ~/.pryrc.
# #
require File.dirname(__FILE__) + "/awesome_print/ext/active_record" if defined?(ActiveRecord) || AwesomePrint.rails_console? require "awesome_print/ext/active_record" if defined?(ActiveRecord) || AwesomePrint.rails_console?
require File.dirname(__FILE__) + "/awesome_print/ext/active_support" if defined?(ActiveSupport) || AwesomePrint.rails_console? require "awesome_print/ext/active_support" if defined?(ActiveSupport) || AwesomePrint.rails_console?
# #
# Load remaining extensions. # Load remaining extensions.
# #
if defined?(ActiveSupport.on_load) if defined?(ActiveSupport.on_load)
ActiveSupport.on_load(:action_view) do ActiveSupport.on_load(:action_view) do
require File.dirname(__FILE__) + "/awesome_print/ext/action_view" require "awesome_print/ext/action_view"
end end
end end
require File.dirname(__FILE__) + "/awesome_print/ext/mongo_mapper" if defined?(MongoMapper) require "awesome_print/ext/mongo_mapper" if defined?(MongoMapper)
require File.dirname(__FILE__) + "/awesome_print/ext/mongoid" if defined?(Mongoid) require "awesome_print/ext/mongoid" if defined?(Mongoid)
require File.dirname(__FILE__) + "/awesome_print/ext/nokogiri" if defined?(Nokogiri) require "awesome_print/ext/nokogiri" if defined?(Nokogiri)
require File.dirname(__FILE__) + "/awesome_print/ext/nobrainer" if defined?(NoBrainer) require "awesome_print/ext/nobrainer" if defined?(NoBrainer)
require File.dirname(__FILE__) + "/awesome_print/ext/ripple" if defined?(Ripple) require "awesome_print/ext/ripple" if defined?(Ripple)
require File.dirname(__FILE__) + "/awesome_print/ext/sequel" if defined?(Sequel) require "awesome_print/ext/sequel" if defined?(Sequel)
require File.dirname(__FILE__) + "/awesome_print/ext/ostruct" if defined?(OpenStruct) require "awesome_print/ext/ostruct" if defined?(OpenStruct)
end end