diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-08-25 21:22:34 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-08-25 21:22:34 -0700 |
commit | 172606e21f54fea39af68ede5f55a43deaf3ac68 (patch) | |
tree | 19c336e1ebc76a53a4d15b2573d7cce6fbad74c8 /activeresource | |
parent | b7a37b742c0abd1df8ea48cc82f76385cc0c41ea (diff) | |
download | rails-172606e21f54fea39af68ede5f55a43deaf3ac68.tar.gz rails-172606e21f54fea39af68ede5f55a43deaf3ac68.tar.bz2 rails-172606e21f54fea39af68ede5f55a43deaf3ac68.zip |
Harmonize framework require strategy. Don't add self to load path since Rails initializer and RubyGems handle it.
Diffstat (limited to 'activeresource')
-rw-r--r-- | activeresource/lib/active_resource.rb | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/activeresource/lib/active_resource.rb b/activeresource/lib/active_resource.rb index 18347457aa..db9007060f 100644 --- a/activeresource/lib/active_resource.rb +++ b/activeresource/lib/active_resource.rb @@ -21,16 +21,13 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #++ -$:.unshift(File.dirname(__FILE__)) unless - $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) - -unless defined?(ActiveSupport) - begin - $:.unshift(File.dirname(__FILE__) + "/../../activesupport/lib") +begin + require 'active_support' +rescue LoadError + activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib" + if File.directory?(activesupport_path) + $:.unshift activesupport_path require 'active_support' - rescue LoadError - require 'rubygems' - gem 'activesupport' end end @@ -44,4 +41,4 @@ module ActiveResource include Validations include CustomMethods end -end
\ No newline at end of file +end |