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
data/spec/cache/path_spec.rb
DELETED
@@ -1,121 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
%w(cache package).each do |cmd|
|
4
|
-
describe "bundle #{cmd} with path" do
|
5
|
-
it "is no-op when the path is within the bundle" do
|
6
|
-
build_lib "foo", :path => bundled_app("lib/foo")
|
7
|
-
|
8
|
-
install_gemfile <<-G
|
9
|
-
gem "foo", :path => '#{bundled_app("lib/foo")}'
|
10
|
-
G
|
11
|
-
|
12
|
-
bundle "#{cmd} --all"
|
13
|
-
expect(bundled_app("vendor/cache/foo-1.0")).not_to exist
|
14
|
-
should_be_installed "foo 1.0"
|
15
|
-
end
|
16
|
-
|
17
|
-
it "copies when the path is outside the bundle " do
|
18
|
-
build_lib "foo"
|
19
|
-
|
20
|
-
install_gemfile <<-G
|
21
|
-
gem "foo", :path => '#{lib_path("foo-1.0")}'
|
22
|
-
G
|
23
|
-
|
24
|
-
bundle "#{cmd} --all"
|
25
|
-
expect(bundled_app("vendor/cache/foo-1.0")).to exist
|
26
|
-
expect(bundled_app("vendor/cache/foo-1.0/.bundlecache")).to be_file
|
27
|
-
|
28
|
-
FileUtils.rm_rf lib_path("foo-1.0")
|
29
|
-
should_be_installed "foo 1.0"
|
30
|
-
end
|
31
|
-
|
32
|
-
it "updates the path on each cache" do
|
33
|
-
build_lib "foo"
|
34
|
-
|
35
|
-
install_gemfile <<-G
|
36
|
-
gem "foo", :path => '#{lib_path("foo-1.0")}'
|
37
|
-
G
|
38
|
-
|
39
|
-
bundle "#{cmd} --all"
|
40
|
-
|
41
|
-
build_lib "foo" do |s|
|
42
|
-
s.write "lib/foo.rb", "puts :CACHE"
|
43
|
-
end
|
44
|
-
|
45
|
-
bundle "#{cmd} --all"
|
46
|
-
|
47
|
-
expect(bundled_app("vendor/cache/foo-1.0")).to exist
|
48
|
-
FileUtils.rm_rf lib_path("foo-1.0")
|
49
|
-
|
50
|
-
run "require 'foo'"
|
51
|
-
expect(out).to eq("CACHE")
|
52
|
-
end
|
53
|
-
|
54
|
-
it "removes stale entries cache" do
|
55
|
-
build_lib "foo"
|
56
|
-
|
57
|
-
install_gemfile <<-G
|
58
|
-
gem "foo", :path => '#{lib_path("foo-1.0")}'
|
59
|
-
G
|
60
|
-
|
61
|
-
bundle "#{cmd} --all"
|
62
|
-
|
63
|
-
install_gemfile <<-G
|
64
|
-
gem "bar", :path => '#{lib_path("bar-1.0")}'
|
65
|
-
G
|
66
|
-
|
67
|
-
bundle "#{cmd} --all"
|
68
|
-
expect(bundled_app("vendor/cache/bar-1.0")).not_to exist
|
69
|
-
end
|
70
|
-
|
71
|
-
it "raises a warning without --all" do
|
72
|
-
build_lib "foo"
|
73
|
-
|
74
|
-
install_gemfile <<-G
|
75
|
-
gem "foo", :path => '#{lib_path("foo-1.0")}'
|
76
|
-
G
|
77
|
-
|
78
|
-
bundle cmd
|
79
|
-
expect(out).to match(/please pass the \-\-all flag/)
|
80
|
-
expect(bundled_app("vendor/cache/foo-1.0")).not_to exist
|
81
|
-
end
|
82
|
-
|
83
|
-
it "stores the given flag" do
|
84
|
-
build_lib "foo"
|
85
|
-
|
86
|
-
install_gemfile <<-G
|
87
|
-
gem "foo", :path => '#{lib_path("foo-1.0")}'
|
88
|
-
G
|
89
|
-
|
90
|
-
bundle "#{cmd} --all"
|
91
|
-
build_lib "bar"
|
92
|
-
|
93
|
-
install_gemfile <<-G
|
94
|
-
gem "foo", :path => '#{lib_path("foo-1.0")}'
|
95
|
-
gem "bar", :path => '#{lib_path("bar-1.0")}'
|
96
|
-
G
|
97
|
-
|
98
|
-
bundle cmd
|
99
|
-
expect(bundled_app("vendor/cache/bar-1.0")).to exist
|
100
|
-
end
|
101
|
-
|
102
|
-
it "can rewind chosen configuration" do
|
103
|
-
build_lib "foo"
|
104
|
-
|
105
|
-
install_gemfile <<-G
|
106
|
-
gem "foo", :path => '#{lib_path("foo-1.0")}'
|
107
|
-
G
|
108
|
-
|
109
|
-
bundle "#{cmd} --all"
|
110
|
-
build_lib "baz"
|
111
|
-
|
112
|
-
gemfile <<-G
|
113
|
-
gem "foo", :path => '#{lib_path("foo-1.0")}'
|
114
|
-
gem "baz", :path => '#{lib_path("baz-1.0")}'
|
115
|
-
G
|
116
|
-
|
117
|
-
bundle "#{cmd} --no-all"
|
118
|
-
expect(bundled_app("vendor/cache/baz-1.0")).not_to exist
|
119
|
-
end
|
120
|
-
end
|
121
|
-
end
|
data/spec/cache/platform_spec.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "bundle cache with multiple platforms" do
|
4
|
-
before :each do
|
5
|
-
gemfile <<-G
|
6
|
-
source "file://#{gem_repo1}"
|
7
|
-
|
8
|
-
platforms :ruby, :ruby_18, :ruby_19, :ruby_20, :ruby_21, :ruby_22 do
|
9
|
-
gem "rack", "1.0.0"
|
10
|
-
end
|
11
|
-
|
12
|
-
platforms :jruby do
|
13
|
-
gem "activesupport", "2.3.5"
|
14
|
-
end
|
15
|
-
|
16
|
-
platforms :mri, :mri_18, :mri_19, :mri_20, :mri_21, :mri_22 do
|
17
|
-
gem "activerecord", "2.3.2"
|
18
|
-
end
|
19
|
-
G
|
20
|
-
|
21
|
-
lockfile <<-G
|
22
|
-
GEM
|
23
|
-
remote: file:#{gem_repo1}/
|
24
|
-
specs:
|
25
|
-
rack (1.0.0)
|
26
|
-
activesupport (2.3.5)
|
27
|
-
activerecord (2.3.2)
|
28
|
-
|
29
|
-
PLATFORMS
|
30
|
-
ruby
|
31
|
-
java
|
32
|
-
|
33
|
-
DEPENDENCIES
|
34
|
-
rack (1.0.0)
|
35
|
-
activesupport (2.3.5)
|
36
|
-
activerecord (2.3.2)
|
37
|
-
G
|
38
|
-
|
39
|
-
cache_gems "rack-1.0.0", "activesupport-2.3.5", "activerecord-2.3.2"
|
40
|
-
end
|
41
|
-
|
42
|
-
it "ensures that bundle install does not delete gems for other platforms" do
|
43
|
-
bundle "install"
|
44
|
-
|
45
|
-
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
|
46
|
-
expect(bundled_app("vendor/cache/activesupport-2.3.5.gem")).to exist
|
47
|
-
expect(bundled_app("vendor/cache/activerecord-2.3.2.gem")).to exist
|
48
|
-
end
|
49
|
-
|
50
|
-
it "ensures that bundle update does not delete gems for other platforms" do
|
51
|
-
bundle "update"
|
52
|
-
|
53
|
-
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
|
54
|
-
expect(bundled_app("vendor/cache/activesupport-2.3.5.gem")).to exist
|
55
|
-
expect(bundled_app("vendor/cache/activerecord-2.3.2.gem")).to exist
|
56
|
-
end
|
57
|
-
end
|
@@ -1,219 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "bundle binstubs <gem>" do
|
4
|
-
context "when the gem exists in the lockfile" do
|
5
|
-
it "sets up the binstub" do
|
6
|
-
install_gemfile <<-G
|
7
|
-
source "file://#{gem_repo1}"
|
8
|
-
gem "rack"
|
9
|
-
G
|
10
|
-
|
11
|
-
bundle "binstubs rack"
|
12
|
-
|
13
|
-
expect(bundled_app("bin/rackup")).to exist
|
14
|
-
end
|
15
|
-
|
16
|
-
it "does not install other binstubs" do
|
17
|
-
install_gemfile <<-G
|
18
|
-
source "file://#{gem_repo1}"
|
19
|
-
gem "rack"
|
20
|
-
gem "rails"
|
21
|
-
G
|
22
|
-
|
23
|
-
bundle "binstubs rails"
|
24
|
-
|
25
|
-
expect(bundled_app("bin/rackup")).not_to exist
|
26
|
-
expect(bundled_app("bin/rails")).to exist
|
27
|
-
end
|
28
|
-
|
29
|
-
it "does install multiple binstubs" do
|
30
|
-
install_gemfile <<-G
|
31
|
-
source "file://#{gem_repo1}"
|
32
|
-
gem "rack"
|
33
|
-
gem "rails"
|
34
|
-
G
|
35
|
-
|
36
|
-
bundle "binstubs rails rack"
|
37
|
-
|
38
|
-
expect(bundled_app("bin/rackup")).to exist
|
39
|
-
expect(bundled_app("bin/rails")).to exist
|
40
|
-
end
|
41
|
-
|
42
|
-
it "displays an error when used without any gem" do
|
43
|
-
install_gemfile <<-G
|
44
|
-
source "file://#{gem_repo1}"
|
45
|
-
gem "rack"
|
46
|
-
G
|
47
|
-
|
48
|
-
bundle "binstubs", :exitstatus => true
|
49
|
-
expect(exitstatus).to eq(1)
|
50
|
-
expect(out).to eq("`bundle binstubs` needs at least one gem to run.")
|
51
|
-
end
|
52
|
-
|
53
|
-
it "does not bundle the bundler binary" do
|
54
|
-
install_gemfile <<-G
|
55
|
-
source "file://#{gem_repo1}"
|
56
|
-
G
|
57
|
-
|
58
|
-
bundle "binstubs bundler"
|
59
|
-
|
60
|
-
expect(bundled_app("bin/bundle")).not_to exist
|
61
|
-
expect(out).to eq("Sorry, Bundler can only be run via Rubygems.")
|
62
|
-
end
|
63
|
-
|
64
|
-
it "installs binstubs from git gems" do
|
65
|
-
FileUtils.mkdir_p(lib_path("foo/bin"))
|
66
|
-
FileUtils.touch(lib_path("foo/bin/foo"))
|
67
|
-
build_git "foo", "1.0", :path => lib_path("foo") do |s|
|
68
|
-
s.executables = %w(foo)
|
69
|
-
end
|
70
|
-
install_gemfile <<-G
|
71
|
-
gem "foo", :git => "#{lib_path('foo')}"
|
72
|
-
G
|
73
|
-
|
74
|
-
bundle "binstubs foo"
|
75
|
-
|
76
|
-
expect(bundled_app("bin/foo")).to exist
|
77
|
-
end
|
78
|
-
|
79
|
-
it "installs binstubs from path gems" do
|
80
|
-
FileUtils.mkdir_p(lib_path("foo/bin"))
|
81
|
-
FileUtils.touch(lib_path("foo/bin/foo"))
|
82
|
-
build_lib "foo" , "1.0", :path => lib_path("foo") do |s|
|
83
|
-
s.executables = %w(foo)
|
84
|
-
end
|
85
|
-
install_gemfile <<-G
|
86
|
-
gem "foo", :path => "#{lib_path('foo')}"
|
87
|
-
G
|
88
|
-
|
89
|
-
bundle "binstubs foo"
|
90
|
-
|
91
|
-
expect(bundled_app("bin/foo")).to exist
|
92
|
-
end
|
93
|
-
|
94
|
-
it "sets correct permissions for binstubs" do
|
95
|
-
with_umask(0002) do
|
96
|
-
install_gemfile <<-G
|
97
|
-
source "file://#{gem_repo1}"
|
98
|
-
gem "rack"
|
99
|
-
G
|
100
|
-
|
101
|
-
bundle "binstubs rack"
|
102
|
-
binary = bundled_app("bin/rackup")
|
103
|
-
expect(File.stat(binary).mode.to_s(8)).to eq("100775")
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
context "when the gem doesn't exist" do
|
109
|
-
it "displays an error with correct status" do
|
110
|
-
install_gemfile <<-G
|
111
|
-
source "file://#{gem_repo1}"
|
112
|
-
G
|
113
|
-
|
114
|
-
bundle "binstubs doesnt_exist", :exitstatus => true
|
115
|
-
|
116
|
-
expect(exitstatus).to eq(7)
|
117
|
-
expect(out).to eq("Could not find gem 'doesnt_exist'.")
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
context "--path" do
|
122
|
-
it "sets the binstubs dir" do
|
123
|
-
install_gemfile <<-G
|
124
|
-
source "file://#{gem_repo1}"
|
125
|
-
gem "rack"
|
126
|
-
G
|
127
|
-
|
128
|
-
bundle "binstubs rack --path exec"
|
129
|
-
|
130
|
-
expect(bundled_app("exec/rackup")).to exist
|
131
|
-
end
|
132
|
-
|
133
|
-
it "setting is saved for bundle install" do
|
134
|
-
install_gemfile <<-G
|
135
|
-
source "file://#{gem_repo1}"
|
136
|
-
gem "rack"
|
137
|
-
gem "rails"
|
138
|
-
G
|
139
|
-
|
140
|
-
bundle "binstubs rack --path exec"
|
141
|
-
bundle :install
|
142
|
-
|
143
|
-
expect(bundled_app("exec/rails")).to exist
|
144
|
-
end
|
145
|
-
end
|
146
|
-
|
147
|
-
context "when the bin already exists" do
|
148
|
-
it "doesn't overwrite and warns" do
|
149
|
-
FileUtils.mkdir_p(bundled_app("bin"))
|
150
|
-
File.open(bundled_app("bin/rackup"), 'wb') do |file|
|
151
|
-
file.print "OMG"
|
152
|
-
end
|
153
|
-
|
154
|
-
install_gemfile <<-G
|
155
|
-
source "file://#{gem_repo1}"
|
156
|
-
gem "rack"
|
157
|
-
G
|
158
|
-
|
159
|
-
bundle "binstubs rack"
|
160
|
-
|
161
|
-
expect(bundled_app("bin/rackup")).to exist
|
162
|
-
expect(File.read(bundled_app("bin/rackup"))).to eq("OMG")
|
163
|
-
expect(out).to include("Skipped rackup")
|
164
|
-
expect(out).to include("overwrite skipped stubs, use --force")
|
165
|
-
end
|
166
|
-
|
167
|
-
context "when using --force" do
|
168
|
-
it "overwrites the binstub" do
|
169
|
-
FileUtils.mkdir_p(bundled_app("bin"))
|
170
|
-
File.open(bundled_app("bin/rackup"), 'wb') do |file|
|
171
|
-
file.print "OMG"
|
172
|
-
end
|
173
|
-
|
174
|
-
install_gemfile <<-G
|
175
|
-
source "file://#{gem_repo1}"
|
176
|
-
gem "rack"
|
177
|
-
G
|
178
|
-
|
179
|
-
bundle "binstubs rack --force"
|
180
|
-
|
181
|
-
expect(bundled_app("bin/rackup")).to exist
|
182
|
-
expect(File.read(bundled_app("bin/rackup"))).not_to eq("OMG")
|
183
|
-
end
|
184
|
-
end
|
185
|
-
end
|
186
|
-
|
187
|
-
context "when the gem has no bins" do
|
188
|
-
it "suggests child gems if they have bins" do
|
189
|
-
install_gemfile <<-G
|
190
|
-
source "file://#{gem_repo1}"
|
191
|
-
gem "rack-obama"
|
192
|
-
G
|
193
|
-
|
194
|
-
bundle "binstubs rack-obama"
|
195
|
-
expect(out).to include('rack-obama has no executables')
|
196
|
-
expect(out).to include('rack has: rackup')
|
197
|
-
end
|
198
|
-
|
199
|
-
it "works if child gems don't have bins" do
|
200
|
-
install_gemfile <<-G
|
201
|
-
source "file://#{gem_repo1}"
|
202
|
-
gem "actionpack"
|
203
|
-
G
|
204
|
-
|
205
|
-
bundle "binstubs actionpack"
|
206
|
-
expect(out).to include('no executables for the gem actionpack')
|
207
|
-
end
|
208
|
-
|
209
|
-
it "works if the gem has development dependencies" do
|
210
|
-
install_gemfile <<-G
|
211
|
-
source "file://#{gem_repo1}"
|
212
|
-
gem "with_development_dependency"
|
213
|
-
G
|
214
|
-
|
215
|
-
bundle "binstubs with_development_dependency"
|
216
|
-
expect(out).to include('no executables for the gem with_development_dependency')
|
217
|
-
end
|
218
|
-
end
|
219
|
-
end
|
data/spec/commands/check_spec.rb
DELETED
@@ -1,278 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "bundle check" do
|
4
|
-
it "returns success when the Gemfile is satisfied" do
|
5
|
-
install_gemfile <<-G
|
6
|
-
source "file://#{gem_repo1}"
|
7
|
-
gem "rails"
|
8
|
-
G
|
9
|
-
|
10
|
-
bundle :check, :exitstatus => true
|
11
|
-
expect(@exitstatus).to eq(0)
|
12
|
-
expect(out).to eq("The Gemfile's dependencies are satisfied")
|
13
|
-
end
|
14
|
-
|
15
|
-
it "works with the --gemfile flag when not in the directory" do
|
16
|
-
install_gemfile <<-G
|
17
|
-
source "file://#{gem_repo1}"
|
18
|
-
gem "rails"
|
19
|
-
G
|
20
|
-
|
21
|
-
Dir.chdir tmp
|
22
|
-
bundle "check --gemfile bundled_app/Gemfile"
|
23
|
-
expect(out).to eq("The Gemfile's dependencies are satisfied")
|
24
|
-
end
|
25
|
-
|
26
|
-
it "creates a Gemfile.lock by default if one does not exist" do
|
27
|
-
install_gemfile <<-G
|
28
|
-
source "file://#{gem_repo1}"
|
29
|
-
gem "rails"
|
30
|
-
G
|
31
|
-
|
32
|
-
FileUtils.rm("Gemfile.lock")
|
33
|
-
|
34
|
-
bundle "check"
|
35
|
-
|
36
|
-
expect(bundled_app("Gemfile.lock")).to exist
|
37
|
-
end
|
38
|
-
|
39
|
-
it "does not create a Gemfile.lock if --dry-run was passed" do
|
40
|
-
install_gemfile <<-G
|
41
|
-
source "file://#{gem_repo1}"
|
42
|
-
gem "rails"
|
43
|
-
G
|
44
|
-
|
45
|
-
FileUtils.rm("Gemfile.lock")
|
46
|
-
|
47
|
-
bundle "check --dry-run"
|
48
|
-
|
49
|
-
expect(bundled_app("Gemfile.lock")).not_to exist
|
50
|
-
end
|
51
|
-
|
52
|
-
it "prints a generic error if the missing gems are unresolvable" do
|
53
|
-
system_gems ["rails-2.3.2"]
|
54
|
-
|
55
|
-
gemfile <<-G
|
56
|
-
source "file://#{gem_repo1}"
|
57
|
-
gem "rails"
|
58
|
-
G
|
59
|
-
|
60
|
-
bundle :check
|
61
|
-
expect(out).to include("Bundler can't satisfy your Gemfile's dependencies.")
|
62
|
-
end
|
63
|
-
|
64
|
-
it "prints a generic error if a Gemfile.lock does not exist and a toplevel dependency does not exist" do
|
65
|
-
gemfile <<-G
|
66
|
-
source "file://#{gem_repo1}"
|
67
|
-
gem "rails"
|
68
|
-
G
|
69
|
-
|
70
|
-
bundle :check, :exitstatus => true
|
71
|
-
expect(@exitstatus).to be > 0
|
72
|
-
expect(out).to include("Bundler can't satisfy your Gemfile's dependencies.")
|
73
|
-
end
|
74
|
-
|
75
|
-
it "prints a generic message if you changed your lockfile" do
|
76
|
-
install_gemfile <<-G
|
77
|
-
source "file://#{gem_repo1}"
|
78
|
-
gem 'rails'
|
79
|
-
G
|
80
|
-
install_gemfile <<-G
|
81
|
-
source "file://#{gem_repo1}"
|
82
|
-
gem 'rails_fail'
|
83
|
-
G
|
84
|
-
|
85
|
-
gemfile <<-G
|
86
|
-
source "file://#{gem_repo1}"
|
87
|
-
gem "rails"
|
88
|
-
gem "rails_fail"
|
89
|
-
G
|
90
|
-
|
91
|
-
bundle :check
|
92
|
-
expect(out).to include("Bundler can't satisfy your Gemfile's dependencies.")
|
93
|
-
end
|
94
|
-
|
95
|
-
it "remembers --without option from install" do
|
96
|
-
gemfile <<-G
|
97
|
-
source "file://#{gem_repo1}"
|
98
|
-
group :foo do
|
99
|
-
gem "rack"
|
100
|
-
end
|
101
|
-
G
|
102
|
-
|
103
|
-
bundle "install --without foo"
|
104
|
-
bundle "check", :exitstatus => true
|
105
|
-
expect(@exitstatus).to eq(0)
|
106
|
-
expect(out).to include("The Gemfile's dependencies are satisfied")
|
107
|
-
end
|
108
|
-
|
109
|
-
it "ensures that gems are actually installed and not just cached" do
|
110
|
-
gemfile <<-G
|
111
|
-
source "file://#{gem_repo1}"
|
112
|
-
gem "rack", :group => :foo
|
113
|
-
G
|
114
|
-
|
115
|
-
bundle "install --without foo"
|
116
|
-
|
117
|
-
gemfile <<-G
|
118
|
-
source "file://#{gem_repo1}"
|
119
|
-
gem "rack"
|
120
|
-
G
|
121
|
-
|
122
|
-
bundle "check", :exitstatus => true
|
123
|
-
expect(out).to include("* rack (1.0.0)")
|
124
|
-
expect(@exitstatus).to eq(1)
|
125
|
-
end
|
126
|
-
|
127
|
-
it "ignores missing gems restricted to other platforms" do
|
128
|
-
system_gems "rack-1.0.0"
|
129
|
-
|
130
|
-
gemfile <<-G
|
131
|
-
source "file://#{gem_repo1}"
|
132
|
-
gem "rack"
|
133
|
-
platforms :#{not_local_tag} do
|
134
|
-
gem "activesupport"
|
135
|
-
end
|
136
|
-
G
|
137
|
-
|
138
|
-
lockfile <<-G
|
139
|
-
GEM
|
140
|
-
remote: file:#{gem_repo1}/
|
141
|
-
specs:
|
142
|
-
activesupport (2.3.5)
|
143
|
-
rack (1.0.0)
|
144
|
-
|
145
|
-
PLATFORMS
|
146
|
-
#{local}
|
147
|
-
#{not_local}
|
148
|
-
|
149
|
-
DEPENDENCIES
|
150
|
-
rack
|
151
|
-
activesupport
|
152
|
-
G
|
153
|
-
|
154
|
-
bundle :check
|
155
|
-
expect(out).to eq("The Gemfile's dependencies are satisfied")
|
156
|
-
end
|
157
|
-
|
158
|
-
it "works with env conditionals" do
|
159
|
-
system_gems "rack-1.0.0"
|
160
|
-
|
161
|
-
gemfile <<-G
|
162
|
-
source "file://#{gem_repo1}"
|
163
|
-
gem "rack"
|
164
|
-
env :NOT_GOING_TO_BE_SET do
|
165
|
-
gem "activesupport"
|
166
|
-
end
|
167
|
-
G
|
168
|
-
|
169
|
-
lockfile <<-G
|
170
|
-
GEM
|
171
|
-
remote: file:#{gem_repo1}/
|
172
|
-
specs:
|
173
|
-
activesupport (2.3.5)
|
174
|
-
rack (1.0.0)
|
175
|
-
|
176
|
-
PLATFORMS
|
177
|
-
#{local}
|
178
|
-
#{not_local}
|
179
|
-
|
180
|
-
DEPENDENCIES
|
181
|
-
rack
|
182
|
-
activesupport
|
183
|
-
G
|
184
|
-
|
185
|
-
bundle :check
|
186
|
-
expect(out).to eq("The Gemfile's dependencies are satisfied")
|
187
|
-
end
|
188
|
-
|
189
|
-
it "outputs an error when the default Gemfile is not found" do
|
190
|
-
bundle :check, :exitstatus => true
|
191
|
-
expect(@exitstatus).to eq(10)
|
192
|
-
expect(out).to include("Could not locate Gemfile")
|
193
|
-
end
|
194
|
-
|
195
|
-
it "does not output fatal error message" do
|
196
|
-
bundle :check, :exitstatus => true
|
197
|
-
expect(@exitstatus).to eq(10)
|
198
|
-
expect(out).not_to include("Unfortunately, a fatal error has occurred. ")
|
199
|
-
end
|
200
|
-
|
201
|
-
it "should not crash when called multiple times on a new machine" do
|
202
|
-
gemfile <<-G
|
203
|
-
gem 'rails', '3.0.0.beta3'
|
204
|
-
gem 'paperclip', :git => 'git://github.com/thoughtbot/paperclip.git'
|
205
|
-
G
|
206
|
-
|
207
|
-
simulate_new_machine
|
208
|
-
bundle "check"
|
209
|
-
last_out = out
|
210
|
-
3.times do |i|
|
211
|
-
bundle :check
|
212
|
-
expect(out).to eq(last_out)
|
213
|
-
expect(err).to be_empty
|
214
|
-
end
|
215
|
-
end
|
216
|
-
|
217
|
-
it "fails when there's no lock file and frozen is set" do
|
218
|
-
gemfile <<-G
|
219
|
-
source "file://#{gem_repo1}"
|
220
|
-
gem "foo"
|
221
|
-
G
|
222
|
-
|
223
|
-
bundle "install"
|
224
|
-
bundle "install --deployment"
|
225
|
-
FileUtils.rm(bundled_app("Gemfile.lock"))
|
226
|
-
|
227
|
-
bundle :check, :exitstatus => true
|
228
|
-
expect(exitstatus).not_to eq(0)
|
229
|
-
end
|
230
|
-
|
231
|
-
context "--path" do
|
232
|
-
before do
|
233
|
-
gemfile <<-G
|
234
|
-
source "file://#{gem_repo1}"
|
235
|
-
gem "rails"
|
236
|
-
G
|
237
|
-
bundle "install --path vendor/bundle"
|
238
|
-
|
239
|
-
FileUtils.rm_rf(bundled_app(".bundle"))
|
240
|
-
end
|
241
|
-
|
242
|
-
it "returns success" do
|
243
|
-
bundle "check --path vendor/bundle", :exitstatus => true
|
244
|
-
expect(@exitstatus).to eq(0)
|
245
|
-
expect(out).to eq("The Gemfile's dependencies are satisfied")
|
246
|
-
end
|
247
|
-
|
248
|
-
it "should write to .bundle/config" do
|
249
|
-
bundle "check --path vendor/bundle", :exitstatus => true
|
250
|
-
bundle "check", :exitstatus => true
|
251
|
-
expect(@exitstatus).to eq(0)
|
252
|
-
end
|
253
|
-
end
|
254
|
-
|
255
|
-
describe "when locked" do
|
256
|
-
before :each do
|
257
|
-
system_gems "rack-1.0.0"
|
258
|
-
install_gemfile <<-G
|
259
|
-
source "file://#{gem_repo1}"
|
260
|
-
gem "rack", "1.0"
|
261
|
-
G
|
262
|
-
end
|
263
|
-
|
264
|
-
it "returns success when the Gemfile is satisfied" do
|
265
|
-
bundle :install
|
266
|
-
bundle :check, :exitstatus => true
|
267
|
-
expect(@exitstatus).to eq(0)
|
268
|
-
expect(out).to eq("The Gemfile's dependencies are satisfied")
|
269
|
-
end
|
270
|
-
|
271
|
-
it "shows what is missing with the current Gemfile if it is not satisfied" do
|
272
|
-
simulate_new_machine
|
273
|
-
bundle :check
|
274
|
-
expect(out).to match(/The following gems are missing/)
|
275
|
-
expect(out).to include("* rack (1.0")
|
276
|
-
end
|
277
|
-
end
|
278
|
-
end
|