bundler 1.7.15 → 1.8.0.pre
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/.gitignore +5 -14
- data/.rspec +1 -0
- data/.travis.yml +22 -15
- data/CHANGELOG.md +43 -13
- data/CODE_OF_CONDUCT.md +40 -0
- data/CONTRIBUTING.md +14 -12
- data/DEVELOPMENT.md +4 -2
- data/ISSUES.md +1 -1
- data/README.md +10 -14
- data/Rakefile +10 -10
- data/bin/bundle +1 -1
- data/bundler.gemspec +5 -4
- data/lib/bundler.rb +22 -3
- data/lib/bundler/anonymizable_uri.rb +24 -8
- data/lib/bundler/cli.rb +103 -66
- data/lib/bundler/cli/cache.rb +1 -0
- data/lib/bundler/cli/clean.rb +11 -4
- data/lib/bundler/cli/common.rb +2 -0
- data/lib/bundler/cli/console.rb +22 -26
- data/lib/bundler/cli/exec.rb +29 -22
- data/lib/bundler/cli/gem.rb +125 -37
- data/lib/bundler/cli/install.rb +22 -9
- data/lib/bundler/cli/outdated.rb +1 -1
- data/lib/bundler/cli/package.rb +8 -1
- data/lib/bundler/cli/show.rb +29 -3
- data/lib/bundler/cli/update.rb +2 -2
- data/lib/bundler/cli/viz.rb +1 -1
- data/lib/bundler/definition.rb +14 -22
- data/lib/bundler/dependency.rb +8 -1
- data/lib/bundler/dsl.rb +17 -4
- data/lib/bundler/endpoint_specification.rb +1 -1
- data/lib/bundler/env.rb +44 -25
- data/lib/bundler/fetcher.rb +33 -25
- data/lib/bundler/friendly_errors.rb +38 -5
- data/lib/bundler/gem_helper.rb +16 -10
- data/lib/bundler/gem_helpers.rb +1 -0
- data/lib/bundler/graph.rb +4 -1
- data/lib/bundler/index.rb +15 -25
- data/lib/bundler/installer.rb +6 -6
- data/lib/bundler/lockfile_parser.rb +7 -7
- data/lib/bundler/resolver.rb +2 -1
- data/lib/bundler/ruby_version.rb +1 -1
- data/lib/bundler/rubygems_ext.rb +1 -0
- data/lib/bundler/rubygems_integration.rb +1 -1
- data/lib/bundler/runtime.rb +22 -40
- data/lib/bundler/settings.rb +14 -5
- data/lib/bundler/setup.rb +2 -1
- data/lib/bundler/shared_helpers.rb +56 -4
- data/lib/bundler/source.rb +8 -9
- data/lib/bundler/source/git.rb +5 -1
- data/lib/bundler/source/git/git_proxy.rb +4 -0
- data/lib/bundler/source/path.rb +8 -11
- data/lib/bundler/source/path/installer.rb +0 -2
- data/lib/bundler/source/rubygems.rb +58 -72
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +13 -0
- data/lib/bundler/templates/newgem/LICENSE.txt.tt +17 -18
- data/lib/bundler/templates/newgem/README.md.tt +9 -1
- data/lib/bundler/templates/newgem/Rakefile.tt +2 -0
- data/lib/bundler/templates/newgem/bin/console.tt +14 -0
- data/lib/bundler/templates/newgem/bin/setup.tt +7 -0
- data/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
- data/lib/bundler/templates/newgem/gitignore.tt +2 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +1 -1
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +17 -13
- data/lib/bundler/templates/newgem/test/test_newgem.rb.tt +1 -1
- data/lib/bundler/ui/shell.rb +1 -1
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/worker.rb +73 -0
- data/man/bundle-config.ronn +17 -15
- data/man/bundle-install.ronn +102 -93
- data/man/bundle-update.ronn +39 -30
- data/man/bundle.ronn +6 -0
- data/man/gemfile.5.ronn +74 -13
- metadata +10 -231
- data/lib/bundler/parallel_workers.rb +0 -18
- data/lib/bundler/parallel_workers/thread_worker.rb +0 -30
- data/lib/bundler/parallel_workers/unix_worker.rb +0 -101
- data/lib/bundler/parallel_workers/worker.rb +0 -69
- data/lib/bundler/templates/newgem/bin/newgem.tt +0 -3
- data/spec/bundler/anonymizable_uri_spec.rb +0 -32
- data/spec/bundler/bundler_spec.rb +0 -72
- data/spec/bundler/cli_spec.rb +0 -16
- data/spec/bundler/definition_spec.rb +0 -22
- data/spec/bundler/dsl_spec.rb +0 -82
- data/spec/bundler/friendly_errors_spec.rb +0 -13
- data/spec/bundler/gem_helper_spec.rb +0 -226
- data/spec/bundler/psyched_yaml_spec.rb +0 -8
- data/spec/bundler/retry_spec.rb +0 -59
- data/spec/bundler/settings_spec.rb +0 -13
- data/spec/bundler/source/rubygems_spec.rb +0 -25
- data/spec/bundler/source_list_spec.rb +0 -361
- data/spec/cache/gems_spec.rb +0 -284
- data/spec/cache/git_spec.rb +0 -188
- data/spec/cache/path_spec.rb +0 -121
- data/spec/cache/platform_spec.rb +0 -57
- data/spec/commands/binstubs_spec.rb +0 -219
- data/spec/commands/check_spec.rb +0 -278
- data/spec/commands/clean_spec.rb +0 -592
- data/spec/commands/config_spec.rb +0 -263
- data/spec/commands/console_spec.rb +0 -76
- data/spec/commands/exec_spec.rb +0 -309
- data/spec/commands/help_spec.rb +0 -39
- data/spec/commands/init_spec.rb +0 -39
- data/spec/commands/inject_spec.rb +0 -78
- data/spec/commands/licenses_spec.rb +0 -18
- data/spec/commands/newgem_spec.rb +0 -428
- data/spec/commands/open_spec.rb +0 -68
- data/spec/commands/outdated_spec.rb +0 -156
- data/spec/commands/package_spec.rb +0 -114
- data/spec/commands/show_spec.rb +0 -125
- data/spec/install/binstubs_spec.rb +0 -24
- data/spec/install/bundler_spec.rb +0 -146
- data/spec/install/deploy_spec.rb +0 -250
- data/spec/install/gemfile/gemspec_spec.rb +0 -170
- data/spec/install/gemfile/git_spec.rb +0 -967
- data/spec/install/gemfile/path_spec.rb +0 -500
- data/spec/install/gemfile_spec.rb +0 -44
- data/spec/install/gems/c_ext_spec.rb +0 -48
- data/spec/install/gems/dependency_api_spec.rb +0 -652
- data/spec/install/gems/env_spec.rb +0 -107
- data/spec/install/gems/flex_spec.rb +0 -314
- data/spec/install/gems/groups_spec.rb +0 -308
- data/spec/install/gems/mirror_spec.rb +0 -39
- data/spec/install/gems/platform_spec.rb +0 -195
- data/spec/install/gems/post_install_spec.rb +0 -121
- data/spec/install/gems/resolving_spec.rb +0 -124
- data/spec/install/gems/simple_case_spec.rb +0 -377
- data/spec/install/gems/sources_spec.rb +0 -386
- data/spec/install/gems/standalone_spec.rb +0 -260
- data/spec/install/gems/sudo_spec.rb +0 -136
- data/spec/install/gems/win32_spec.rb +0 -26
- data/spec/install/gemspecs_spec.rb +0 -50
- data/spec/install/path_spec.rb +0 -150
- data/spec/install/post_bundle_message_spec.rb +0 -142
- data/spec/install/prereleases_spec.rb +0 -43
- data/spec/install/security_policy_spec.rb +0 -77
- data/spec/install/upgrade_spec.rb +0 -26
- data/spec/lock/git_spec.rb +0 -34
- data/spec/lock/lockfile_spec.rb +0 -924
- data/spec/other/bundle_ruby_spec.rb +0 -142
- data/spec/other/cli_dispatch_spec.rb +0 -21
- data/spec/other/ext_spec.rb +0 -60
- data/spec/other/platform_spec.rb +0 -1285
- data/spec/other/ssl_cert_spec.rb +0 -23
- data/spec/quality_spec.rb +0 -88
- data/spec/realworld/dependency_api_spec.rb +0 -60
- data/spec/realworld/edgecases_spec.rb +0 -212
- data/spec/realworld/parallel_spec.rb +0 -71
- data/spec/resolver/basic_spec.rb +0 -66
- data/spec/resolver/platform_spec.rb +0 -88
- data/spec/runtime/executable_spec.rb +0 -149
- data/spec/runtime/load_spec.rb +0 -107
- data/spec/runtime/platform_spec.rb +0 -90
- data/spec/runtime/require_spec.rb +0 -332
- data/spec/runtime/setup_spec.rb +0 -853
- data/spec/runtime/with_clean_env_spec.rb +0 -91
- data/spec/spec_helper.rb +0 -123
- data/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb +0 -13
- data/spec/support/artifice/endpoint.rb +0 -71
- data/spec/support/artifice/endpoint_500.rb +0 -37
- data/spec/support/artifice/endpoint_api_forbidden.rb +0 -11
- data/spec/support/artifice/endpoint_api_missing.rb +0 -16
- data/spec/support/artifice/endpoint_basic_authentication.rb +0 -13
- data/spec/support/artifice/endpoint_creds_diff_host.rb +0 -38
- data/spec/support/artifice/endpoint_extra.rb +0 -31
- data/spec/support/artifice/endpoint_extra_api.rb +0 -32
- data/spec/support/artifice/endpoint_extra_missing.rb +0 -15
- data/spec/support/artifice/endpoint_fallback.rb +0 -17
- data/spec/support/artifice/endpoint_host_redirect.rb +0 -15
- data/spec/support/artifice/endpoint_marshal_fail.rb +0 -11
- data/spec/support/artifice/endpoint_redirect.rb +0 -15
- data/spec/support/artifice/endpoint_strict_basic_authentication.rb +0 -18
- data/spec/support/artifice/endpoint_timeout.rb +0 -13
- data/spec/support/builders.rb +0 -693
- data/spec/support/fakeweb/rack-1.0.0.marshal +0 -2
- data/spec/support/fakeweb/windows.rb +0 -23
- data/spec/support/hax.rb +0 -22
- data/spec/support/helpers.rb +0 -361
- data/spec/support/indexes.rb +0 -280
- data/spec/support/matchers.rb +0 -77
- data/spec/support/path.rb +0 -85
- data/spec/support/permissions.rb +0 -10
- data/spec/support/platforms.rb +0 -94
- data/spec/support/ruby_ext.rb +0 -20
- data/spec/support/rubygems_ext.rb +0 -39
- data/spec/support/streams.rb +0 -13
- data/spec/support/sudo.rb +0 -16
- data/spec/update/gems_spec.rb +0 -201
- data/spec/update/git_spec.rb +0 -283
- data/spec/update/path_spec.rb +0 -18
@@ -1,44 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "bundle install" do
|
4
|
-
|
5
|
-
context "with duplicated gems" do
|
6
|
-
it "will display a warning" do
|
7
|
-
install_gemfile <<-G
|
8
|
-
gem 'rails', '~> 4.0.0'
|
9
|
-
gem 'rails', '~> 4.0.0'
|
10
|
-
G
|
11
|
-
expect(out).to include("more than once")
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
context "with --gemfile" do
|
16
|
-
it "finds the gemfile" do
|
17
|
-
gemfile bundled_app("NotGemfile"), <<-G
|
18
|
-
source "file://#{gem_repo1}"
|
19
|
-
gem 'rack'
|
20
|
-
G
|
21
|
-
|
22
|
-
bundle :install, :gemfile => bundled_app("NotGemfile")
|
23
|
-
|
24
|
-
ENV['BUNDLE_GEMFILE'] = "NotGemfile"
|
25
|
-
should_be_installed "rack 1.0.0"
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
context "with deprecated features" do
|
30
|
-
before :each do
|
31
|
-
in_app_root
|
32
|
-
end
|
33
|
-
|
34
|
-
it "reports that lib is an invalid option" do
|
35
|
-
gemfile <<-G
|
36
|
-
gem "rack", :lib => "rack"
|
37
|
-
G
|
38
|
-
|
39
|
-
bundle :install
|
40
|
-
expect(out).to match(/You passed :lib as an option for gem 'rack', but it is invalid/)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "installing a gem with C extensions" do
|
4
|
-
it "installs" do
|
5
|
-
build_repo2 do
|
6
|
-
build_gem "c_extension" do |s|
|
7
|
-
s.extensions = ["ext/extconf.rb"]
|
8
|
-
s.write "ext/extconf.rb", <<-E
|
9
|
-
require "mkmf"
|
10
|
-
name = "c_extension_bundle"
|
11
|
-
dir_config(name)
|
12
|
-
raise "OMG" unless with_config("c_extension") == "hello"
|
13
|
-
create_makefile(name)
|
14
|
-
E
|
15
|
-
|
16
|
-
s.write "ext/c_extension.c", <<-C
|
17
|
-
#include "ruby.h"
|
18
|
-
|
19
|
-
VALUE c_extension_true(VALUE self) {
|
20
|
-
return Qtrue;
|
21
|
-
}
|
22
|
-
|
23
|
-
void Init_c_extension_bundle() {
|
24
|
-
VALUE c_Extension = rb_define_class("CExtension", rb_cObject);
|
25
|
-
rb_define_method(c_Extension, "its_true", c_extension_true, 0);
|
26
|
-
}
|
27
|
-
C
|
28
|
-
|
29
|
-
s.write "lib/c_extension.rb", <<-C
|
30
|
-
require "c_extension_bundle"
|
31
|
-
C
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
gemfile <<-G
|
36
|
-
source "file://#{gem_repo2}"
|
37
|
-
gem "c_extension"
|
38
|
-
G
|
39
|
-
|
40
|
-
bundle "config build.c_extension --with-c_extension=hello"
|
41
|
-
bundle "install"
|
42
|
-
|
43
|
-
expect(out).not_to include("extconf.rb failed")
|
44
|
-
|
45
|
-
run "Bundler.require; puts CExtension.new.its_true"
|
46
|
-
expect(out).to eq("true")
|
47
|
-
end
|
48
|
-
end
|
@@ -1,652 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "gemcutter's dependency API" do
|
4
|
-
let(:source_uri) { "http://localgemserver.test" }
|
5
|
-
|
6
|
-
it "should use the API" do
|
7
|
-
gemfile <<-G
|
8
|
-
source "#{source_uri}"
|
9
|
-
gem "rack"
|
10
|
-
G
|
11
|
-
|
12
|
-
bundle :install, :artifice => "endpoint"
|
13
|
-
expect(out).to include("Fetching gem metadata from #{source_uri}")
|
14
|
-
should_be_installed "rack 1.0.0"
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should URI encode gem names" do
|
18
|
-
gemfile <<-G
|
19
|
-
source "#{source_uri}"
|
20
|
-
gem " sinatra"
|
21
|
-
G
|
22
|
-
|
23
|
-
bundle :install, :artifice => "endpoint"
|
24
|
-
expect(out).to include("Could not find gem ' sinatra")
|
25
|
-
end
|
26
|
-
|
27
|
-
it "should handle nested dependencies" do
|
28
|
-
gemfile <<-G
|
29
|
-
source "#{source_uri}"
|
30
|
-
gem "rails"
|
31
|
-
G
|
32
|
-
|
33
|
-
bundle :install, :artifice => "endpoint"
|
34
|
-
expect(out).to include("Fetching gem metadata from #{source_uri}/...")
|
35
|
-
should_be_installed(
|
36
|
-
"rails 2.3.2",
|
37
|
-
"actionpack 2.3.2",
|
38
|
-
"activerecord 2.3.2",
|
39
|
-
"actionmailer 2.3.2",
|
40
|
-
"activeresource 2.3.2",
|
41
|
-
"activesupport 2.3.2")
|
42
|
-
end
|
43
|
-
|
44
|
-
it "should handle multiple gem dependencies on the same gem" do
|
45
|
-
gemfile <<-G
|
46
|
-
source "#{source_uri}"
|
47
|
-
gem "net-sftp"
|
48
|
-
G
|
49
|
-
|
50
|
-
bundle :install, :artifice => "endpoint"
|
51
|
-
should_be_installed "net-sftp 1.1.1"
|
52
|
-
end
|
53
|
-
|
54
|
-
it "should use the endpoint when using --deployment" do
|
55
|
-
gemfile <<-G
|
56
|
-
source "#{source_uri}"
|
57
|
-
gem "rack"
|
58
|
-
G
|
59
|
-
bundle :install, :artifice => "endpoint"
|
60
|
-
|
61
|
-
bundle "install --deployment", :artifice => "endpoint"
|
62
|
-
expect(out).to include("Fetching gem metadata from #{source_uri}")
|
63
|
-
should_be_installed "rack 1.0.0"
|
64
|
-
end
|
65
|
-
|
66
|
-
it "handles git dependencies that are in rubygems" do
|
67
|
-
build_git "foo" do |s|
|
68
|
-
s.executables = "foobar"
|
69
|
-
s.add_dependency "rails", "2.3.2"
|
70
|
-
end
|
71
|
-
|
72
|
-
gemfile <<-G
|
73
|
-
source "#{source_uri}"
|
74
|
-
git "file:///#{lib_path('foo-1.0')}" do
|
75
|
-
gem 'foo'
|
76
|
-
end
|
77
|
-
G
|
78
|
-
|
79
|
-
bundle :install, :artifice => "endpoint"
|
80
|
-
|
81
|
-
should_be_installed("rails 2.3.2")
|
82
|
-
end
|
83
|
-
|
84
|
-
it "handles git dependencies that are in rubygems using --deployment" do
|
85
|
-
build_git "foo" do |s|
|
86
|
-
s.executables = "foobar"
|
87
|
-
s.add_dependency "rails", "2.3.2"
|
88
|
-
end
|
89
|
-
|
90
|
-
gemfile <<-G
|
91
|
-
source "#{source_uri}"
|
92
|
-
gem 'foo', :git => "file:///#{lib_path('foo-1.0')}"
|
93
|
-
G
|
94
|
-
|
95
|
-
bundle :install, :artifice => "endpoint"
|
96
|
-
|
97
|
-
bundle "install --deployment", :artifice => "endpoint"
|
98
|
-
|
99
|
-
should_be_installed("rails 2.3.2")
|
100
|
-
end
|
101
|
-
|
102
|
-
it "doesn't fail if you only have a git gem with no deps when using --deployment" do
|
103
|
-
build_git "foo"
|
104
|
-
gemfile <<-G
|
105
|
-
source "#{source_uri}"
|
106
|
-
gem 'foo', :git => "file:///#{lib_path('foo-1.0')}"
|
107
|
-
G
|
108
|
-
|
109
|
-
bundle "install", :artifice => "endpoint"
|
110
|
-
bundle "install --deployment", :artifice => "endpoint", :exitstatus => true
|
111
|
-
|
112
|
-
expect(exitstatus).to eq(0)
|
113
|
-
should_be_installed("foo 1.0")
|
114
|
-
end
|
115
|
-
|
116
|
-
it "falls back when the API errors out" do
|
117
|
-
simulate_platform mswin
|
118
|
-
|
119
|
-
gemfile <<-G
|
120
|
-
source "#{source_uri}"
|
121
|
-
gem "rcov"
|
122
|
-
G
|
123
|
-
|
124
|
-
bundle :install, :fakeweb => "windows"
|
125
|
-
expect(out).to include("Fetching source index from #{source_uri}")
|
126
|
-
should_be_installed "rcov 1.0.0"
|
127
|
-
end
|
128
|
-
|
129
|
-
it "falls back when hitting the Gemcutter Dependency Limit" do
|
130
|
-
gemfile <<-G
|
131
|
-
source "#{source_uri}"
|
132
|
-
gem "activesupport"
|
133
|
-
gem "actionpack"
|
134
|
-
gem "actionmailer"
|
135
|
-
gem "activeresource"
|
136
|
-
gem "thin"
|
137
|
-
gem "rack"
|
138
|
-
gem "rails"
|
139
|
-
G
|
140
|
-
bundle :install, :artifice => "endpoint_fallback"
|
141
|
-
expect(out).to include("Fetching source index from #{source_uri}")
|
142
|
-
|
143
|
-
should_be_installed(
|
144
|
-
"activesupport 2.3.2",
|
145
|
-
"actionpack 2.3.2",
|
146
|
-
"actionmailer 2.3.2",
|
147
|
-
"activeresource 2.3.2",
|
148
|
-
"activesupport 2.3.2",
|
149
|
-
"thin 1.0.0",
|
150
|
-
"rack 1.0.0",
|
151
|
-
"rails 2.3.2")
|
152
|
-
end
|
153
|
-
|
154
|
-
it "falls back when Gemcutter API doesn't return proper Marshal format" do
|
155
|
-
gemfile <<-G
|
156
|
-
source "#{source_uri}"
|
157
|
-
gem "rack"
|
158
|
-
G
|
159
|
-
|
160
|
-
bundle :install, :verbose => true, :artifice => "endpoint_marshal_fail"
|
161
|
-
expect(out).to include("could not fetch from the dependency API, trying the full index")
|
162
|
-
should_be_installed "rack 1.0.0"
|
163
|
-
end
|
164
|
-
|
165
|
-
it "falls back when the API URL returns 403 Forbidden" do
|
166
|
-
gemfile <<-G
|
167
|
-
source "#{source_uri}"
|
168
|
-
gem "rack"
|
169
|
-
G
|
170
|
-
|
171
|
-
bundle :install, :verbose => true, :artifice => "endpoint_api_forbidden"
|
172
|
-
expect(out).to include("Fetching source index from #{source_uri}")
|
173
|
-
should_be_installed "rack 1.0.0"
|
174
|
-
end
|
175
|
-
|
176
|
-
it "handles host redirects" do
|
177
|
-
gemfile <<-G
|
178
|
-
source "#{source_uri}"
|
179
|
-
gem "rack"
|
180
|
-
G
|
181
|
-
|
182
|
-
bundle :install, :artifice => "endpoint_host_redirect"
|
183
|
-
should_be_installed "rack 1.0.0"
|
184
|
-
end
|
185
|
-
|
186
|
-
it "handles host redirects without Net::HTTP::Persistent" do
|
187
|
-
gemfile <<-G
|
188
|
-
source "#{source_uri}"
|
189
|
-
gem "rack"
|
190
|
-
G
|
191
|
-
|
192
|
-
FileUtils.mkdir_p lib_path
|
193
|
-
File.open(lib_path("disable_net_http_persistent.rb"), "w") do |h|
|
194
|
-
h.write <<-H
|
195
|
-
module Kernel
|
196
|
-
alias require_without_disabled_net_http require
|
197
|
-
def require(*args)
|
198
|
-
raise LoadError, 'simulated' if args.first == 'openssl' && !caller.grep(/vendored_persistent/).empty?
|
199
|
-
require_without_disabled_net_http(*args)
|
200
|
-
end
|
201
|
-
end
|
202
|
-
H
|
203
|
-
end
|
204
|
-
|
205
|
-
bundle :install, :artifice => "endpoint_host_redirect", :requires => [lib_path("disable_net_http_persistent.rb")]
|
206
|
-
expect(out).to_not match(/Too many redirects/)
|
207
|
-
should_be_installed "rack 1.0.0"
|
208
|
-
end
|
209
|
-
|
210
|
-
it "timeouts when Bundler::Fetcher redirects too much" do
|
211
|
-
gemfile <<-G
|
212
|
-
source "#{source_uri}"
|
213
|
-
gem "rack"
|
214
|
-
G
|
215
|
-
|
216
|
-
bundle :install, :artifice => "endpoint_redirect"
|
217
|
-
expect(out).to match(/Too many redirects/)
|
218
|
-
end
|
219
|
-
|
220
|
-
context "when --full-index is specified" do
|
221
|
-
it "should use the modern index for install" do
|
222
|
-
gemfile <<-G
|
223
|
-
source "#{source_uri}"
|
224
|
-
gem "rack"
|
225
|
-
G
|
226
|
-
|
227
|
-
bundle "install --full-index", :artifice => "endpoint"
|
228
|
-
expect(out).to include("Fetching source index from #{source_uri}")
|
229
|
-
should_be_installed "rack 1.0.0"
|
230
|
-
end
|
231
|
-
|
232
|
-
it "should use the modern index for update" do
|
233
|
-
gemfile <<-G
|
234
|
-
source "#{source_uri}"
|
235
|
-
gem "rack"
|
236
|
-
G
|
237
|
-
|
238
|
-
bundle "update --full-index", :artifice => "endpoint"
|
239
|
-
expect(out).to include("Fetching source index from #{source_uri}")
|
240
|
-
should_be_installed "rack 1.0.0"
|
241
|
-
end
|
242
|
-
end
|
243
|
-
|
244
|
-
it "fetches again when more dependencies are found in subsequent sources" do
|
245
|
-
build_repo2 do
|
246
|
-
build_gem "back_deps" do |s|
|
247
|
-
s.add_dependency "foo"
|
248
|
-
end
|
249
|
-
FileUtils.rm_rf Dir[gem_repo2("gems/foo-*.gem")]
|
250
|
-
end
|
251
|
-
|
252
|
-
gemfile <<-G
|
253
|
-
source "#{source_uri}"
|
254
|
-
source "#{source_uri}/extra"
|
255
|
-
gem "back_deps"
|
256
|
-
G
|
257
|
-
|
258
|
-
bundle :install, :artifice => "endpoint_extra"
|
259
|
-
should_be_installed "back_deps 1.0"
|
260
|
-
end
|
261
|
-
|
262
|
-
it "fetches gem versions even when those gems are already installed" do
|
263
|
-
gemfile <<-G
|
264
|
-
source "#{source_uri}"
|
265
|
-
gem "rack", "1.0.0"
|
266
|
-
G
|
267
|
-
bundle :install, :artifice => "endpoint_extra_api"
|
268
|
-
|
269
|
-
build_repo4 do
|
270
|
-
build_gem "rack", "1.2" do |s|
|
271
|
-
s.executables = "rackup"
|
272
|
-
end
|
273
|
-
end
|
274
|
-
|
275
|
-
gemfile <<-G
|
276
|
-
source "#{source_uri}" do; end
|
277
|
-
source "#{source_uri}/extra"
|
278
|
-
gem "rack", "1.2"
|
279
|
-
G
|
280
|
-
bundle :install, :artifice => "endpoint_extra_api"
|
281
|
-
should_be_installed "rack 1.2"
|
282
|
-
end
|
283
|
-
|
284
|
-
it "considers all possible versions of dependencies from all api gem sources" do
|
285
|
-
# In this scenario, the gem "somegem" only exists in repo4. It depends on specific version of activesupport that
|
286
|
-
# exists only in repo1. There happens also be a version of activesupport in repo4, but not the one that version 1.0.0
|
287
|
-
# of somegem wants. This test makes sure that bundler actually finds version 1.2.3 of active support in the other
|
288
|
-
# repo and installs it.
|
289
|
-
build_repo4 do
|
290
|
-
build_gem "activesupport", "1.2.0"
|
291
|
-
build_gem "somegem", "1.0.0" do |s|
|
292
|
-
s.add_dependency "activesupport", "1.2.3" #This version exists only in repo1
|
293
|
-
end
|
294
|
-
end
|
295
|
-
|
296
|
-
gemfile <<-G
|
297
|
-
source "#{source_uri}"
|
298
|
-
source "#{source_uri}/extra"
|
299
|
-
gem 'somegem', '1.0.0'
|
300
|
-
G
|
301
|
-
|
302
|
-
bundle :install, :artifice => "endpoint_extra_api"
|
303
|
-
|
304
|
-
should_be_installed "somegem 1.0.0"
|
305
|
-
should_be_installed "activesupport 1.2.3"
|
306
|
-
end
|
307
|
-
|
308
|
-
it "prints API output properly with back deps" do
|
309
|
-
build_repo2 do
|
310
|
-
build_gem "back_deps" do |s|
|
311
|
-
s.add_dependency "foo"
|
312
|
-
end
|
313
|
-
FileUtils.rm_rf Dir[gem_repo2("gems/foo-*.gem")]
|
314
|
-
end
|
315
|
-
|
316
|
-
gemfile <<-G
|
317
|
-
source "#{source_uri}"
|
318
|
-
source "#{source_uri}/extra"
|
319
|
-
gem "back_deps"
|
320
|
-
G
|
321
|
-
|
322
|
-
bundle :install, :artifice => "endpoint_extra"
|
323
|
-
|
324
|
-
expect(out).to include("Fetching gem metadata from http://localgemserver.test/..")
|
325
|
-
expect(out).to include("Fetching source index from http://localgemserver.test/extra")
|
326
|
-
end
|
327
|
-
|
328
|
-
it "does not fetch every spec if the index of gems is large when doing back deps" do
|
329
|
-
build_repo2 do
|
330
|
-
build_gem "back_deps" do |s|
|
331
|
-
s.add_dependency "foo"
|
332
|
-
end
|
333
|
-
build_gem "missing"
|
334
|
-
# need to hit the limit
|
335
|
-
1.upto(Bundler::Source::Rubygems::API_REQUEST_LIMIT) do |i|
|
336
|
-
build_gem "gem#{i}"
|
337
|
-
end
|
338
|
-
|
339
|
-
FileUtils.rm_rf Dir[gem_repo2("gems/foo-*.gem")]
|
340
|
-
end
|
341
|
-
|
342
|
-
gemfile <<-G
|
343
|
-
source "#{source_uri}"
|
344
|
-
source "#{source_uri}/extra"
|
345
|
-
gem "back_deps"
|
346
|
-
G
|
347
|
-
|
348
|
-
bundle :install, :artifice => "endpoint_extra_missing"
|
349
|
-
should_be_installed "back_deps 1.0"
|
350
|
-
end
|
351
|
-
|
352
|
-
it "uses the endpoint if all sources support it" do
|
353
|
-
gemfile <<-G
|
354
|
-
source "#{source_uri}"
|
355
|
-
|
356
|
-
gem 'foo'
|
357
|
-
G
|
358
|
-
|
359
|
-
bundle :install, :artifice => "endpoint_api_missing"
|
360
|
-
should_be_installed "foo 1.0"
|
361
|
-
end
|
362
|
-
|
363
|
-
it "fetches again when more dependencies are found in subsequent sources using --deployment" do
|
364
|
-
build_repo2 do
|
365
|
-
build_gem "back_deps" do |s|
|
366
|
-
s.add_dependency "foo"
|
367
|
-
end
|
368
|
-
FileUtils.rm_rf Dir[gem_repo2("gems/foo-*.gem")]
|
369
|
-
end
|
370
|
-
|
371
|
-
gemfile <<-G
|
372
|
-
source "#{source_uri}"
|
373
|
-
source "#{source_uri}/extra"
|
374
|
-
gem "back_deps"
|
375
|
-
G
|
376
|
-
|
377
|
-
bundle :install, :artifice => "endpoint_extra"
|
378
|
-
|
379
|
-
bundle "install --deployment", :artifice => "endpoint_extra"
|
380
|
-
should_be_installed "back_deps 1.0"
|
381
|
-
end
|
382
|
-
|
383
|
-
it "does not refetch if the only unmet dependency is bundler" do
|
384
|
-
gemfile <<-G
|
385
|
-
source "#{source_uri}"
|
386
|
-
|
387
|
-
gem "bundler_dep"
|
388
|
-
G
|
389
|
-
|
390
|
-
bundle :install, :artifice => "endpoint"
|
391
|
-
expect(out).to include("Fetching gem metadata from #{source_uri}")
|
392
|
-
end
|
393
|
-
|
394
|
-
it "should install when EndpointSpecification has a bin dir owned by root", :sudo => true do
|
395
|
-
sudo "mkdir -p #{system_gem_path("bin")}"
|
396
|
-
sudo "chown -R root #{system_gem_path("bin")}"
|
397
|
-
|
398
|
-
gemfile <<-G
|
399
|
-
source "#{source_uri}"
|
400
|
-
gem "rails"
|
401
|
-
G
|
402
|
-
bundle :install, :artifice => "endpoint"
|
403
|
-
should_be_installed "rails 2.3.2"
|
404
|
-
end
|
405
|
-
|
406
|
-
it "installs the binstubs" do
|
407
|
-
gemfile <<-G
|
408
|
-
source "#{source_uri}"
|
409
|
-
gem "rack"
|
410
|
-
G
|
411
|
-
|
412
|
-
bundle "install --binstubs", :artifice => "endpoint"
|
413
|
-
|
414
|
-
gembin "rackup"
|
415
|
-
expect(out).to eq("1.0.0")
|
416
|
-
end
|
417
|
-
|
418
|
-
it "installs the bins when using --path and uses autoclean" do
|
419
|
-
gemfile <<-G
|
420
|
-
source "#{source_uri}"
|
421
|
-
gem "rack"
|
422
|
-
G
|
423
|
-
|
424
|
-
bundle "install --path vendor/bundle", :artifice => "endpoint"
|
425
|
-
|
426
|
-
expect(vendored_gems("bin/rackup")).to exist
|
427
|
-
end
|
428
|
-
|
429
|
-
it "installs the bins when using --path and uses bundle clean" do
|
430
|
-
gemfile <<-G
|
431
|
-
source "#{source_uri}"
|
432
|
-
gem "rack"
|
433
|
-
G
|
434
|
-
|
435
|
-
bundle "install --path vendor/bundle --no-clean", :artifice => "endpoint"
|
436
|
-
|
437
|
-
expect(vendored_gems("bin/rackup")).to exist
|
438
|
-
end
|
439
|
-
|
440
|
-
it "prints post_install_messages" do
|
441
|
-
gemfile <<-G
|
442
|
-
source "#{source_uri}"
|
443
|
-
gem 'rack-obama'
|
444
|
-
G
|
445
|
-
|
446
|
-
bundle :install, :artifice => "endpoint"
|
447
|
-
expect(out).to include("Post-install message from rack:")
|
448
|
-
end
|
449
|
-
|
450
|
-
it "should display the post install message for a dependency" do
|
451
|
-
gemfile <<-G
|
452
|
-
source "#{source_uri}"
|
453
|
-
gem 'rack_middleware'
|
454
|
-
G
|
455
|
-
|
456
|
-
bundle :install, :artifice => "endpoint"
|
457
|
-
expect(out).to include("Post-install message from rack:")
|
458
|
-
expect(out).to include("Rack's post install message")
|
459
|
-
end
|
460
|
-
|
461
|
-
context "when using basic authentication" do
|
462
|
-
let(:user) { "user" }
|
463
|
-
let(:password) { "pass" }
|
464
|
-
let(:basic_auth_source_uri) do
|
465
|
-
uri = URI.parse(source_uri)
|
466
|
-
uri.user = user
|
467
|
-
uri.password = password
|
468
|
-
|
469
|
-
uri
|
470
|
-
end
|
471
|
-
|
472
|
-
it "passes basic authentication details and strips out creds" do
|
473
|
-
gemfile <<-G
|
474
|
-
source "#{basic_auth_source_uri}"
|
475
|
-
gem "rack"
|
476
|
-
G
|
477
|
-
|
478
|
-
bundle :install, :artifice => "endpoint_basic_authentication"
|
479
|
-
expect(out).not_to include("#{user}:#{password}")
|
480
|
-
should_be_installed "rack 1.0.0"
|
481
|
-
end
|
482
|
-
|
483
|
-
it "strips http basic authentication creds for modern index" do
|
484
|
-
gemfile <<-G
|
485
|
-
source "#{basic_auth_source_uri}"
|
486
|
-
gem "rack"
|
487
|
-
G
|
488
|
-
|
489
|
-
bundle :install, :artifice => "endopint_marshal_fail_basic_authentication"
|
490
|
-
expect(out).not_to include("#{user}:#{password}")
|
491
|
-
should_be_installed "rack 1.0.0"
|
492
|
-
end
|
493
|
-
|
494
|
-
it "strips http basic auth creds when it can't reach the server" do
|
495
|
-
gemfile <<-G
|
496
|
-
source "#{basic_auth_source_uri}"
|
497
|
-
gem "rack"
|
498
|
-
G
|
499
|
-
|
500
|
-
bundle :install, :artifice => "endpoint_500"
|
501
|
-
expect(out).not_to include("#{user}:#{password}")
|
502
|
-
end
|
503
|
-
|
504
|
-
it "strips http basic auth creds when warning about ambiguous sources" do
|
505
|
-
gemfile <<-G
|
506
|
-
source "#{basic_auth_source_uri}"
|
507
|
-
source "file://#{gem_repo1}"
|
508
|
-
gem "rack"
|
509
|
-
G
|
510
|
-
|
511
|
-
bundle :install, :artifice => "endpoint_basic_authentication"
|
512
|
-
expect(out).to include("Warning: the gem 'rack' was found in multiple sources.")
|
513
|
-
expect(out).not_to include("#{user}:#{password}")
|
514
|
-
should_be_installed "rack 1.0.0"
|
515
|
-
end
|
516
|
-
|
517
|
-
it "does not pass the user / password to different hosts on redirect" do
|
518
|
-
gemfile <<-G
|
519
|
-
source "#{basic_auth_source_uri}"
|
520
|
-
gem "rack"
|
521
|
-
G
|
522
|
-
|
523
|
-
bundle :install, :artifice => "endpoint_creds_diff_host"
|
524
|
-
should_be_installed "rack 1.0.0"
|
525
|
-
end
|
526
|
-
|
527
|
-
describe "with authentication details in bundle config" do
|
528
|
-
before do
|
529
|
-
gemfile <<-G
|
530
|
-
source "#{source_uri}"
|
531
|
-
gem "rack"
|
532
|
-
G
|
533
|
-
end
|
534
|
-
|
535
|
-
it "reads authentication details from bundle config" do
|
536
|
-
# The trailing slash is necessary here; Fetcher canonicalizes the URI.
|
537
|
-
bundle "config #{source_uri}/ #{user}:#{password}"
|
538
|
-
|
539
|
-
bundle :install, :artifice => "endpoint_strict_basic_authentication"
|
540
|
-
|
541
|
-
expect(out).to include("Fetching gem metadata from #{source_uri}")
|
542
|
-
should_be_installed "rack 1.0.0"
|
543
|
-
end
|
544
|
-
|
545
|
-
it "prefers auth supplied in the source uri" do
|
546
|
-
gemfile <<-G
|
547
|
-
source "#{basic_auth_source_uri}"
|
548
|
-
gem "rack"
|
549
|
-
G
|
550
|
-
|
551
|
-
bundle "config #{source_uri}/ otheruser:wrong"
|
552
|
-
|
553
|
-
bundle :install, :artifice => "endpoint_strict_basic_authentication"
|
554
|
-
should_be_installed "rack 1.0.0"
|
555
|
-
end
|
556
|
-
|
557
|
-
it "shows instructions if auth is not provided for the source" do
|
558
|
-
bundle :install, :artifice => "endpoint_strict_basic_authentication"
|
559
|
-
expect(out).to include("bundle config #{source_uri}/ username:password")
|
560
|
-
end
|
561
|
-
|
562
|
-
it "fails if authentication has already been provided, but failed" do
|
563
|
-
bundle "config #{source_uri}/ #{user}:wrong"
|
564
|
-
|
565
|
-
bundle :install, :artifice => "endpoint_strict_basic_authentication"
|
566
|
-
expect(out).to include("Bad username or password")
|
567
|
-
end
|
568
|
-
end
|
569
|
-
|
570
|
-
describe "with no password" do
|
571
|
-
let(:password) { nil }
|
572
|
-
|
573
|
-
it "passes basic authentication details" do
|
574
|
-
gemfile <<-G
|
575
|
-
source "#{basic_auth_source_uri}"
|
576
|
-
gem "rack"
|
577
|
-
G
|
578
|
-
|
579
|
-
bundle :install, :artifice => "endpoint_basic_authentication"
|
580
|
-
should_be_installed "rack 1.0.0"
|
581
|
-
end
|
582
|
-
end
|
583
|
-
end
|
584
|
-
|
585
|
-
context "when ruby is compiled without openssl" do
|
586
|
-
before do
|
587
|
-
# Install a monkeypatch that reproduces the effects of openssl being
|
588
|
-
# missing when the fetcher runs, as happens in real life. The reason
|
589
|
-
# we can't just overwrite openssl.rb is that Artifice uses it.
|
590
|
-
bundled_app("broken_ssl").mkpath
|
591
|
-
bundled_app("broken_ssl/openssl.rb").open("w") do |f|
|
592
|
-
f.write <<-RUBY
|
593
|
-
raise LoadError, "cannot load such file -- openssl"
|
594
|
-
RUBY
|
595
|
-
end
|
596
|
-
end
|
597
|
-
|
598
|
-
it "explains what to do to get it" do
|
599
|
-
gemfile <<-G
|
600
|
-
source "#{source_uri.gsub(/http/, 'https')}"
|
601
|
-
gem "rack"
|
602
|
-
G
|
603
|
-
|
604
|
-
bundle :install, :env => {"RUBYOPT" => "-I#{bundled_app("broken_ssl")}"}
|
605
|
-
expect(out).to include("OpenSSL")
|
606
|
-
end
|
607
|
-
end
|
608
|
-
|
609
|
-
context "when SSL certificate verification fails" do
|
610
|
-
it "explains what happened" do
|
611
|
-
# Install a monkeypatch that reproduces the effects of openssl raising
|
612
|
-
# a certificate validation error when Rubygems tries to connect.
|
613
|
-
gemfile <<-G
|
614
|
-
class Net::HTTP
|
615
|
-
def start
|
616
|
-
raise OpenSSL::SSL::SSLError, "certificate verify failed"
|
617
|
-
end
|
618
|
-
end
|
619
|
-
|
620
|
-
source "#{source_uri.gsub(/http/, 'https')}"
|
621
|
-
gem "rack"
|
622
|
-
G
|
623
|
-
|
624
|
-
bundle :install
|
625
|
-
expect(out).to match(/could not verify the SSL certificate/i)
|
626
|
-
end
|
627
|
-
end
|
628
|
-
|
629
|
-
context ".gemrc with sources is present" do
|
630
|
-
before do
|
631
|
-
File.open(home('.gemrc'), 'w') do |file|
|
632
|
-
file.puts({:sources => ["https://rubygems.org"]}.to_yaml)
|
633
|
-
end
|
634
|
-
end
|
635
|
-
|
636
|
-
after do
|
637
|
-
home('.gemrc').rmtree
|
638
|
-
end
|
639
|
-
|
640
|
-
it "uses other sources declared in the Gemfile" do
|
641
|
-
gemfile <<-G
|
642
|
-
source "#{source_uri}"
|
643
|
-
gem 'rack'
|
644
|
-
G
|
645
|
-
|
646
|
-
bundle "install", :exitstatus => true, :artifice => "endpoint_marshal_fail"
|
647
|
-
|
648
|
-
expect(exitstatus).to eq(0)
|
649
|
-
end
|
650
|
-
end
|
651
|
-
|
652
|
-
end
|