Permalink
Browse files

Convert the other vendored libs to avoid pulling in old gems. Works e…

…ven if rubygems isn't loaded.
  • Loading branch information...
1 parent 0039c03 commit 772a32a22d71f7a22108719d88c94959ae4942b6 @jeremy jeremy committed Sep 25, 2009
@@ -35,7 +35,6 @@ def load_all!; load_all_hooks.each { |hook| hook.call } end
end
require 'active_support/autoload'
-require 'active_support/vendor'
require 'active_support/vendor/i18n'
I18n.load_path << "#{File.dirname(__FILE__)}/active_support/locale/en.yml"
@@ -1,18 +0,0 @@
-# Fakes out gem optional dependencies until they are fully supported by gemspec.
-# Activate any optional dependencies that are available.
-if defined? Gem
- begin
- gem 'builder', '~> 2.1.2'
- rescue Gem::LoadError
- end
-
- begin
- gem 'memcache-client', '>= 1.6.5'
- rescue Gem::LoadError
- end
-
- begin
- gem 'i18n', '~> 0.1.3'
- rescue Gem::LoadError
- end
-end
@@ -1,6 +1,7 @@
begin
- require 'builder'
-rescue LoadError
- $:.unshift File.expand_path(File.join(File.dirname(__FILE__), 'builder-2.1.2', 'lib'))
- retry
+ gem 'builder', '~> 2.1.2'
+rescue LoadError, NoMethodError
+ $LOAD_PATH.unshift File.expand_path("#{File.dirname(__FILE__)}/builder-2.1.2/lib")
end
+
+require 'builder'
@@ -1,6 +1,7 @@
begin
- require 'i18n'
-rescue LoadError
- $:.unshift File.expand_path(File.join(File.dirname(__FILE__), 'i18n-0.1.3', 'lib'))
- retry
+ gem 'i18n', '~> 0.1.3'
+rescue LoadError, NoMethodError
+ $LOAD_PATH.unshift File.expand_path("#{File.dirname(__FILE__)}/i18n-0.1.3/lib")
end
+
+require 'i18n'
@@ -1,6 +1,7 @@
begin
- require 'memcache'
-rescue LoadError
- $:.unshift File.expand_path(File.join(File.dirname(__FILE__), 'memcache-client-1.7.5', 'lib'))
- retry
+ gem 'memcache-client', '~> 1.7.5'
+rescue LoadError, NoMethodError
+ $LOAD_PATH.unshift File.expand_path("#{File.dirname(__FILE__)}/memcache-client-1.7.5/lib")
end
+
+require 'memcache'
@@ -1,6 +1,6 @@
begin
gem 'tzinfo', '~> 0.3.13'
-rescue Gem::LoadError
+rescue LoadError, NoMethodError
$LOAD_PATH.unshift File.expand_path("#{File.dirname(__FILE__)}/tzinfo-0.3.13/lib")
end

0 comments on commit 772a32a

Please sign in to comment.