diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-09-24 18:36:40 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-09-24 18:38:18 -0700 |
commit | 0bd6e933c01868db7c7e20d46c972c4e7395b743 (patch) | |
tree | d91dbf5aaf990748082e42eb772ba049844794a3 /activesupport/lib/active_support/vendor.rb | |
parent | 772a32a22d71f7a22108719d88c94959ae4942b6 (diff) | |
download | rails-0bd6e933c01868db7c7e20d46c972c4e7395b743.tar.gz rails-0bd6e933c01868db7c7e20d46c972c4e7395b743.tar.bz2 rails-0bd6e933c01868db7c7e20d46c972c4e7395b743.zip |
Restore split between require-time and runtime load path mungery. Simplifies vendor requires.
Diffstat (limited to 'activesupport/lib/active_support/vendor.rb')
-rw-r--r-- | activesupport/lib/active_support/vendor.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/vendor.rb b/activesupport/lib/active_support/vendor.rb new file mode 100644 index 0000000000..d9dfc184da --- /dev/null +++ b/activesupport/lib/active_support/vendor.rb @@ -0,0 +1,10 @@ +[%w(builder 2.1.2), %w(i18n 0.1.3), %w(memcache-client 1.7.5), %w(tzinfo 0.3.13)].each do |lib, version| + # Try to activate a gem ~> satisfying the requested version first. + begin + gem lib, "~> #{version}" + # Use the vendored lib if the gem's missing or we aren't using RubyGems. + rescue LoadError, NoMethodError + # Push, not unshift, so the vendored lib is lowest priority. + $LOAD_PATH << File.expand_path("#{File.dirname(__FILE__)}/vendor/#{lib}-#{version}/lib") + end +end |