From 49c50598139fcefb71b70921ca4da9ee6e046aaa Mon Sep 17 00:00:00 2001 From: Mike Dvorkin Date: Sat, 13 Nov 2010 09:42:50 -0800 Subject: [PATCH] Fixed Rails 2.3.x console stack overflow issue --- rails/init.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/rails/init.rb b/rails/init.rb index c6a8cea..e22a456 100644 --- a/rails/init.rb +++ b/rails/init.rb @@ -1 +1,13 @@ -require File.join(File.dirname(__FILE__), "..", "init") +# Copyright (c) 2010 Michael Dvorkin +# +# Awesome Print is freely distributable under the terms of MIT license. +# See LICENSE file or http://www.opensource.org/licenses/mit-license.php +#------------------------------------------------------------------------------ +# +# Load awesome_print when installed as Rails 2.3.x plugin. +# +# NOTE: After Rails 2.3.x console loads awesome_print/lib/ap.rb it attempts +# to load this file as well. Make sure to check whether the awesome_print +# is already loaded to avoid Ruby stack overflow when extending core classes. +# +require File.join(File.dirname(__FILE__), "..", "init") unless defined?(AwesomePrint)