bundler 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- data/CHANGELOG.md +14 -0
- data/Rakefile +6 -2
- data/bundler.gemspec +2 -3
- data/lib/bundler.rb +1 -1
- data/lib/bundler/definition.rb +4 -2
- data/lib/bundler/dependency.rb +2 -1
- data/lib/bundler/index.rb +1 -2
- data/lib/bundler/rubygems_ext.rb +4 -1
- data/lib/bundler/shared_helpers.rb +16 -7
- data/lib/bundler/source.rb +5 -3
- data/lib/bundler/version.rb +1 -1
- data/spec/install/git_spec.rb +1 -1
- data/spec/install/path_spec.rb +41 -0
- data/spec/lock/lockfile_spec.rb +23 -0
- data/spec/support/builders.rb +6 -0
- data/spec/support/helpers.rb +1 -1
- data/spec/support/matchers.rb +3 -15
- metadata +8 -8
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
## 1.0.11 (April 1, 2011)
|
2
|
+
|
3
|
+
Features:
|
4
|
+
|
5
|
+
- Compatibility with Rubygems 1.6 and 1.7
|
6
|
+
- Better error messages when a git command fails
|
7
|
+
|
8
|
+
Bugfixes:
|
9
|
+
|
10
|
+
- Don't always update gemspec gems (@carllerche)
|
11
|
+
- Remove ivar warnings (@jackdempsey)
|
12
|
+
- Fix occasional git failures in zsh (@jonah-carbonfive)
|
13
|
+
- Consistent lock for gems with double deps like Cap (@akahn)
|
14
|
+
|
1
15
|
## 1.0.10 (February 1, 2011)
|
2
16
|
|
3
17
|
Bugfixes:
|
data/Rakefile
CHANGED
@@ -60,7 +60,7 @@ begin
|
|
60
60
|
namespace :rubygems do
|
61
61
|
# Rubygems 1.3.5, 1.3.6, and HEAD specs
|
62
62
|
rubyopt = ENV["RUBYOPT"]
|
63
|
-
%w(master v1.3.6 v1.3.7 v1.4.
|
63
|
+
%w(master v1.3.6 v1.3.7 v1.4.2 v1.5.3 v1.6.1).each do |rg|
|
64
64
|
desc "Run specs with Rubygems #{rg}"
|
65
65
|
RSpec::Core::RakeTask.new(rg) do |t|
|
66
66
|
t.rspec_opts = %w(-fs --color)
|
@@ -71,7 +71,11 @@ begin
|
|
71
71
|
unless File.directory?("tmp/rubygems")
|
72
72
|
system("git clone git://github.com/rubygems/rubygems.git tmp/rubygems")
|
73
73
|
end
|
74
|
-
|
74
|
+
Dir.chdir("tmp/rubygems") do
|
75
|
+
system("git remote update")
|
76
|
+
system("git checkout #{rg}")
|
77
|
+
system("git pull origin master") if rg == "master"
|
78
|
+
end
|
75
79
|
ENV["RUBYOPT"] = "-I#{File.expand_path("tmp/rubygems/lib")} #{rubyopt}"
|
76
80
|
end
|
77
81
|
|
data/bundler.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.name = "bundler"
|
9
9
|
s.version = Bundler::VERSION
|
10
10
|
s.platform = Gem::Platform::RUBY
|
11
|
-
s.authors = ["
|
12
|
-
s.email = ["
|
11
|
+
s.authors = ["André Arko", "Terence Lee", "Carl Lerche", "Yehuda Katz"]
|
12
|
+
s.email = ["andre@arko.net"]
|
13
13
|
s.homepage = "http://gembundler.com"
|
14
14
|
s.summary = %q{The best way to manage your application's dependencies}
|
15
15
|
s.description = %q{Bundler manages an application's dependencies through its entire life, across many machines, systematically and repeatably}
|
@@ -25,6 +25,5 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.files = `git ls-files`.split("\n") + man_files
|
26
26
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
27
27
|
s.executables = %w(bundle)
|
28
|
-
s.default_executable = "bundle"
|
29
28
|
s.require_paths = ["lib"]
|
30
29
|
end
|
data/lib/bundler.rb
CHANGED
data/lib/bundler/definition.rb
CHANGED
@@ -225,7 +225,7 @@ module Bundler
|
|
225
225
|
|
226
226
|
handled = []
|
227
227
|
dependencies.
|
228
|
-
sort_by { |d| d.
|
228
|
+
sort_by { |d| d.to_s }.
|
229
229
|
each do |dep|
|
230
230
|
next if handled.include?(dep.name)
|
231
231
|
out << dep.to_lock
|
@@ -367,8 +367,10 @@ module Bundler
|
|
367
367
|
# If the spec is no longer in the path source, unlock it. This
|
368
368
|
# commonly happens if the version changed in the gemspec
|
369
369
|
next unless other
|
370
|
+
|
371
|
+
deps2 = other.dependencies.select { |d| d.type != :development }
|
370
372
|
# If the dependencies of the path source have changed, unlock it
|
371
|
-
next unless s.dependencies.sort ==
|
373
|
+
next unless s.dependencies.sort == deps2.sort
|
372
374
|
end
|
373
375
|
|
374
376
|
converged << s
|
data/lib/bundler/dependency.rb
CHANGED
data/lib/bundler/index.rb
CHANGED
@@ -115,11 +115,10 @@ module Bundler
|
|
115
115
|
def search_by_dependency(dependency)
|
116
116
|
@cache[dependency.hash] ||= begin
|
117
117
|
specs = @specs[dependency.name]
|
118
|
+
found = specs.select { |spec| dependency.matches_spec?(spec) && Gem::Platform.match(spec.platform) }
|
118
119
|
|
119
120
|
wants_prerelease = dependency.requirement.prerelease?
|
120
121
|
only_prerelease = specs.all? {|spec| spec.version.prerelease? }
|
121
|
-
found = specs.select { |spec| dependency.matches_spec?(spec) && Gem::Platform.match(spec.platform) }
|
122
|
-
|
123
122
|
unless wants_prerelease || only_prerelease
|
124
123
|
found.reject! { |spec| spec.version.prerelease? }
|
125
124
|
end
|
data/lib/bundler/rubygems_ext.rb
CHANGED
@@ -118,11 +118,13 @@ module Gem
|
|
118
118
|
def to_lock
|
119
119
|
out = " #{name}"
|
120
120
|
unless requirement == Gem::Requirement.default
|
121
|
-
|
121
|
+
reqs = requirement.requirements.map{|o,v| "#{o} #{v}" }
|
122
|
+
out << " (#{reqs.join(', ')})"
|
122
123
|
end
|
123
124
|
out
|
124
125
|
end
|
125
126
|
|
127
|
+
# Backport of performance enhancement added to Rubygems 1.4
|
126
128
|
def matches_spec?(spec)
|
127
129
|
# name can be a Regexp, so use ===
|
128
130
|
return false unless name === spec.name
|
@@ -133,6 +135,7 @@ module Gem
|
|
133
135
|
end
|
134
136
|
|
135
137
|
class Requirement
|
138
|
+
# Backport of performance enhancement added to Rubygems 1.4
|
136
139
|
def none?
|
137
140
|
@none ||= (to_s == ">= 0")
|
138
141
|
end unless allocate.respond_to?(:none?)
|
@@ -123,13 +123,22 @@ module Bundler
|
|
123
123
|
# === Following hacks are to improve on the generated bin wrappers ===
|
124
124
|
|
125
125
|
# Yeah, talk about a hack
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
126
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.7.0')
|
127
|
+
Gem::SourceIndex.send(:define_method, :initialize) do |*args|
|
128
|
+
@gems = {}
|
129
|
+
spec_dirs = *args
|
130
|
+
add_specs(*specs)
|
131
|
+
end
|
132
|
+
else
|
133
|
+
# Rubygems versions lower than 1.7 use SourceIndex#from_gems_in
|
134
|
+
source_index_class = (class << Gem::SourceIndex ; self ; end)
|
135
|
+
source_index_class.send(:remove_method, :from_gems_in)
|
136
|
+
source_index_class.send(:define_method, :from_gems_in) do |*args|
|
137
|
+
source_index = Gem::SourceIndex.new
|
138
|
+
source_index.spec_dirs = *args
|
139
|
+
source_index.add_specs(*specs)
|
140
|
+
source_index
|
141
|
+
end
|
133
142
|
end
|
134
143
|
|
135
144
|
# OMG more hacks
|
data/lib/bundler/source.rb
CHANGED
@@ -317,7 +317,6 @@ module Bundler
|
|
317
317
|
def eql?(o)
|
318
318
|
o.instance_of?(Path) &&
|
319
319
|
path.expand_path(Bundler.root) == o.path.expand_path(Bundler.root) &&
|
320
|
-
name == o.name &&
|
321
320
|
version == o.version
|
322
321
|
end
|
323
322
|
|
@@ -560,7 +559,10 @@ module Bundler
|
|
560
559
|
out = %x{git #{command}}
|
561
560
|
|
562
561
|
if $?.exitstatus != 0
|
563
|
-
|
562
|
+
msg = "Git error: " +
|
563
|
+
"command `git #{command}` in directory #{Dir.pwd} has failed.\n" +
|
564
|
+
"Cannot complete bundling."
|
565
|
+
raise GitError, msg
|
564
566
|
end
|
565
567
|
out
|
566
568
|
else
|
@@ -611,7 +613,7 @@ module Bundler
|
|
611
613
|
return if has_revision_cached?
|
612
614
|
Bundler.ui.info "Updating #{uri}"
|
613
615
|
in_cache do
|
614
|
-
git %|fetch --force --quiet --tags "#{uri}" refs/heads/*:refs/heads
|
616
|
+
git %|fetch --force --quiet --tags "#{uri}" "refs/heads/*:refs/heads/*"|
|
615
617
|
end
|
616
618
|
else
|
617
619
|
Bundler.ui.info "Fetching #{uri}"
|
data/lib/bundler/version.rb
CHANGED
@@ -2,5 +2,5 @@ module Bundler
|
|
2
2
|
# We're doing this because we might write tests that deal
|
3
3
|
# with other versions of bundler and we are unsure how to
|
4
4
|
# handle this better.
|
5
|
-
VERSION = "1.0.
|
5
|
+
VERSION = "1.0.11" unless defined?(::Bundler::VERSION)
|
6
6
|
end
|
data/spec/install/git_spec.rb
CHANGED
@@ -348,7 +348,7 @@ describe "bundle install with git sources" do
|
|
348
348
|
|
349
349
|
bundle :install, :expect_err => true
|
350
350
|
|
351
|
-
out.should include("
|
351
|
+
out.should include("Git error:")
|
352
352
|
err.should include("fatal")
|
353
353
|
err.should include("omgomg")
|
354
354
|
err.should include("fatal: The remote end hung up unexpectedly")
|
data/spec/install/path_spec.rb
CHANGED
@@ -141,6 +141,47 @@ describe "bundle install with explicit source paths" do
|
|
141
141
|
should_be_installed "rack 1.0"
|
142
142
|
end
|
143
143
|
|
144
|
+
it "doesn't automatically unlock dependencies when using the gemspec syntax" do
|
145
|
+
build_lib "foo", "1.0", :path => lib_path("foo") do |s|
|
146
|
+
s.add_dependency "rack", ">= 1.0"
|
147
|
+
end
|
148
|
+
|
149
|
+
Dir.chdir lib_path("foo")
|
150
|
+
|
151
|
+
install_gemfile lib_path("foo/Gemfile"), <<-G
|
152
|
+
source "file://#{gem_repo1}"
|
153
|
+
gemspec
|
154
|
+
G
|
155
|
+
|
156
|
+
build_gem "rack", "1.0.1", :to_system => true
|
157
|
+
|
158
|
+
bundle "install"
|
159
|
+
|
160
|
+
should_be_installed "foo 1.0"
|
161
|
+
should_be_installed "rack 1.0"
|
162
|
+
end
|
163
|
+
|
164
|
+
it "doesn't automatically unlock dependencies when using the gemspec syntax and the gem has development dependencies" do
|
165
|
+
build_lib "foo", "1.0", :path => lib_path("foo") do |s|
|
166
|
+
s.add_dependency "rack", ">= 1.0"
|
167
|
+
s.add_development_dependency "activesupport"
|
168
|
+
end
|
169
|
+
|
170
|
+
Dir.chdir lib_path("foo")
|
171
|
+
|
172
|
+
install_gemfile lib_path("foo/Gemfile"), <<-G
|
173
|
+
source "file://#{gem_repo1}"
|
174
|
+
gemspec
|
175
|
+
G
|
176
|
+
|
177
|
+
build_gem "rack", "1.0.1", :to_system => true
|
178
|
+
|
179
|
+
bundle "install"
|
180
|
+
|
181
|
+
should_be_installed "foo 1.0"
|
182
|
+
should_be_installed "rack 1.0"
|
183
|
+
end
|
184
|
+
|
144
185
|
it "raises if there are multiple gemspecs" do
|
145
186
|
build_lib "foo", "1.0", :path => lib_path("foo") do |s|
|
146
187
|
s.write "bar.gemspec"
|
data/spec/lock/lockfile_spec.rb
CHANGED
@@ -329,6 +329,29 @@ describe "the lockfile format" do
|
|
329
329
|
G
|
330
330
|
end
|
331
331
|
|
332
|
+
it "orders dependencies according to version" do
|
333
|
+
install_gemfile <<-G
|
334
|
+
source "file://#{gem_repo1}"
|
335
|
+
gem 'double_deps'
|
336
|
+
G
|
337
|
+
|
338
|
+
lockfile_should_be <<-G
|
339
|
+
GEM
|
340
|
+
remote: file:#{gem_repo1}/
|
341
|
+
specs:
|
342
|
+
double_deps (1.0)
|
343
|
+
net-ssh (>= 1.0.0)
|
344
|
+
net-ssh
|
345
|
+
net-ssh (1.0)
|
346
|
+
|
347
|
+
PLATFORMS
|
348
|
+
#{generic(Gem::Platform.local)}
|
349
|
+
|
350
|
+
DEPENDENCIES
|
351
|
+
double_deps
|
352
|
+
G
|
353
|
+
end
|
354
|
+
|
332
355
|
it "does not add the :require option to the lockfile" do
|
333
356
|
install_gemfile <<-G
|
334
357
|
source "file://#{gem_repo1}"
|
data/spec/support/builders.rb
CHANGED
@@ -217,6 +217,12 @@ module Spec
|
|
217
217
|
s.add_dependency "net_d"
|
218
218
|
end
|
219
219
|
|
220
|
+
# Capistrano did this (at least until version 2.5.10)
|
221
|
+
build_gem "double_deps" do |s|
|
222
|
+
s.add_dependency "net-ssh", ">= 1.0.0"
|
223
|
+
s.add_dependency "net-ssh"
|
224
|
+
end
|
225
|
+
|
220
226
|
build_gem "foo"
|
221
227
|
end
|
222
228
|
end
|
data/spec/support/helpers.rb
CHANGED
@@ -3,7 +3,7 @@ module Spec
|
|
3
3
|
def reset!
|
4
4
|
@in_p, @out_p, @err_p = nil, nil, nil
|
5
5
|
Dir["#{tmp}/{gems/*,*}"].each do |dir|
|
6
|
-
next if %(base remote1 gems
|
6
|
+
next if %(base remote1 gems rubygems).include?(File.basename(dir))
|
7
7
|
unless ENV['BUNDLER_SUDO_TESTS']
|
8
8
|
FileUtils.rm_rf(dir)
|
9
9
|
else
|
data/spec/support/matchers.rb
CHANGED
@@ -67,23 +67,11 @@ module Spec
|
|
67
67
|
bundled_app("Gemfile.lock").should exist
|
68
68
|
end
|
69
69
|
|
70
|
-
|
70
|
+
def lockfile_should_be(expected)
|
71
|
+
should_be_locked
|
71
72
|
spaces = expected[/\A\s+/, 0] || ""
|
72
73
|
expected.gsub!(/^#{spaces}/, '')
|
73
|
-
|
74
|
-
failure_message_for_should do |actual|
|
75
|
-
"The lockfile did not match.\n=== Expected:\n" <<
|
76
|
-
expected << "\n=== Got:\n" << actual << "\n===========\n"
|
77
|
-
end
|
78
|
-
|
79
|
-
match do |actual|
|
80
|
-
expected == actual
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
def lockfile_should_be(expected)
|
85
|
-
lock = File.read(bundled_app("Gemfile.lock"))
|
86
|
-
lock.should be_with_diff(expected)
|
74
|
+
bundled_app("Gemfile.lock").read.should == expected
|
87
75
|
end
|
88
76
|
end
|
89
77
|
end
|
metadata
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 11
|
10
|
+
version: 1.0.11
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
|
-
- Carl Lerche
|
14
|
-
- Yehuda Katz
|
15
13
|
- "Andr\xC3\xA9 Arko"
|
16
14
|
- Terence Lee
|
15
|
+
- Carl Lerche
|
16
|
+
- Yehuda Katz
|
17
17
|
autorequire:
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2011-
|
22
|
-
default_executable:
|
21
|
+
date: 2011-04-01 00:00:00 -07:00
|
22
|
+
default_executable:
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|
25
25
|
name: ronn
|
@@ -51,7 +51,7 @@ dependencies:
|
|
51
51
|
version_requirements: *id002
|
52
52
|
description: Bundler manages an application's dependencies through its entire life, across many machines, systematically and repeatably
|
53
53
|
email:
|
54
|
-
-
|
54
|
+
- andre@arko.net
|
55
55
|
executables:
|
56
56
|
- bundle
|
57
57
|
extensions: []
|