aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-12-16 11:56:51 -0600
committerJoshua Peek <josh@joshpeek.com>2009-12-16 11:56:51 -0600
commit7ee5843c3cedfe36a680d5b28aa31eef45296c50 (patch)
treed399cb71b2533ec353ebbb5cc19a0c0902da1987 /railties/lib/rails/generators.rb
parent1ab35020c152575c84d4ca95842d55be307e1fee (diff)
downloadrails-7ee5843c3cedfe36a680d5b28aa31eef45296c50.tar.gz
rails-7ee5843c3cedfe36a680d5b28aa31eef45296c50.tar.bz2
rails-7ee5843c3cedfe36a680d5b28aa31eef45296c50.zip
Fully expand relative rails framework paths and make sure we aren't
adding any to the load path more than once.
Diffstat (limited to 'railties/lib/rails/generators.rb')
-rw-r--r--railties/lib/rails/generators.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb
index ffb9cfe1cd..0e66c9f58f 100644
--- a/railties/lib/rails/generators.rb
+++ b/railties/lib/rails/generators.rb
@@ -1,5 +1,6 @@
-activesupport_path = "#{File.dirname(__FILE__)}/../../../activesupport/lib"
-$LOAD_PATH.unshift(activesupport_path) if File.directory?(activesupport_path)
+activesupport_path = File.expand_path('../../../../activesupport/lib', __FILE__)
+$:.unshift(activesupport_path) if File.directory?(activesupport_path) && !$:.include?(activesupport_path)
+
require 'active_support'
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/object/metaclass'