bundler 1.5.3 → 1.6.0.pre.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.travis.yml +14 -11
- data/CHANGELOG.md +10 -3
- data/CONTRIBUTING.md +21 -12
- data/DEVELOPMENT.md +2 -2
- data/README.md +3 -2
- data/Rakefile +19 -9
- data/bundler.gemspec +1 -1
- data/lib/bundler.rb +9 -5
- data/lib/bundler/cli.rb +51 -10
- data/lib/bundler/dsl.rb +10 -6
- data/lib/bundler/friendly_errors.rb +1 -1
- data/lib/bundler/installer.rb +28 -17
- data/lib/bundler/parallel_workers/worker.rb +1 -1
- data/lib/bundler/resolver.rb +191 -207
- data/lib/bundler/rubygems_ext.rb +2 -4
- data/lib/bundler/rubygems_integration.rb +5 -0
- data/lib/bundler/runtime.rb +15 -12
- data/lib/bundler/settings.rb +4 -2
- data/lib/bundler/source.rb +11 -1
- data/lib/bundler/source/git.rb +11 -7
- data/lib/bundler/source/git/git_proxy.rb +4 -7
- data/lib/bundler/source/path.rb +21 -12
- data/lib/bundler/source/path/installer.rb +1 -1
- data/lib/bundler/source/rubygems.rb +18 -8
- data/lib/bundler/ssl_certs/certificate_manager.rb +41 -0
- data/lib/bundler/templates/newgem/README.md.tt +1 -1
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -2
- data/lib/bundler/ui.rb +4 -141
- data/lib/bundler/ui/rg_proxy.rb +21 -0
- data/lib/bundler/ui/shell.rb +98 -0
- data/lib/bundler/ui/silent.rb +44 -0
- data/lib/bundler/vendor/net/http/faster.rb +0 -1
- data/lib/bundler/vendor/net/http/persistent.rb +0 -1
- data/lib/bundler/vendor/net/http/persistent/ssl_reuse.rb +0 -1
- data/lib/bundler/version.rb +1 -1
- data/spec/bundler/definition_spec.rb +2 -2
- data/spec/bundler/dsl_spec.rb +3 -3
- data/spec/bundler/gem_helper_spec.rb +5 -7
- data/spec/bundler/settings_spec.rb +15 -0
- data/spec/bundler/source_spec.rb +1 -1
- data/spec/commands/config_spec.rb +18 -0
- data/spec/commands/console_spec.rb +22 -0
- data/spec/commands/exec_spec.rb +1 -0
- data/spec/commands/newgem_spec.rb +2 -2
- data/spec/commands/open_spec.rb +13 -0
- data/spec/{install/gems/packed_spec.rb → commands/package_spec.rb} +30 -0
- data/spec/commands/show_spec.rb +87 -71
- data/spec/install/binstubs_spec.rb +1 -1
- data/spec/install/bundler_spec.rb +1 -1
- data/spec/install/gemfile/git_spec.rb +1 -1
- data/spec/install/gemfile/path_spec.rb +12 -0
- data/spec/install/gemfile_spec.rb +1 -1
- data/spec/install/gems/groups_spec.rb +1 -1
- data/spec/install/gems/platform_spec.rb +0 -1
- data/spec/install/gems/post_install_spec.rb +74 -0
- data/spec/install/gems/resolving_spec.rb +22 -26
- data/spec/install/gems/simple_case_spec.rb +17 -1
- data/spec/install/gemspecs_spec.rb +1 -1
- data/spec/install/path_spec.rb +1 -1
- data/spec/install/prereleases_spec.rb +1 -1
- data/spec/other/ext_spec.rb +1 -1
- data/spec/other/ssl_cert_spec.rb +10 -0
- data/spec/realworld/edgecases_spec.rb +1 -1
- data/spec/resolver/basic_spec.rb +29 -0
- data/spec/support/builders.rb +42 -43
- data/spec/support/indexes.rb +129 -1
- data/spec/support/permissions.rb +1 -0
- data/spec/update/gems_spec.rb +37 -0
- data/spec/update/git_spec.rb +24 -1
- data/spec/update/source_spec.rb +14 -1
- metadata +14 -9
- data/lib/bundler/safe_catch.rb +0 -101
- data/spec/bundler/safe_catch_spec.rb +0 -37
data/spec/commands/show_spec.rb
CHANGED
@@ -1,102 +1,118 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe "bundle show" do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
context "with a standard Gemfile" do
|
5
|
+
before :each do
|
6
|
+
install_gemfile <<-G
|
7
|
+
source "file://#{gem_repo1}"
|
8
|
+
gem "rails"
|
9
|
+
G
|
10
|
+
end
|
10
11
|
|
11
|
-
|
12
|
-
|
12
|
+
it "creates a Gemfile.lock if one did not exist" do
|
13
|
+
FileUtils.rm("Gemfile.lock")
|
13
14
|
|
14
|
-
|
15
|
+
bundle "show"
|
15
16
|
|
16
|
-
|
17
|
-
|
17
|
+
expect(bundled_app("Gemfile.lock")).to exist
|
18
|
+
end
|
18
19
|
|
19
|
-
|
20
|
-
|
20
|
+
it "creates a Gemfile.lock when invoked with a gem name" do
|
21
|
+
FileUtils.rm("Gemfile.lock")
|
21
22
|
|
22
|
-
|
23
|
+
bundle "show rails"
|
23
24
|
|
24
|
-
|
25
|
-
|
25
|
+
expect(bundled_app("Gemfile.lock")).to exist
|
26
|
+
end
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
it "prints path if gem exists in bundle" do
|
29
|
+
bundle "show rails"
|
30
|
+
expect(out).to eq(default_bundle_path('gems', 'rails-2.3.2').to_s)
|
31
|
+
end
|
31
32
|
|
32
|
-
|
33
|
-
|
33
|
+
it "warns if path no longer exists on disk" do
|
34
|
+
FileUtils.rm_rf("#{system_gem_path}/gems/rails-2.3.2")
|
34
35
|
|
35
|
-
|
36
|
+
bundle "show rails"
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
38
|
+
expect(out).to match(/has been deleted/i)
|
39
|
+
expect(out).to include(default_bundle_path('gems', 'rails-2.3.2').to_s)
|
40
|
+
end
|
40
41
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
it "prints the path to the running bundler" do
|
43
|
+
bundle "show bundler"
|
44
|
+
expect(out).to eq(File.expand_path('../../../', __FILE__))
|
45
|
+
end
|
45
46
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
47
|
+
it "complains if gem not in bundle" do
|
48
|
+
bundle "show missing"
|
49
|
+
expect(out).to match(/could not find gem 'missing'/i)
|
50
|
+
end
|
50
51
|
|
51
|
-
|
52
|
-
|
52
|
+
it "prints path of all gems in bundle sorted by name" do
|
53
|
+
bundle "show --paths"
|
53
54
|
|
54
|
-
|
55
|
-
|
55
|
+
expect(out).to include(default_bundle_path('gems', 'rake-10.0.2').to_s)
|
56
|
+
expect(out).to include(default_bundle_path('gems', 'rails-2.3.2').to_s)
|
56
57
|
|
57
|
-
|
58
|
-
|
59
|
-
|
58
|
+
# Gem names are the last component of their path.
|
59
|
+
gem_list = out.split.map { |p| p.split('/').last }
|
60
|
+
expect(gem_list).to eq(gem_list.sort)
|
61
|
+
end
|
60
62
|
end
|
61
|
-
end
|
62
63
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
64
|
+
context "with a git repo in the Gemfile" do
|
65
|
+
before :each do
|
66
|
+
@git = build_git "foo", "1.0"
|
67
|
+
end
|
67
68
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
69
|
+
it "prints out git info" do
|
70
|
+
install_gemfile <<-G
|
71
|
+
gem "foo", :git => "#{lib_path('foo-1.0')}"
|
72
|
+
G
|
73
|
+
should_be_installed "foo 1.0"
|
73
74
|
|
74
|
-
|
75
|
-
|
76
|
-
|
75
|
+
bundle :show
|
76
|
+
expect(out).to include("foo (1.0 #{@git.ref_for('master', 6)}")
|
77
|
+
end
|
78
|
+
|
79
|
+
it "prints out branch names other than master" do
|
80
|
+
update_git "foo", :branch => "omg" do |s|
|
81
|
+
s.write "lib/foo.rb", "FOO = '1.0.omg'"
|
82
|
+
end
|
83
|
+
@revision = revision_for(lib_path("foo-1.0"))[0...6]
|
84
|
+
|
85
|
+
install_gemfile <<-G
|
86
|
+
gem "foo", :git => "#{lib_path('foo-1.0')}", :branch => "omg"
|
87
|
+
G
|
88
|
+
should_be_installed "foo 1.0.omg"
|
77
89
|
|
78
|
-
|
79
|
-
|
80
|
-
s.write "lib/foo.rb", "FOO = '1.0.omg'"
|
90
|
+
bundle :show
|
91
|
+
expect(out).to include("foo (1.0 #{@git.ref_for('omg', 6)}")
|
81
92
|
end
|
82
|
-
@revision = revision_for(lib_path("foo-1.0"))[0...6]
|
83
93
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
94
|
+
it "doesn't print the branch when tied to a ref" do
|
95
|
+
sha = revision_for(lib_path("foo-1.0"))
|
96
|
+
install_gemfile <<-G
|
97
|
+
gem "foo", :git => "#{lib_path('foo-1.0')}", :ref => "#{sha}"
|
98
|
+
G
|
88
99
|
|
89
|
-
|
90
|
-
|
100
|
+
bundle :show
|
101
|
+
expect(out).to include("foo (1.0 #{sha[0..6]})")
|
102
|
+
end
|
91
103
|
end
|
92
104
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
105
|
+
context "in a fresh gem in a blank git repo" do
|
106
|
+
before :each do
|
107
|
+
build_git "foo", :path => lib_path("foo")
|
108
|
+
in_app_root_custom lib_path("foo")
|
109
|
+
File.open('Gemfile', 'w') {|f| f.puts "gemspec" }
|
110
|
+
sys_exec 'rm -rf .git && git init'
|
111
|
+
end
|
98
112
|
|
99
|
-
|
100
|
-
|
113
|
+
it "does not output git errors" do
|
114
|
+
bundle :show
|
115
|
+
expect(err).to be_empty
|
116
|
+
end
|
101
117
|
end
|
102
118
|
end
|
@@ -27,7 +27,7 @@ describe "bundle install with git sources" do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
it "caches the git repo" do
|
30
|
-
expect(Dir["#{default_bundle_path}/cache/bundler/git/foo-1.0-*"]).to
|
30
|
+
expect(Dir["#{default_bundle_path}/cache/bundler/git/foo-1.0-*"].size).to eq(1)
|
31
31
|
end
|
32
32
|
|
33
33
|
it "caches the evaluated gemspec" do
|
@@ -46,6 +46,18 @@ describe "bundle install with explicit source paths" do
|
|
46
46
|
should_be_installed("foo 1.0")
|
47
47
|
end
|
48
48
|
|
49
|
+
it "expands paths raise error with not existing user's home dir" do
|
50
|
+
build_lib "foo"
|
51
|
+
username = 'some_unexisting_user'
|
52
|
+
relative_path = lib_path('foo-1.0').relative_path_from(Pathname.new("/home/#{username}").expand_path)
|
53
|
+
|
54
|
+
install_gemfile <<-G
|
55
|
+
gem 'foo', :path => "~#{username}/#{relative_path}"
|
56
|
+
G
|
57
|
+
expect(out).to match("There was an error while trying to use the path `~#{username}/#{relative_path}`.")
|
58
|
+
expect(out).to match("user #{username} doesn't exist")
|
59
|
+
end
|
60
|
+
|
49
61
|
it "expands paths relative to Bundler.root" do
|
50
62
|
build_lib "foo", :path => bundled_app("foo-1.0")
|
51
63
|
|
@@ -45,3 +45,77 @@ describe "bundle install with gem sources" do
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
48
|
+
|
49
|
+
describe "bundle install with git sources" do
|
50
|
+
describe "when gems include post install messages" do
|
51
|
+
it "should display the post-install messages after installing" do
|
52
|
+
build_git "foo" do |s|
|
53
|
+
s.post_install_message = "Foo's post install message"
|
54
|
+
end
|
55
|
+
gemfile <<-G
|
56
|
+
source "file://#{gem_repo1}"
|
57
|
+
gem 'foo', :git => '#{lib_path("foo-1.0")}'
|
58
|
+
G
|
59
|
+
|
60
|
+
bundle :install
|
61
|
+
expect(out).to include("Post-install message from foo:")
|
62
|
+
expect(out).to include("Foo's post install message")
|
63
|
+
end
|
64
|
+
|
65
|
+
it "should display the post-install messages if repo is updated" do
|
66
|
+
build_git "foo" do |s|
|
67
|
+
s.post_install_message = "Foo's post install message"
|
68
|
+
end
|
69
|
+
gemfile <<-G
|
70
|
+
source "file://#{gem_repo1}"
|
71
|
+
gem 'foo', :git => '#{lib_path("foo-1.0")}'
|
72
|
+
G
|
73
|
+
bundle :install
|
74
|
+
|
75
|
+
build_git "foo", "1.1" do |s|
|
76
|
+
s.post_install_message = "Foo's 1.1 post install message"
|
77
|
+
end
|
78
|
+
gemfile <<-G
|
79
|
+
source "file://#{gem_repo1}"
|
80
|
+
gem 'foo', :git => '#{lib_path("foo-1.1")}'
|
81
|
+
G
|
82
|
+
bundle :install
|
83
|
+
|
84
|
+
expect(out).to include("Post-install message from foo:")
|
85
|
+
expect(out).to include("Foo's 1.1 post install message")
|
86
|
+
end
|
87
|
+
|
88
|
+
it "should not display the post-install messages if repo is not updated" do
|
89
|
+
build_git "foo" do |s|
|
90
|
+
s.post_install_message = "Foo's post install message"
|
91
|
+
end
|
92
|
+
gemfile <<-G
|
93
|
+
source "file://#{gem_repo1}"
|
94
|
+
gem 'foo', :git => '#{lib_path("foo-1.0")}'
|
95
|
+
G
|
96
|
+
|
97
|
+
bundle :install
|
98
|
+
expect(out).to include("Post-install message from foo:")
|
99
|
+
expect(out).to include("Foo's post install message")
|
100
|
+
|
101
|
+
bundle :install
|
102
|
+
expect(out).not_to include("Post-install message")
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
describe "when gems do not include post install messages" do
|
107
|
+
it "should not display any post-install messages" do
|
108
|
+
build_git "foo" do |s|
|
109
|
+
s.post_install_message = nil
|
110
|
+
end
|
111
|
+
gemfile <<-G
|
112
|
+
source "file://#{gem_repo1}"
|
113
|
+
gem 'foo', :git => '#{lib_path("foo-1.0")}'
|
114
|
+
G
|
115
|
+
|
116
|
+
bundle :install
|
117
|
+
expect(out).not_to include("Post-install message")
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
end
|
@@ -69,38 +69,34 @@ describe "bundle install with gem sources" do
|
|
69
69
|
end
|
70
70
|
|
71
71
|
context "with ENV['DEBUG_RESOLVER'] set" do
|
72
|
-
before do
|
73
|
-
ENV['DEBUG_RESOLVER'] = '1'
|
74
|
-
end
|
75
72
|
it "produces debug output" do
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
73
|
+
gemfile <<-G
|
74
|
+
source "file://#{gem_repo1}"
|
75
|
+
gem "net_c"
|
76
|
+
gem "net_e"
|
77
|
+
G
|
78
|
+
|
79
|
+
resolve_output = capture(:stdout) do
|
80
|
+
bundle :install, :env => {"DEBUG_RESOLVER" => "1"}
|
81
|
+
end
|
82
|
+
|
83
|
+
expect(resolve_output).to include("==== Iterating ====")
|
86
84
|
end
|
87
85
|
end
|
88
86
|
|
89
87
|
context "with ENV['DEBUG_RESOLVER_TREE'] set" do
|
90
|
-
before do
|
91
|
-
ENV['DEBUG_RESOLVER_TREE'] = '1'
|
92
|
-
end
|
93
88
|
it "produces debug output" do
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
89
|
+
gemfile <<-G
|
90
|
+
source "file://#{gem_repo1}"
|
91
|
+
gem "net_c"
|
92
|
+
gem "net_e"
|
93
|
+
G
|
94
|
+
|
95
|
+
resolve_output = capture(:stdout) do
|
96
|
+
bundle :install, :env => {"DEBUG_RESOLVER_TREE" => "1"}
|
97
|
+
end
|
98
|
+
|
99
|
+
expect(resolve_output).to include(" net_b (>= 0) ruby")
|
104
100
|
end
|
105
101
|
end
|
106
102
|
|
@@ -298,7 +298,7 @@ describe "bundle install with gem sources" do
|
|
298
298
|
install_gemfile <<-G
|
299
299
|
G
|
300
300
|
|
301
|
-
expect(File.exists?(bundled_app("Gemfile.lock"))).to
|
301
|
+
expect(File.exists?(bundled_app("Gemfile.lock"))).to be true
|
302
302
|
end
|
303
303
|
|
304
304
|
it "gracefully handles error when rubygems server is unavailable" do
|
@@ -337,6 +337,22 @@ describe "bundle install with gem sources" do
|
|
337
337
|
G
|
338
338
|
expect(exitstatus).to eq(0)
|
339
339
|
end
|
340
|
+
|
341
|
+
it "reinstalls the gem if the gem dir is missing but the specification file exists" do
|
342
|
+
gemfile(<<-G)
|
343
|
+
source "file://#{gem_repo1}"
|
344
|
+
|
345
|
+
gem 'foo'
|
346
|
+
G
|
347
|
+
|
348
|
+
bundle "install --path vendor/bundle"
|
349
|
+
|
350
|
+
FileUtils.rm_rf(vendored_gems('gems/foo-1.0'))
|
351
|
+
|
352
|
+
bundle "install"
|
353
|
+
|
354
|
+
expect(vendored_gems('gems/foo-1.0')).to exist
|
355
|
+
end
|
340
356
|
end
|
341
357
|
|
342
358
|
describe "when Bundler root contains regex chars" do
|
data/spec/install/path_spec.rb
CHANGED
data/spec/other/ext_spec.rb
CHANGED
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe "Gem::Specification#match_platform" do
|
4
4
|
it "does not match platforms other than the gem platform" do
|
5
5
|
darwin = gem "lol", "1.0", "platform_specific-1.0-x86-darwin-10"
|
6
|
-
expect(darwin.match_platform(pl('java'))).to
|
6
|
+
expect(darwin.match_platform(pl('java'))).to be false
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|