bundler 2.1.4 → 2.3.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2164 -1430
- data/README.md +7 -9
- data/bundler.gemspec +5 -6
- data/exe/bundle +10 -8
- data/exe/bundler +1 -1
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +3 -11
- data/lib/bundler/cli/add.rb +1 -1
- data/lib/bundler/cli/binstubs.rb +6 -2
- data/lib/bundler/cli/cache.rb +3 -8
- data/lib/bundler/cli/check.rb +4 -2
- data/lib/bundler/cli/clean.rb +1 -1
- data/lib/bundler/cli/common.rb +30 -3
- data/lib/bundler/cli/config.rb +10 -1
- data/lib/bundler/cli/console.rb +1 -1
- data/lib/bundler/cli/doctor.rb +25 -6
- data/lib/bundler/cli/exec.rb +5 -10
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +219 -28
- data/lib/bundler/cli/info.rb +38 -6
- data/lib/bundler/cli/init.rb +3 -3
- data/lib/bundler/cli/inject.rb +1 -1
- data/lib/bundler/cli/install.rb +20 -52
- data/lib/bundler/cli/issue.rb +5 -4
- data/lib/bundler/cli/list.rb +19 -11
- data/lib/bundler/cli/lock.rb +5 -1
- data/lib/bundler/cli/open.rb +1 -2
- data/lib/bundler/cli/outdated.rb +95 -75
- data/lib/bundler/cli/platform.rb +1 -1
- data/lib/bundler/cli/plugin.rb +10 -0
- data/lib/bundler/cli/pristine.rb +5 -0
- data/lib/bundler/cli/remove.rb +1 -2
- data/lib/bundler/cli/show.rb +2 -2
- data/lib/bundler/cli/update.rb +20 -9
- data/lib/bundler/cli.rb +101 -81
- data/lib/bundler/compact_index_client/cache.rb +6 -23
- data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/lib/bundler/compact_index_client/updater.rb +13 -22
- data/lib/bundler/compact_index_client.rb +3 -9
- data/lib/bundler/current_ruby.rb +6 -4
- data/lib/bundler/definition.rb +201 -385
- data/lib/bundler/dep_proxy.rb +16 -9
- data/lib/bundler/dependency.rb +23 -14
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +71 -74
- data/lib/bundler/endpoint_specification.rb +22 -12
- data/lib/bundler/env.rb +2 -2
- data/lib/bundler/environment_preserver.rb +29 -2
- data/lib/bundler/errors.rb +20 -3
- data/lib/bundler/feature_flag.rb +0 -8
- data/lib/bundler/fetcher/base.rb +1 -1
- data/lib/bundler/fetcher/compact_index.rb +11 -16
- data/lib/bundler/fetcher/downloader.rb +10 -7
- data/lib/bundler/fetcher/index.rb +2 -30
- data/lib/bundler/fetcher.rb +18 -23
- data/lib/bundler/friendly_errors.rb +25 -43
- data/lib/bundler/gem_helper.rb +53 -31
- data/lib/bundler/gem_helpers.rb +36 -25
- data/lib/bundler/gem_version_promoter.rb +4 -4
- data/lib/bundler/graph.rb +1 -1
- data/lib/bundler/index.rb +9 -9
- data/lib/bundler/injector.rb +33 -6
- data/lib/bundler/inline.rb +3 -2
- data/lib/bundler/installer/gem_installer.rb +7 -25
- data/lib/bundler/installer/parallel_installer.rb +46 -25
- data/lib/bundler/installer/standalone.rb +30 -10
- data/lib/bundler/installer.rb +36 -59
- data/lib/bundler/lazy_specification.rb +62 -26
- data/lib/bundler/lockfile_generator.rb +2 -2
- data/lib/bundler/lockfile_parser.rb +17 -46
- data/lib/bundler/man/.document +1 -0
- data/{man → lib/bundler/man}/bundle-add.1 +10 -2
- data/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +7 -1
- data/{man → lib/bundler/man}/bundle-binstubs.1 +5 -3
- data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +2 -4
- data/{man → lib/bundler/man}/bundle-cache.1 +1 -1
- data/{man → lib/bundler/man}/bundle-check.1 +1 -1
- data/{man → lib/bundler/man}/bundle-clean.1 +1 -1
- data/{man → lib/bundler/man}/bundle-config.1 +44 -45
- data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +59 -60
- data/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
- data/{man → lib/bundler/man}/bundle-exec.1 +1 -1
- data/{man → lib/bundler/man}/bundle-gem.1 +38 -3
- data/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +46 -7
- data/{man → lib/bundler/man}/bundle-info.1 +1 -1
- data/{man → lib/bundler/man}/bundle-init.1 +1 -1
- data/{man → lib/bundler/man}/bundle-inject.1 +1 -1
- data/{man → lib/bundler/man}/bundle-install.1 +31 -4
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +27 -5
- data/{man → lib/bundler/man}/bundle-list.1 +7 -7
- data/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +6 -6
- data/{man → lib/bundler/man}/bundle-lock.1 +1 -1
- data/{man → lib/bundler/man}/bundle-open.1 +1 -1
- data/{man → lib/bundler/man}/bundle-outdated.1 +3 -10
- data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +1 -10
- data/{man → lib/bundler/man}/bundle-platform.1 +1 -1
- data/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
- data/{man → lib/bundler/man}/bundle-remove.1 +1 -1
- data/{man → lib/bundler/man}/bundle-show.1 +1 -1
- data/{man → lib/bundler/man}/bundle-update.1 +5 -5
- data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +5 -4
- data/{man → lib/bundler/man}/bundle-viz.1 +1 -1
- data/{man → lib/bundler/man}/bundle.1 +1 -1
- data/{man → lib/bundler/man}/gemfile.5 +31 -5
- data/{man → lib/bundler/man}/gemfile.5.ronn +13 -5
- data/lib/bundler/mirror.rb +2 -2
- data/lib/bundler/plugin/api/source.rb +23 -7
- data/lib/bundler/plugin/dsl.rb +1 -1
- data/lib/bundler/plugin/index.rb +13 -1
- data/lib/bundler/plugin/installer/rubygems.rb +1 -1
- data/lib/bundler/plugin/installer.rb +11 -11
- data/lib/bundler/plugin/source_list.rb +5 -1
- data/lib/bundler/plugin.rb +56 -11
- data/lib/bundler/process_lock.rb +1 -1
- data/lib/bundler/remote_specification.rb +12 -2
- data/lib/bundler/resolver/spec_group.rb +58 -55
- data/lib/bundler/resolver.rb +176 -177
- data/lib/bundler/retry.rb +2 -2
- data/lib/bundler/ruby_version.rb +2 -15
- data/lib/bundler/rubygems_ext.rb +137 -28
- data/lib/bundler/rubygems_gem_installer.rb +69 -8
- data/lib/bundler/rubygems_integration.rb +69 -133
- data/lib/bundler/runtime.rb +22 -25
- data/lib/bundler/self_manager.rb +168 -0
- data/lib/bundler/settings.rb +144 -65
- data/lib/bundler/setup.rb +2 -2
- data/lib/bundler/shared_helpers.rb +12 -27
- data/lib/bundler/similarity_detector.rb +1 -1
- data/lib/bundler/source/git/git_proxy.rb +88 -84
- data/lib/bundler/source/git.rb +43 -23
- data/lib/bundler/source/metadata.rb +3 -7
- data/lib/bundler/source/path/installer.rb +10 -10
- data/lib/bundler/source/path.rb +10 -4
- data/lib/bundler/source/rubygems/remote.rb +1 -1
- data/lib/bundler/source/rubygems.rb +126 -116
- data/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/lib/bundler/source.rb +22 -1
- data/lib/bundler/source_list.rb +101 -63
- data/lib/bundler/source_map.rb +71 -0
- data/lib/bundler/spec_set.rb +26 -41
- data/lib/bundler/stub_specification.rb +25 -7
- data/lib/bundler/templates/Executable +2 -4
- data/lib/bundler/templates/Executable.bundler +8 -8
- data/lib/bundler/templates/Executable.standalone +2 -4
- data/lib/bundler/templates/Gemfile +0 -2
- data/lib/bundler/templates/gems.rb +0 -3
- data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +57 -47
- data/lib/bundler/templates/newgem/Gemfile.tt +12 -1
- data/lib/bundler/templates/newgem/README.md.tt +9 -14
- data/lib/bundler/templates/newgem/Rakefile.tt +32 -5
- data/lib/bundler/templates/newgem/bin/console.tt +1 -0
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +27 -0
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +4 -2
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +27 -17
- data/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
- data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -0
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -1
- data/lib/bundler/templates/newgem/standard.yml.tt +3 -0
- data/lib/bundler/templates/newgem/test/{test_helper.rb.tt → minitest/test_helper.rb.tt} +2 -0
- data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/test_newgem.rb.tt} +3 -1
- data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- data/lib/bundler/ui/shell.rb +6 -6
- data/lib/bundler/uri_credentials_filter.rb +3 -1
- data/lib/bundler/vendor/.document +1 -0
- data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +19 -21
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +57 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +39 -74
- data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/lib/bundler/vendor/molinillo/LICENSE +9 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +11 -5
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +37 -5
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +34 -28
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +12 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +49 -47
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -1
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +82 -189
- data/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +9 -7
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +1 -2
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +7 -3
- data/lib/bundler/vendor/thor/lib/thor/base.rb +9 -0
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +6 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +10 -5
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +5 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +28 -9
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +27 -6
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +5 -1
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +5 -13
- data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
- data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/lib/bundler/vendor/tsort/lib/tsort.rb +452 -0
- data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +17 -80
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +5 -6
- data/lib/bundler/vendor/uri/lib/uri/http.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/https.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +1 -14
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +1 -12
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/ws.rb +84 -0
- data/lib/bundler/vendor/uri/lib/uri/wss.rb +22 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +0 -1
- data/lib/bundler/vendored_persistent.rb +0 -7
- data/lib/bundler/vendored_tmpdir.rb +4 -0
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/worker.rb +20 -5
- data/lib/bundler/yaml_serializer.rb +1 -1
- data/lib/bundler.rb +64 -43
- metadata +94 -91
- data/lib/bundler/gemdeps.rb +0 -29
- data/lib/bundler/psyched_yaml.rb +0 -37
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
- data/man/bundle-add.1.txt +0 -58
- data/man/bundle-binstubs.1.txt +0 -48
- data/man/bundle-cache.1.txt +0 -78
- data/man/bundle-check.1.txt +0 -33
- data/man/bundle-clean.1.txt +0 -26
- data/man/bundle-config.1.txt +0 -528
- data/man/bundle-doctor.1.txt +0 -44
- data/man/bundle-exec.1.txt +0 -178
- data/man/bundle-gem.1.txt +0 -91
- data/man/bundle-info.1.txt +0 -21
- data/man/bundle-init.1.txt +0 -34
- data/man/bundle-inject.1.txt +0 -32
- data/man/bundle-install.1.txt +0 -401
- data/man/bundle-list.1.txt +0 -43
- data/man/bundle-lock.1.txt +0 -93
- data/man/bundle-open.1.txt +0 -29
- data/man/bundle-outdated.1.txt +0 -131
- data/man/bundle-platform.1.txt +0 -57
- data/man/bundle-pristine.1.txt +0 -44
- data/man/bundle-remove.1.txt +0 -34
- data/man/bundle-show.1.txt +0 -27
- data/man/bundle-update.1.txt +0 -390
- data/man/bundle-viz.1.txt +0 -39
- data/man/bundle.1.txt +0 -116
- data/man/gemfile.5.txt +0 -649
- /data/{man/bundle-cache.ronn → lib/bundler/man/bundle-cache.1.ronn} +0 -0
- /data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
- /data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +0 -0
- /data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
- /data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +0 -0
- /data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
- /data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +0 -0
- /data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +0 -0
- /data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
- /data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
- /data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +0 -0
- /data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
- /data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
- /data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
- /data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +0 -0
- /data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +0 -0
- /data/{man → lib/bundler/man}/index.txt +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "GEMFILE" "5" "
|
4
|
+
.TH "GEMFILE" "5" "March 2022" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
|
@@ -150,7 +150,7 @@ gem "RedCloth", ">= 4\.1\.0", "< 4\.2\.0"
|
|
150
150
|
.IP "" 0
|
151
151
|
.
|
152
152
|
.SS "REQUIRE AS"
|
153
|
-
Each \fIgem\fR \fBMAY\fR specify files that should be used when autorequiring via \fBBundler\.require\fR\. You may pass an array with multiple files or \fBtrue\fR if file you want \fBrequired\fR has same name as \fIgem\fR or \fBfalse\fR to prevent any file from being autorequired\.
|
153
|
+
Each \fIgem\fR \fBMAY\fR specify files that should be used when autorequiring via \fBBundler\.require\fR\. You may pass an array with multiple files or \fBtrue\fR if the file you want \fBrequired\fR has the same name as \fIgem\fR or \fBfalse\fR to prevent any file from being autorequired\.
|
154
154
|
.
|
155
155
|
.IP "" 4
|
156
156
|
.
|
@@ -227,8 +227,8 @@ To specify multiple groups to ignore, specify a list of groups separated by spac
|
|
227
227
|
.
|
228
228
|
.nf
|
229
229
|
|
230
|
-
bundle config set without test
|
231
|
-
bundle config set without development test
|
230
|
+
bundle config set \-\-local without test
|
231
|
+
bundle config set \-\-local without development test
|
232
232
|
.
|
233
233
|
.fi
|
234
234
|
.
|
@@ -506,8 +506,34 @@ gem "rails", :git => "git://github\.com/rails/rails\.git"
|
|
506
506
|
.P
|
507
507
|
Since the \fBgithub\fR method is a specialization of \fBgit_source\fR, it accepts a \fB:branch\fR named argument\.
|
508
508
|
.
|
509
|
+
.P
|
510
|
+
You can also directly pass a pull request URL:
|
511
|
+
.
|
512
|
+
.IP "" 4
|
513
|
+
.
|
514
|
+
.nf
|
515
|
+
|
516
|
+
gem "rails", :github => "https://github\.com/rails/rails/pull/43753"
|
517
|
+
.
|
518
|
+
.fi
|
519
|
+
.
|
520
|
+
.IP "" 0
|
521
|
+
.
|
522
|
+
.P
|
523
|
+
Which is equivalent to:
|
524
|
+
.
|
525
|
+
.IP "" 4
|
526
|
+
.
|
527
|
+
.nf
|
528
|
+
|
529
|
+
gem "rails", :github => "rails/rails", branch: "refs/pull/43753/head"
|
530
|
+
.
|
531
|
+
.fi
|
532
|
+
.
|
533
|
+
.IP "" 0
|
534
|
+
.
|
509
535
|
.SS "GIST"
|
510
|
-
If the git repository you want to use is hosted as a
|
536
|
+
If the git repository you want to use is hosted as a GitHub Gist and is public, you can use the :gist shorthand to specify the gist identifier (without the trailing "\.git")\.
|
511
537
|
.
|
512
538
|
.IP "" 4
|
513
539
|
.
|
@@ -120,8 +120,8 @@ Each _gem_ `MAY` have one or more version specifiers.
|
|
120
120
|
### REQUIRE AS
|
121
121
|
|
122
122
|
Each _gem_ `MAY` specify files that should be used when autorequiring via
|
123
|
-
`Bundler.require`. You may pass an array with multiple files or `true` if file
|
124
|
-
you want `required` has same name as _gem_ or `false` to
|
123
|
+
`Bundler.require`. You may pass an array with multiple files or `true` if the file
|
124
|
+
you want `required` has the same name as _gem_ or `false` to
|
125
125
|
prevent any file from being autorequired.
|
126
126
|
|
127
127
|
gem "redis", :require => ["redis/connection/hiredis", "redis"]
|
@@ -163,8 +163,8 @@ not install with the `without` configuration.
|
|
163
163
|
|
164
164
|
To specify multiple groups to ignore, specify a list of groups separated by spaces.
|
165
165
|
|
166
|
-
bundle config set without test
|
167
|
-
bundle config set without development test
|
166
|
+
bundle config set --local without test
|
167
|
+
bundle config set --local without development test
|
168
168
|
|
169
169
|
Also, calling `Bundler.setup` with no parameters, or calling `require "bundler/setup"`
|
170
170
|
will setup all groups except for the ones you excluded via `--without` (since they
|
@@ -372,9 +372,17 @@ Are both equivalent to
|
|
372
372
|
|
373
373
|
Since the `github` method is a specialization of `git_source`, it accepts a `:branch` named argument.
|
374
374
|
|
375
|
+
You can also directly pass a pull request URL:
|
376
|
+
|
377
|
+
gem "rails", :github => "https://github.com/rails/rails/pull/43753"
|
378
|
+
|
379
|
+
Which is equivalent to:
|
380
|
+
|
381
|
+
gem "rails", :github => "rails/rails", branch: "refs/pull/43753/head"
|
382
|
+
|
375
383
|
### GIST
|
376
384
|
|
377
|
-
If the git repository you want to use is hosted as a
|
385
|
+
If the git repository you want to use is hosted as a GitHub Gist and is public, you can use
|
378
386
|
the :gist shorthand to specify the gist identifier (without the trailing ".git").
|
379
387
|
|
380
388
|
gem "the_hatch", :gist => "4815162342"
|
data/lib/bundler/mirror.rb
CHANGED
@@ -43,7 +43,7 @@ module Bundler
|
|
43
43
|
config.update_mirror(mirror)
|
44
44
|
end
|
45
45
|
|
46
|
-
|
46
|
+
private
|
47
47
|
|
48
48
|
def fetch_valid_mirror_for(uri)
|
49
49
|
downcased = uri.to_s.downcase
|
@@ -158,7 +158,7 @@ module Bundler
|
|
158
158
|
end
|
159
159
|
end
|
160
160
|
|
161
|
-
|
161
|
+
private
|
162
162
|
|
163
163
|
def wait_for_writtable_socket(socket, address, timeout)
|
164
164
|
if IO.select(nil, [socket], nil, timeout)
|
@@ -140,6 +140,13 @@ module Bundler
|
|
140
140
|
end
|
141
141
|
end
|
142
142
|
|
143
|
+
# Set internal representation to fetch the gems/specs locally.
|
144
|
+
#
|
145
|
+
# When this is called, the source should try to fetch the specs and
|
146
|
+
# install from the local system.
|
147
|
+
def local!
|
148
|
+
end
|
149
|
+
|
143
150
|
# Set internal representation to fetch the gems/specs from remote.
|
144
151
|
#
|
145
152
|
# When this is called, the source should try to fetch the specs and
|
@@ -237,6 +244,20 @@ module Bundler
|
|
237
244
|
specs.unmet_dependency_names
|
238
245
|
end
|
239
246
|
|
247
|
+
# Used by definition.
|
248
|
+
#
|
249
|
+
# Note: Do not override if you don't know what you are doing.
|
250
|
+
def spec_names
|
251
|
+
specs.spec_names
|
252
|
+
end
|
253
|
+
|
254
|
+
# Used by definition.
|
255
|
+
#
|
256
|
+
# Note: Do not override if you don't know what you are doing.
|
257
|
+
def add_dependency_names(names)
|
258
|
+
@dependencies |= Array(names)
|
259
|
+
end
|
260
|
+
|
240
261
|
# Note: Do not override if you don't know what you are doing.
|
241
262
|
def can_lock?(spec)
|
242
263
|
spec.source == self
|
@@ -260,8 +281,9 @@ module Bundler
|
|
260
281
|
end
|
261
282
|
|
262
283
|
def to_s
|
263
|
-
"plugin source for #{
|
284
|
+
"plugin source for #{@type} with uri #{@uri}"
|
264
285
|
end
|
286
|
+
alias_method :identifier, :to_s
|
265
287
|
|
266
288
|
# Note: Do not override if you don't know what you are doing.
|
267
289
|
def include?(other)
|
@@ -286,12 +308,6 @@ module Bundler
|
|
286
308
|
Bundler.root
|
287
309
|
end
|
288
310
|
|
289
|
-
# @private
|
290
|
-
# Returns true
|
291
|
-
def bundler_plugin_api_source?
|
292
|
-
true
|
293
|
-
end
|
294
|
-
|
295
311
|
# @private
|
296
312
|
# This API on source might not be stable, and for now we expect plugins
|
297
313
|
# to download all specs in `#specs`, so we implement the method for
|
data/lib/bundler/plugin/dsl.rb
CHANGED
@@ -10,7 +10,7 @@ module Bundler
|
|
10
10
|
# So that we don't have to override all there methods to dummy ones
|
11
11
|
# explicitly.
|
12
12
|
# They will be handled by method_missing
|
13
|
-
[:gemspec, :gem, :
|
13
|
+
[:gemspec, :gem, :install_if, :platforms, :env].each {|m| undef_method m }
|
14
14
|
|
15
15
|
# This lists the plugins that was added automatically and not specified by
|
16
16
|
# the user.
|
data/lib/bundler/plugin/index.rb
CHANGED
@@ -71,6 +71,18 @@ module Bundler
|
|
71
71
|
raise
|
72
72
|
end
|
73
73
|
|
74
|
+
def unregister_plugin(name)
|
75
|
+
@commands.delete_if {|_, v| v == name }
|
76
|
+
@sources.delete_if {|_, v| v == name }
|
77
|
+
@hooks.each do |hook, names|
|
78
|
+
names.delete(name)
|
79
|
+
@hooks.delete(hook) if names.empty?
|
80
|
+
end
|
81
|
+
@plugin_paths.delete(name)
|
82
|
+
@load_paths.delete(name)
|
83
|
+
save_index
|
84
|
+
end
|
85
|
+
|
74
86
|
# Path of default index file
|
75
87
|
def index_file
|
76
88
|
Plugin.root.join("index")
|
@@ -124,7 +136,7 @@ module Bundler
|
|
124
136
|
@hooks[event] || []
|
125
137
|
end
|
126
138
|
|
127
|
-
|
139
|
+
private
|
128
140
|
|
129
141
|
# Reads the index file from the directory and initializes the instance
|
130
142
|
# variables.
|
@@ -16,15 +16,13 @@ module Bundler
|
|
16
16
|
|
17
17
|
version = options[:version] || [">= 0"]
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
install_rubygems(names, version, sources)
|
27
|
-
end
|
19
|
+
if options[:git]
|
20
|
+
install_git(names, version, options)
|
21
|
+
elsif options[:local_git]
|
22
|
+
install_local_git(names, version, options)
|
23
|
+
else
|
24
|
+
sources = options[:source] || Gem.sources
|
25
|
+
install_rubygems(names, version, sources)
|
28
26
|
end
|
29
27
|
end
|
30
28
|
|
@@ -41,7 +39,7 @@ module Bundler
|
|
41
39
|
install_from_specs specs
|
42
40
|
end
|
43
41
|
|
44
|
-
|
42
|
+
private
|
45
43
|
|
46
44
|
def check_sources_consistency!(options)
|
47
45
|
if options.key?(:git) && options.key?(:local_git)
|
@@ -79,10 +77,12 @@ module Bundler
|
|
79
77
|
source_list = SourceList.new
|
80
78
|
|
81
79
|
source_list.add_git_source(git_source_options) if git_source_options
|
82
|
-
source_list.
|
80
|
+
Array(rubygems_source).each {|remote| source_list.add_global_rubygems_remote(remote) } if rubygems_source
|
83
81
|
|
84
82
|
deps = names.map {|name| Dependency.new name, version }
|
85
83
|
|
84
|
+
Bundler.configure_gem_home_and_path(Plugin.root)
|
85
|
+
|
86
86
|
definition = Definition.new(nil, deps, source_list, true)
|
87
87
|
install_definition(definition)
|
88
88
|
end
|
@@ -17,7 +17,11 @@ module Bundler
|
|
17
17
|
path_sources + git_sources + rubygems_sources + [metadata_source]
|
18
18
|
end
|
19
19
|
|
20
|
-
|
20
|
+
def default_source
|
21
|
+
git_sources.first || global_rubygems_source
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
21
25
|
|
22
26
|
def rubygems_aggregate_class
|
23
27
|
Plugin::Installer::Rubygems
|
data/lib/bundler/plugin.rb
CHANGED
@@ -13,10 +13,11 @@ module Bundler
|
|
13
13
|
class MalformattedPlugin < PluginError; end
|
14
14
|
class UndefinedCommandError < PluginError; end
|
15
15
|
class UnknownSourceError < PluginError; end
|
16
|
+
class PluginInstallError < PluginError; end
|
16
17
|
|
17
18
|
PLUGIN_FILE_NAME = "plugins.rb".freeze
|
18
19
|
|
19
|
-
|
20
|
+
module_function
|
20
21
|
|
21
22
|
def reset!
|
22
23
|
instance_variables.each {|i| remove_instance_variable(i) }
|
@@ -38,13 +39,37 @@ module Bundler
|
|
38
39
|
specs = Installer.new.install(names, options)
|
39
40
|
|
40
41
|
save_plugins names, specs
|
41
|
-
rescue PluginError
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
rescue PluginError
|
43
|
+
specs_to_delete = specs.select {|k, _v| names.include?(k) && !index.commands.values.include?(k) }
|
44
|
+
specs_to_delete.each_value {|spec| Bundler.rm_rf(spec.full_gem_path) }
|
45
|
+
|
46
|
+
raise
|
47
|
+
end
|
48
|
+
|
49
|
+
# Uninstalls plugins by the given names
|
50
|
+
#
|
51
|
+
# @param [Array<String>] names the names of plugins to be uninstalled
|
52
|
+
def uninstall(names, options)
|
53
|
+
if names.empty? && !options[:all]
|
54
|
+
Bundler.ui.error "No plugins to uninstall. Specify at least 1 plugin to uninstall.\n"\
|
55
|
+
"Use --all option to uninstall all the installed plugins."
|
56
|
+
return
|
45
57
|
end
|
46
58
|
|
47
|
-
|
59
|
+
names = index.installed_plugins if options[:all]
|
60
|
+
if names.any?
|
61
|
+
names.each do |name|
|
62
|
+
if index.installed?(name)
|
63
|
+
Bundler.rm_rf(index.plugin_path(name))
|
64
|
+
index.unregister_plugin(name)
|
65
|
+
Bundler.ui.info "Uninstalled plugin #{name}"
|
66
|
+
else
|
67
|
+
Bundler.ui.error "Plugin #{name} is not installed \n"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
else
|
71
|
+
Bundler.ui.info "No plugins installed"
|
72
|
+
end
|
48
73
|
end
|
49
74
|
|
50
75
|
# List installed plugins and commands
|
@@ -80,6 +105,7 @@ module Bundler
|
|
80
105
|
else
|
81
106
|
builder.eval_gemfile(gemfile)
|
82
107
|
end
|
108
|
+
builder.check_primary_source_safety
|
83
109
|
definition = builder.to_definition(nil, true)
|
84
110
|
|
85
111
|
return if definition.dependencies.empty?
|
@@ -138,7 +164,7 @@ module Bundler
|
|
138
164
|
end
|
139
165
|
|
140
166
|
# To be called from Cli class to pass the command and argument to
|
141
|
-
#
|
167
|
+
# appropriate plugin class
|
142
168
|
def exec_command(command, args)
|
143
169
|
raise UndefinedCommandError, "Command `#{command}` not found" unless command? command
|
144
170
|
|
@@ -157,7 +183,7 @@ module Bundler
|
|
157
183
|
!index.source_plugin(name.to_s).nil?
|
158
184
|
end
|
159
185
|
|
160
|
-
# @return [Class] that handles the source. The
|
186
|
+
# @return [Class] that handles the source. The class includes API::Source
|
161
187
|
def source(name)
|
162
188
|
raise UnknownSourceError, "Source #{name} not found" unless source? name
|
163
189
|
|
@@ -219,10 +245,11 @@ module Bundler
|
|
219
245
|
# @param [Array<String>] names of inferred source plugins that can be ignored
|
220
246
|
def save_plugins(plugins, specs, optional_plugins = [])
|
221
247
|
plugins.each do |name|
|
248
|
+
next if index.installed?(name)
|
249
|
+
|
222
250
|
spec = specs[name]
|
223
|
-
|
224
|
-
|
225
|
-
Bundler.ui.info "Installed plugin #{name}" if installed
|
251
|
+
|
252
|
+
save_plugin(name, spec, optional_plugins.include?(name))
|
226
253
|
end
|
227
254
|
end
|
228
255
|
|
@@ -237,6 +264,22 @@ module Bundler
|
|
237
264
|
raise MalformattedPlugin, "#{PLUGIN_FILE_NAME} was not found in the plugin." unless plugin_file.file?
|
238
265
|
end
|
239
266
|
|
267
|
+
# Validates and registers a plugin.
|
268
|
+
#
|
269
|
+
# @param [String] name the name of the plugin
|
270
|
+
# @param [Specification] spec of installed plugin
|
271
|
+
# @param [Boolean] optional_plugin, removed if there is conflict with any
|
272
|
+
# other plugin (used for default source plugins)
|
273
|
+
#
|
274
|
+
# @raise [PluginInstallError] if validation or registration raises any error
|
275
|
+
def save_plugin(name, spec, optional_plugin = false)
|
276
|
+
validate_plugin! Pathname.new(spec.full_gem_path)
|
277
|
+
installed = register_plugin(name, spec, optional_plugin)
|
278
|
+
Bundler.ui.info "Installed plugin #{name}" if installed
|
279
|
+
rescue PluginError => e
|
280
|
+
raise PluginInstallError, "Failed to install plugin `#{spec.name}`, due to #{e.class} (#{e.message})"
|
281
|
+
end
|
282
|
+
|
240
283
|
# Runs the plugins.rb file in an isolated namespace, records the plugin
|
241
284
|
# actions it registers for and then passes the data to index to be stored.
|
242
285
|
#
|
@@ -283,6 +326,8 @@ module Bundler
|
|
283
326
|
#
|
284
327
|
# @param [String] name of the plugin
|
285
328
|
def load_plugin(name)
|
329
|
+
return unless name && !name.empty?
|
330
|
+
|
286
331
|
# Need to ensure before this that plugin root where the rest of gems
|
287
332
|
# are installed to be on load path to support plugin deps. Currently not
|
288
333
|
# done to avoid conflicts
|
data/lib/bundler/process_lock.rb
CHANGED
@@ -12,7 +12,7 @@ module Bundler
|
|
12
12
|
yield
|
13
13
|
f.flock(File::LOCK_UN)
|
14
14
|
end
|
15
|
-
rescue Errno::EACCES, Errno::ENOLCK,
|
15
|
+
rescue Errno::EACCES, Errno::ENOLCK, Errno::ENOTSUP
|
16
16
|
# In the case the user does not have access to
|
17
17
|
# create the lock file or is using NFS where
|
18
18
|
# locks are not available we skip locking.
|
@@ -27,6 +27,13 @@ module Bundler
|
|
27
27
|
@platform = _remote_specification.platform
|
28
28
|
end
|
29
29
|
|
30
|
+
# A fallback is included because the original version of the specification
|
31
|
+
# API didn't include that field, so some marshalled specs in the index have it
|
32
|
+
# set to +nil+.
|
33
|
+
def required_rubygems_version
|
34
|
+
@required_rubygems_version ||= _remote_specification.required_rubygems_version || Gem::Requirement.default
|
35
|
+
end
|
36
|
+
|
30
37
|
def full_name
|
31
38
|
if platform == Gem::Platform::RUBY || platform.nil?
|
32
39
|
"#{@name}-#{@version}"
|
@@ -50,6 +57,8 @@ module Bundler
|
|
50
57
|
# once the remote gem is downloaded, the backend specification will
|
51
58
|
# be swapped out.
|
52
59
|
def __swap__(spec)
|
60
|
+
raise APIResponseInvalidDependenciesError unless spec.dependencies.all? {|d| d.is_a?(Gem::Dependency) }
|
61
|
+
|
53
62
|
SharedHelpers.ensure_same_dependencies(self, dependencies, spec.dependencies)
|
54
63
|
@_remote_specification = spec
|
55
64
|
end
|
@@ -76,7 +85,8 @@ module Bundler
|
|
76
85
|
deps = method_missing(:dependencies)
|
77
86
|
|
78
87
|
# allow us to handle when the specs dependencies are an array of array of string
|
79
|
-
#
|
88
|
+
# in order to delay the crash to `#__swap__` where it results in a friendlier error
|
89
|
+
# see https://github.com/rubygems/bundler/issues/5797
|
80
90
|
deps = deps.map {|d| d.is_a?(Gem::Dependency) ? d : Gem::Dependency.new(*d) }
|
81
91
|
|
82
92
|
deps
|
@@ -88,7 +98,7 @@ module Bundler
|
|
88
98
|
" #{source.revision[0..6]}"
|
89
99
|
end
|
90
100
|
|
91
|
-
|
101
|
+
private
|
92
102
|
|
93
103
|
def to_ary
|
94
104
|
nil
|
@@ -3,61 +3,58 @@
|
|
3
3
|
module Bundler
|
4
4
|
class Resolver
|
5
5
|
class SpecGroup
|
6
|
-
include GemHelpers
|
7
|
-
|
8
6
|
attr_accessor :name, :version, :source
|
9
|
-
attr_accessor :
|
7
|
+
attr_accessor :activated_platforms
|
8
|
+
|
9
|
+
def self.create_for(specs, all_platforms, specific_platform)
|
10
|
+
specific_platform_specs = specs[specific_platform]
|
11
|
+
return unless specific_platform_specs.any?
|
12
|
+
|
13
|
+
platforms = all_platforms.select {|p| specs[p].any? }
|
14
|
+
|
15
|
+
new(specific_platform_specs.first, specs, platforms)
|
16
|
+
end
|
10
17
|
|
11
|
-
def initialize(
|
12
|
-
|
18
|
+
def initialize(exemplary_spec, specs, relevant_platforms)
|
19
|
+
@exemplary_spec = exemplary_spec
|
13
20
|
@name = exemplary_spec.name
|
14
21
|
@version = exemplary_spec.version
|
15
22
|
@source = exemplary_spec.source
|
16
23
|
|
17
|
-
@activated_platforms =
|
18
|
-
@dependencies =
|
19
|
-
|
20
|
-
specs[platform] = select_best_platform_match(all_specs, platform)
|
24
|
+
@activated_platforms = relevant_platforms
|
25
|
+
@dependencies = Hash.new do |dependencies, platforms|
|
26
|
+
dependencies[platforms] = dependencies_for(platforms)
|
21
27
|
end
|
22
|
-
@
|
28
|
+
@specs = specs
|
23
29
|
end
|
24
30
|
|
25
31
|
def to_specs
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
lazy_spec.dependencies.replace s.dependencies
|
30
|
-
lazy_spec
|
31
|
-
end.compact
|
32
|
-
end
|
33
|
-
|
34
|
-
def activate_platform!(platform)
|
35
|
-
return unless for?(platform)
|
36
|
-
return if @activated_platforms.include?(platform)
|
37
|
-
@activated_platforms << platform
|
38
|
-
end
|
32
|
+
activated_platforms.map do |p|
|
33
|
+
specs = @specs[p]
|
34
|
+
next unless specs.any?
|
39
35
|
|
40
|
-
|
41
|
-
|
42
|
-
|
36
|
+
specs.map do |s|
|
37
|
+
lazy_spec = LazySpecification.new(name, version, s.platform, source)
|
38
|
+
lazy_spec.dependencies.replace s.dependencies
|
39
|
+
lazy_spec
|
40
|
+
end
|
41
|
+
end.flatten.compact.uniq
|
43
42
|
end
|
44
43
|
|
45
44
|
def to_s
|
46
|
-
|
45
|
+
activated_platforms_string = sorted_activated_platforms.join(", ")
|
46
|
+
"#{name} (#{version}) (#{activated_platforms_string})"
|
47
47
|
end
|
48
48
|
|
49
49
|
def dependencies_for_activated_platforms
|
50
|
-
dependencies
|
51
|
-
metadata_dependencies = @activated_platforms.map do |platform|
|
52
|
-
metadata_dependencies(@specs[platform], platform)
|
53
|
-
end
|
54
|
-
dependencies.concat(metadata_dependencies).flatten
|
50
|
+
@dependencies[activated_platforms]
|
55
51
|
end
|
56
52
|
|
57
53
|
def ==(other)
|
58
54
|
return unless other.is_a?(SpecGroup)
|
59
55
|
name == other.name &&
|
60
56
|
version == other.version &&
|
57
|
+
sorted_activated_platforms == other.sorted_activated_platforms &&
|
61
58
|
source == other.source
|
62
59
|
end
|
63
60
|
|
@@ -65,40 +62,46 @@ module Bundler
|
|
65
62
|
return unless other.is_a?(SpecGroup)
|
66
63
|
name.eql?(other.name) &&
|
67
64
|
version.eql?(other.version) &&
|
65
|
+
sorted_activated_platforms.eql?(other.sorted_activated_platforms) &&
|
68
66
|
source.eql?(other.source)
|
69
67
|
end
|
70
68
|
|
71
69
|
def hash
|
72
|
-
|
70
|
+
name.hash ^ version.hash ^ sorted_activated_platforms.hash ^ source.hash
|
73
71
|
end
|
74
72
|
|
75
|
-
|
76
|
-
|
77
|
-
def
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
73
|
+
protected
|
74
|
+
|
75
|
+
def sorted_activated_platforms
|
76
|
+
activated_platforms.sort_by(&:to_s)
|
77
|
+
end
|
78
|
+
|
79
|
+
private
|
80
|
+
|
81
|
+
def dependencies_for(platforms)
|
82
|
+
platforms.map do |platform|
|
83
|
+
__dependencies(platform) + metadata_dependencies(platform)
|
84
|
+
end.flatten
|
85
|
+
end
|
86
|
+
|
87
|
+
def __dependencies(platform)
|
88
|
+
dependencies = []
|
89
|
+
@specs[platform].first.dependencies.each do |dep|
|
90
|
+
next if dep.type == :development
|
91
|
+
dependencies << DepProxy.get_proxy(dep, platform)
|
88
92
|
end
|
93
|
+
dependencies
|
89
94
|
end
|
90
95
|
|
91
|
-
def metadata_dependencies(
|
92
|
-
|
93
|
-
|
94
|
-
# fetch the full gemspec when calling required_ruby_version
|
95
|
-
return [] if !spec.is_a?(EndpointSpecification) && !spec.is_a?(Gem::Specification)
|
96
|
+
def metadata_dependencies(platform)
|
97
|
+
spec = @specs[platform].first
|
98
|
+
return [] if spec.is_a?(LazySpecification)
|
96
99
|
dependencies = []
|
97
|
-
|
98
|
-
dependencies << DepProxy.
|
100
|
+
unless spec.required_ruby_version.none?
|
101
|
+
dependencies << DepProxy.get_proxy(Gem::Dependency.new("Ruby\0", spec.required_ruby_version), platform)
|
99
102
|
end
|
100
|
-
|
101
|
-
dependencies << DepProxy.
|
103
|
+
unless spec.required_rubygems_version.none?
|
104
|
+
dependencies << DepProxy.get_proxy(Gem::Dependency.new("RubyGems\0", spec.required_rubygems_version), platform)
|
102
105
|
end
|
103
106
|
dependencies
|
104
107
|
end
|