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

Keep lib/ap.rb for backwards compatibility

This commit is contained in:
Mike Dvorkin 2011-11-08 22:03:16 -08:00
parent 02ea0da95c
commit c88594a811
2 changed files with 7 additions and 24 deletions

View file

@ -4,23 +4,7 @@
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php # See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# AwesomePrint might be loaded implicitly through ~/.irbrc so do nothing # Keeping this for backwards compatibility to allow
# for subsequent requires. # require "ap"
# #
unless defined?(AwesomePrint) require File.dirname(__FILE__) + "/awesome_print"
%w(array string method object class kernel).each do |file|
require File.dirname(__FILE__) + "/awesome_print/core_ext/#{file}"
end
require File.dirname(__FILE__) + "/awesome_print/inspector"
require File.dirname(__FILE__) + "/awesome_print/formatter"
require File.dirname(__FILE__) + "/awesome_print/core_ext/logger" if defined?(Logger)
require File.dirname(__FILE__) + "/awesome_print/ext/action_view" if defined?(ActionView)
# Load the following under normal circumstances as well as in Rails
# console when required from ~/.irbrc.
require File.dirname(__FILE__) + "/awesome_print/ext/active_record" if defined?(ActiveRecord) || (defined?(IRB) && ENV['RAILS_ENV'])
require File.dirname(__FILE__) + "/awesome_print/ext/active_support" if defined?(ActiveSupport) || (defined?(IRB) && ENV['RAILS_ENV'])
require File.dirname(__FILE__) + "/awesome_print/ext/mongo_mapper" if defined?(MongoMapper)
require File.dirname(__FILE__) + "/awesome_print/ext/mongoid" if defined?(Mongoid)
end

View file

@ -4,10 +4,8 @@
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php # See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# This is the copy of original 'ap.rb' file that matches the gem name. It makes # AwesomePrint might be loaded implicitly through ~/.irbrc so do nothing
# it possible to omit the :require part in bundler's Gemfile: # for subsequent requires.
#
# gem 'awesome_print', '>= 0.4.0'
# #
unless defined?(AwesomePrint) unless defined?(AwesomePrint)
%w(array string method object class kernel).each do |file| %w(array string method object class kernel).each do |file|
@ -19,9 +17,10 @@ unless defined?(AwesomePrint)
require File.dirname(__FILE__) + "/awesome_print/core_ext/logger" if defined?(Logger) require File.dirname(__FILE__) + "/awesome_print/core_ext/logger" if defined?(Logger)
require File.dirname(__FILE__) + "/awesome_print/ext/action_view" if defined?(ActionView) require File.dirname(__FILE__) + "/awesome_print/ext/action_view" if defined?(ActionView)
# Load the following under normal circumstatnces as well as in Rails # Load the following under normal circumstances as well as in Rails
# console when required from ~/.irbrc. # console when required from ~/.irbrc.
require File.dirname(__FILE__) + "/awesome_print/ext/active_record" if defined?(ActiveRecord) || (defined?(IRB) && ENV['RAILS_ENV']) require File.dirname(__FILE__) + "/awesome_print/ext/active_record" if defined?(ActiveRecord) || (defined?(IRB) && ENV['RAILS_ENV'])
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'])
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)
end end