diff options
Diffstat (limited to 'lib/bundler/runtime.rb')
-rw-r--r-- | lib/bundler/runtime.rb | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb index ec772cfe7b..9792a81962 100644 --- a/lib/bundler/runtime.rb +++ b/lib/bundler/runtime.rb @@ -10,7 +10,7 @@ module Bundler end def setup(*groups) - @definition.ensure_equivalent_gemfile_and_lockfile if Bundler.frozen_bundle? + @definition.ensure_equivalent_gemfile_and_lockfile # Has to happen first clean_load_path @@ -41,12 +41,17 @@ module Bundler groups.map!(&:to_sym) groups = [:default] if groups.empty? - @definition.dependencies.each do |dep| - # Skip the dependency if it is not in any of the requested groups, or - # not for the current platform, or doesn't match the gem constraints. - next unless (dep.groups & groups).any? && dep.should_include? + dependencies = @definition.dependencies.select do |dep| + # Select the dependency if it is in any of the requested groups, and + # for the current platform, and matches the gem constraints. + (dep.groups & groups).any? && dep.should_include? + end + + Plugin.hook(Plugin::Events::GEM_BEFORE_REQUIRE_ALL, dependencies) + dependencies.each do |dep| required_file = nil + Plugin.hook(Plugin::Events::GEM_BEFORE_REQUIRE, dep) begin # Loop through all the specified autorequires for the @@ -76,7 +81,13 @@ module Bundler end end end + + Plugin.hook(Plugin::Events::GEM_AFTER_REQUIRE, dep) end + + Plugin.hook(Plugin::Events::GEM_AFTER_REQUIRE_ALL, dependencies) + + dependencies end def self.definition_method(meth) @@ -128,11 +139,6 @@ module Bundler spec.source.cache(spec, custom_path) if spec.source.respond_to?(:cache) end - Dir[cache_path.join("*/.git")].each do |git_dir| - FileUtils.rm_rf(git_dir) - FileUtils.touch(File.expand_path("../.bundlecache", git_dir)) - end - prune_cache(cache_path) unless Bundler.settings[:no_prune] end |