Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Call Bundler.setup from Bundler.require, only set up each group once

  • Loading branch information...
commit 69acfd88a919de8bac222fc37a1e79d5c6dfdf6c 1 parent 6be2abf
@indirect indirect authored
View
2  lib/bundler.rb
@@ -70,7 +70,7 @@ def setup(*groups)
end
def require(*groups)
- load.require(*groups)
+ setup(*groups).require(*groups)
end
def load
View
8 lib/bundler/runtime.rb
@@ -15,7 +15,9 @@ def setup(*groups)
# Has to happen first
clean_load_path
- specs = groups.any? ? specs_for(groups) : requested_specs
+ unloaded = groups - (@loaded_groups || [])
+ @loaded_groups = groups | (@loaded_groups || [])
+ specs = unloaded.any? ? specs_for(unloaded) : requested_specs
cripple_rubygems(specs)
@@ -26,7 +28,9 @@ def setup(*groups)
end
Gem.loaded_specs[spec.name] = spec
- $LOAD_PATH.unshift(*spec.load_paths)
+ spec.load_paths.each do |path|
+ $LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
+ end
end
self
end
View
5 lib/bundler/templates/environment.erb
@@ -50,8 +50,11 @@ module Bundler
configure_gem_path_and_home(SPECS)
SPECS.each do |spec|
Gem.loaded_specs[spec.name] = spec
- $LOAD_PATH.unshift(*spec.require_paths)
+ spec.require_paths.each do |path|
+ $LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
+ end
end
+ self
end
def self.require(*groups)
Please sign in to comment.
Something went wrong with that request. Please try again.