Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: bundler/bundler
...
head fork: bundler/bundler
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
8 lib/bundler/definition.rb
@@ -108,9 +108,9 @@ def resolve_remotely!
specs
end
- def specs
+ def specs(deps = requested_dependencies)
@specs ||= begin
- specs = resolve.materialize(requested_dependencies)
+ specs = resolve.materialize(deps)
unless specs["bundler"].any?
local = Bundler.settings[:frozen] ? rubygems_index : index
@@ -130,6 +130,10 @@ def removed_specs
@locked_specs - specs
end
+ def all_specs
+ specs(dependencies)
+ end
+
def new_platform?
@new_platform
end
View
3  lib/bundler/runtime.rb
@@ -120,12 +120,13 @@ def clean
gem_files = Dir["#{Gem.dir}/cache/*.gem"]
gemspec_files = Dir["#{Gem.dir}/specifications/*.gemspec"]
spec_gem_paths = []
+ # need to keep git sources around
spec_git_paths = []
spec_git_cache_dirs = []
spec_gem_executables = []
spec_cache_paths = []
spec_gemspec_paths = []
- specs.each do |spec|
+ @definition.all_specs.each do |spec|
spec_gem_paths << spec.full_gem_path
# need to check here in case gems are nested like for the rails git repo
md = %r{(.+bundler/gems/.+-[a-f0-9]{7,12})}.match(spec.full_gem_path)
View
48 spec/other/clean_spec.rb
@@ -100,29 +100,6 @@ def should_not_have_gems(*gems)
vendored_gems("bin/rackup").should exist
end
- it "remove gems in bundle without groups" do
- gemfile <<-G
- source "file://#{gem_repo1}"
-
- gem "foo"
-
- group :test_group do
- gem "rack", "1.0.0"
- end
- G
-
- bundle "install --path vendor/bundle"
- bundle "install --without test_group"
- bundle :clean
-
- out.should eq("Removing rack (1.0.0)")
-
- should_have_gems 'foo-1.0'
- should_not_have_gems 'rack-1.0.0'
-
- vendored_gems("bin/rackup").should_not exist
- end
-
it "does not remove cached git dir if it's being used" do
build_git "foo"
revision = revision_for(lib_path("foo-1.0"))
@@ -232,6 +209,31 @@ def should_not_have_gems(*gems)
vendored_gems("bundler/gems/rails-#{revision[0..11]}").should exist
end
+ it "does not remove git sources that are in without groups" do
+ build_git "foo", :path => lib_path("foo")
+ git_path = lib_path('foo')
+ revision = revision_for(git_path)
+
+ gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack", "1.0.0"
+ group :test do
+ git "#{git_path}", :ref => "#{revision}" do
+ gem "foo"
+ end
+ end
+ G
+ bundle "install --path vendor/bundle --without test"
+
+ bundle :clean
+
+ out.should eq("")
+ vendored_gems("bundler/gems/foo-#{revision[0..11]}").should exist
+ digest = Digest::SHA1.hexdigest(git_path.to_s)
+ vendored_gems("cache/bundler/git/foo-#{digest}").should exist
+ end
+
it "displays an error when used without --path" do
install_gemfile <<-G
source "file://#{gem_repo1}"

No commit comments for this range

Something went wrong with that request. Please try again.