bundler 1.11.1 → 2.2.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/CHANGELOG.md +2125 -840
- data/LICENSE.md +18 -19
- data/README.md +33 -11
- data/bundler.gemspec +34 -21
- data/exe/bundle +36 -6
- data/exe/bundler +2 -18
- data/lib/bundler.rb +435 -160
- data/lib/bundler/build_metadata.rb +45 -0
- data/lib/bundler/capistrano.rb +9 -3
- data/lib/bundler/cli.rb +550 -130
- data/lib/bundler/cli/add.rb +47 -0
- data/lib/bundler/cli/binstubs.rb +26 -10
- data/lib/bundler/cli/cache.rb +25 -17
- data/lib/bundler/cli/check.rb +8 -7
- data/lib/bundler/cli/clean.rb +8 -8
- data/lib/bundler/cli/common.rb +69 -9
- data/lib/bundler/cli/config.rb +170 -76
- data/lib/bundler/cli/console.rb +6 -1
- data/lib/bundler/cli/doctor.rb +140 -0
- data/lib/bundler/cli/exec.rb +63 -21
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +158 -42
- data/lib/bundler/cli/info.rb +73 -0
- data/lib/bundler/cli/init.rb +22 -7
- data/lib/bundler/cli/inject.rb +38 -10
- data/lib/bundler/cli/install.rb +139 -104
- data/lib/bundler/cli/issue.rb +40 -0
- data/lib/bundler/cli/list.rb +60 -0
- data/lib/bundler/cli/lock.rb +27 -5
- data/lib/bundler/cli/open.rb +13 -5
- data/lib/bundler/cli/outdated.rb +251 -46
- data/lib/bundler/cli/platform.rb +6 -2
- data/lib/bundler/cli/plugin.rb +41 -0
- data/lib/bundler/cli/pristine.rb +52 -0
- data/lib/bundler/cli/remove.rb +18 -0
- data/lib/bundler/cli/show.rb +5 -4
- data/lib/bundler/cli/update.rb +67 -26
- data/lib/bundler/cli/viz.rb +11 -6
- data/lib/bundler/compact_index_client.rb +125 -0
- data/lib/bundler/compact_index_client/cache.rb +110 -0
- data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/lib/bundler/compact_index_client/updater.rb +104 -0
- data/lib/bundler/constants.rb +2 -0
- data/lib/bundler/current_ruby.rb +51 -174
- data/lib/bundler/definition.rb +533 -216
- data/lib/bundler/dep_proxy.rb +18 -8
- data/lib/bundler/dependency.rb +39 -12
- data/lib/bundler/deployment.rb +7 -0
- data/lib/bundler/deprecate.rb +31 -2
- data/lib/bundler/dsl.rb +188 -91
- data/lib/bundler/endpoint_specification.rb +51 -10
- data/lib/bundler/env.rb +116 -48
- data/lib/bundler/environment_preserver.rb +82 -0
- data/lib/bundler/errors.rb +108 -31
- data/lib/bundler/feature_flag.rb +60 -0
- data/lib/bundler/fetcher.rb +81 -52
- data/lib/bundler/fetcher/base.rb +15 -3
- data/lib/bundler/fetcher/compact_index.rb +140 -0
- data/lib/bundler/fetcher/dependency.rb +36 -42
- data/lib/bundler/fetcher/downloader.rb +39 -12
- data/lib/bundler/fetcher/index.rb +34 -9
- data/lib/bundler/friendly_errors.rb +132 -88
- data/lib/bundler/gem_helper.rb +92 -50
- data/lib/bundler/gem_helpers.rb +90 -5
- data/lib/bundler/gem_tasks.rb +3 -1
- data/lib/bundler/gem_version_promoter.rb +190 -0
- data/lib/bundler/gemdeps.rb +29 -0
- data/lib/bundler/graph.rb +20 -41
- data/lib/bundler/index.rb +74 -57
- data/lib/bundler/injector.rb +242 -31
- data/lib/bundler/inline.rb +49 -23
- data/lib/bundler/installer.rb +190 -74
- data/lib/bundler/installer/gem_installer.rb +33 -20
- data/lib/bundler/installer/parallel_installer.rb +201 -97
- data/lib/bundler/installer/standalone.rb +10 -6
- data/lib/bundler/lazy_specification.rb +74 -10
- data/lib/bundler/lockfile_generator.rb +95 -0
- data/lib/bundler/lockfile_parser.rb +126 -74
- data/lib/bundler/{ssl_certs → man}/.document +0 -0
- data/lib/bundler/man/bundle-add.1 +66 -0
- data/lib/bundler/man/bundle-add.1.ronn +46 -0
- data/lib/bundler/man/bundle-binstubs.1 +42 -0
- data/lib/bundler/man/bundle-binstubs.1.ronn +41 -0
- data/lib/bundler/man/bundle-cache.1 +55 -0
- data/{man/bundle-package.ronn → lib/bundler/man/bundle-cache.1.ronn} +22 -16
- data/lib/bundler/man/bundle-check.1 +31 -0
- data/lib/bundler/man/bundle-check.1.ronn +26 -0
- data/lib/bundler/man/bundle-clean.1 +24 -0
- data/lib/bundler/man/bundle-clean.1.ronn +18 -0
- data/lib/bundler/man/bundle-config.1 +488 -0
- data/lib/bundler/man/bundle-config.1.ronn +388 -0
- data/lib/bundler/man/bundle-doctor.1 +44 -0
- data/lib/bundler/man/bundle-doctor.1.ronn +33 -0
- data/lib/bundler/man/bundle-exec.1 +165 -0
- data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +20 -4
- data/lib/bundler/man/bundle-gem.1 +102 -0
- data/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +37 -13
- data/lib/bundler/man/bundle-info.1 +20 -0
- data/lib/bundler/man/bundle-info.1.ronn +17 -0
- data/lib/bundler/man/bundle-init.1 +25 -0
- data/lib/bundler/man/bundle-init.1.ronn +29 -0
- data/lib/bundler/man/bundle-inject.1 +33 -0
- data/lib/bundler/man/bundle-inject.1.ronn +22 -0
- data/lib/bundler/man/bundle-install.1 +338 -0
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +82 -76
- data/lib/bundler/man/bundle-list.1 +50 -0
- data/lib/bundler/man/bundle-list.1.ronn +33 -0
- data/lib/bundler/man/bundle-lock.1 +84 -0
- data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +47 -0
- data/lib/bundler/man/bundle-open.1 +32 -0
- data/lib/bundler/man/bundle-open.1.ronn +19 -0
- data/lib/bundler/man/bundle-outdated.1 +155 -0
- data/lib/bundler/man/bundle-outdated.1.ronn +111 -0
- data/lib/bundler/man/bundle-platform.1 +61 -0
- data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +1 -1
- data/lib/bundler/man/bundle-pristine.1 +34 -0
- data/lib/bundler/man/bundle-pristine.1.ronn +34 -0
- data/lib/bundler/man/bundle-remove.1 +31 -0
- data/lib/bundler/man/bundle-remove.1.ronn +23 -0
- data/lib/bundler/man/bundle-show.1 +23 -0
- data/lib/bundler/man/bundle-show.1.ronn +21 -0
- data/lib/bundler/man/bundle-update.1 +394 -0
- data/lib/bundler/man/bundle-update.1.ronn +350 -0
- data/lib/bundler/man/bundle-viz.1 +39 -0
- data/lib/bundler/man/bundle-viz.1.ronn +30 -0
- data/lib/bundler/man/bundle.1 +136 -0
- data/lib/bundler/man/bundle.1.ronn +111 -0
- data/lib/bundler/man/gemfile.5 +686 -0
- data/{man → lib/bundler/man}/gemfile.5.ronn +117 -95
- data/lib/bundler/man/index.txt +25 -0
- data/lib/bundler/match_platform.rb +15 -4
- data/lib/bundler/mirror.rb +223 -0
- data/lib/bundler/plugin.rb +330 -0
- data/lib/bundler/plugin/api.rb +81 -0
- data/lib/bundler/plugin/api/source.rb +304 -0
- data/lib/bundler/plugin/dsl.rb +53 -0
- data/lib/bundler/plugin/events.rb +61 -0
- data/lib/bundler/plugin/index.rb +182 -0
- data/lib/bundler/plugin/installer.rb +109 -0
- data/lib/bundler/plugin/installer/git.rb +38 -0
- data/lib/bundler/plugin/installer/rubygems.rb +27 -0
- data/lib/bundler/plugin/source_list.rb +27 -0
- data/lib/bundler/process_lock.rb +24 -0
- data/lib/bundler/psyched_yaml.rb +2 -6
- data/lib/bundler/remote_specification.rb +42 -9
- data/lib/bundler/resolver.rb +312 -225
- data/lib/bundler/resolver/spec_group.rb +122 -0
- data/lib/bundler/retry.rb +11 -5
- data/lib/bundler/ruby_dsl.rb +9 -2
- data/lib/bundler/ruby_version.rb +84 -61
- data/lib/bundler/rubygems_ext.rb +92 -53
- data/lib/bundler/rubygems_gem_installer.rb +84 -0
- data/lib/bundler/rubygems_integration.rb +320 -395
- data/lib/bundler/runtime.rb +87 -75
- data/lib/bundler/settings.rb +297 -119
- data/lib/bundler/settings/validator.rb +102 -0
- data/lib/bundler/setup.rb +13 -12
- data/lib/bundler/shared_helpers.rb +234 -53
- data/lib/bundler/similarity_detector.rb +5 -3
- data/lib/bundler/source.rb +63 -4
- data/lib/bundler/source/gemspec.rb +18 -0
- data/lib/bundler/source/git.rb +97 -50
- data/lib/bundler/source/git/git_proxy.rb +138 -65
- data/lib/bundler/source/metadata.rb +67 -0
- data/lib/bundler/source/path.rb +83 -47
- data/lib/bundler/source/path/installer.rb +42 -11
- data/lib/bundler/source/rubygems.rb +231 -116
- data/lib/bundler/source/rubygems/remote.rb +30 -1
- data/lib/bundler/source_list.rb +103 -21
- data/lib/bundler/spec_set.rb +96 -51
- data/lib/bundler/stub_specification.rb +87 -4
- data/lib/bundler/templates/.document +1 -0
- data/lib/bundler/templates/Executable +14 -1
- data/lib/bundler/templates/Executable.bundler +114 -0
- data/lib/bundler/templates/Executable.standalone +6 -4
- data/lib/bundler/templates/Gemfile +4 -1
- data/lib/bundler/templates/gems.rb +8 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +79 -44
- data/lib/bundler/templates/newgem/Gemfile.tt +18 -2
- data/lib/bundler/templates/newgem/LICENSE.txt.tt +1 -1
- data/lib/bundler/templates/newgem/README.md.tt +16 -10
- data/lib/bundler/templates/newgem/Rakefile.tt +22 -8
- data/lib/bundler/templates/newgem/bin/console.tt +2 -1
- 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/ext/newgem/newgem.c.tt +4 -4
- data/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +3 -3
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +18 -0
- data/lib/bundler/templates/newgem/gitignore.tt +5 -1
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +9 -6
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +6 -4
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +27 -28
- data/lib/bundler/templates/newgem/rspec.tt +1 -0
- data/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +4 -4
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +15 -2
- data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +3 -1
- data/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
- 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/templates/newgem/{.travis.yml.tt → travis.yml.tt} +2 -0
- data/lib/bundler/ui.rb +5 -3
- data/lib/bundler/ui/rg_proxy.rb +3 -1
- data/lib/bundler/ui/shell.rb +54 -21
- data/lib/bundler/ui/silent.rb +26 -1
- data/lib/bundler/uri_credentials_filter.rb +43 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +161 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +66 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +176 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1764 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +11 -5
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +81 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +113 -134
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +36 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +66 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +62 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +63 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +61 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +126 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +46 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +36 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +158 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +82 -8
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +4 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +2 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +6 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +555 -150
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +6 -3
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +19 -12
- data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent.rb +310 -467
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +40 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +53 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
- data/lib/bundler/vendor/thor/lib/thor.rb +58 -25
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +50 -33
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +3 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +5 -3
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +9 -19
- data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +16 -8
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +79 -22
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +33 -20
- data/lib/bundler/vendor/thor/lib/thor/base.rb +110 -67
- data/lib/bundler/vendor/thor/lib/thor/command.rb +33 -24
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +21 -1
- data/lib/bundler/vendor/thor/lib/thor/error.rb +81 -3
- data/lib/bundler/vendor/thor/lib/thor/group.rb +16 -16
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +2 -0
- data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +4 -7
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +18 -18
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +60 -26
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +31 -13
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +42 -39
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +109 -39
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +7 -3
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/util.rb +26 -9
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
- data/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
- data/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
- data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
- data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/lib/bundler/vendored_fileutils.rb +4 -0
- data/lib/bundler/vendored_molinillo.rb +3 -1
- data/lib/bundler/vendored_persistent.rb +45 -9
- data/lib/bundler/vendored_thor.rb +8 -3
- data/lib/bundler/vendored_tmpdir.rb +4 -0
- data/lib/bundler/vendored_uri.rb +4 -0
- data/lib/bundler/version.rb +7 -4
- data/lib/bundler/version_ranges.rb +122 -0
- data/lib/bundler/vlad.rb +8 -2
- data/lib/bundler/worker.rb +38 -6
- data/lib/bundler/yaml_serializer.rb +89 -0
- metadata +164 -158
- data/.gitignore +0 -16
- data/.rspec +0 -3
- data/.rubocop.yml +0 -105
- data/.rubocop_todo.yml +0 -120
- data/.travis.yml +0 -97
- data/CODE_OF_CONDUCT.md +0 -42
- data/CONTRIBUTING.md +0 -32
- data/DEVELOPMENT.md +0 -118
- data/ISSUES.md +0 -96
- data/Rakefile +0 -309
- data/bin/rake +0 -14
- data/bin/rspec +0 -10
- data/bin/rubocop +0 -11
- data/exe/bundle_ruby +0 -60
- data/lib/bundler/cli/package.rb +0 -45
- data/lib/bundler/environment.rb +0 -41
- data/lib/bundler/gem_path_manipulation.rb +0 -8
- data/lib/bundler/gem_remote_fetcher.rb +0 -41
- data/lib/bundler/ssl_certs/AddTrustExternalCARoot-2048.pem +0 -25
- data/lib/bundler/ssl_certs/AddTrustExternalCARoot.pem +0 -32
- data/lib/bundler/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +0 -14
- data/lib/bundler/ssl_certs/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/bundler/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +0 -28
- data/lib/bundler/ssl_certs/GeoTrustGlobalCA.pem +0 -20
- data/lib/bundler/ssl_certs/certificate_manager.rb +0 -64
- data/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
- data/lib/bundler/vendor/net/http/faster.rb +0 -26
- data/lib/bundler/vendor/net/http/persistent/ssl_reuse.rb +0 -128
- data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -10
- data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -98
- data/man/bundle-config.ronn +0 -187
- data/man/bundle-update.ronn +0 -188
- data/man/bundle.ronn +0 -98
- data/man/index.txt +0 -8
@@ -15,7 +15,7 @@ directory as the `Rakefile`.
|
|
15
15
|
A `Gemfile` is evaluated as Ruby code, in a context which makes available
|
16
16
|
a number of methods used to describe the gem requirements.
|
17
17
|
|
18
|
-
## GLOBAL SOURCES
|
18
|
+
## GLOBAL SOURCES
|
19
19
|
|
20
20
|
At the top of the `Gemfile`, add a line for the `Rubygems` source that contains
|
21
21
|
the gems listed in the `Gemfile`.
|
@@ -30,19 +30,19 @@ Sources are checked for gems following the heuristics described in
|
|
30
30
|
will print a warning after installing the gem indicating which source was used,
|
31
31
|
and listing the other sources where the gem is available. A specific source can
|
32
32
|
be selected for gems that need to use a non-standard repository, suppressing
|
33
|
-
this warning, by using the [`:source` option](#SOURCE
|
33
|
+
this warning, by using the [`:source` option](#SOURCE) or a
|
34
34
|
[`source` block](#BLOCK-FORM-OF-SOURCE-GIT-PATH-GROUP-and-PLATFORMS).
|
35
35
|
|
36
|
-
### CREDENTIALS
|
36
|
+
### CREDENTIALS
|
37
37
|
|
38
|
-
Some gem sources require a username and password. Use
|
39
|
-
the username and password for any sources that need it. The command must
|
40
|
-
once on each computer that will install the Gemfile, but this keeps the
|
38
|
+
Some gem sources require a username and password. Use [bundle config(1)](bundle-config.1.html) to set
|
39
|
+
the username and password for any of the sources that need it. The command must
|
40
|
+
be run once on each computer that will install the Gemfile, but this keeps the
|
41
41
|
credentials from being stored in plain text in version control.
|
42
42
|
|
43
43
|
bundle config gems.example.com user:password
|
44
44
|
|
45
|
-
For some sources, like a company Gemfury account, it may be easier to
|
45
|
+
For some sources, like a company Gemfury account, it may be easier to
|
46
46
|
include the credentials in the Gemfile as part of the source URL.
|
47
47
|
|
48
48
|
source "https://user:password@gems.example.com"
|
@@ -50,7 +50,7 @@ include the credentials in the Gemfile as part of the source URL.
|
|
50
50
|
Credentials in the source URL will take precedence over credentials set using
|
51
51
|
`config`.
|
52
52
|
|
53
|
-
## RUBY
|
53
|
+
## RUBY
|
54
54
|
|
55
55
|
If your application requires a specific Ruby version or engine, specify your
|
56
56
|
requirements using the `ruby` method, with the following arguments.
|
@@ -59,17 +59,33 @@ All parameters are `OPTIONAL` unless otherwise specified.
|
|
59
59
|
### VERSION (required)
|
60
60
|
|
61
61
|
The version of Ruby that your application requires. If your application
|
62
|
-
requires an alternate Ruby engine, such as JRuby or
|
63
|
-
the Ruby version that the engine is compatible with.
|
62
|
+
requires an alternate Ruby engine, such as JRuby, Rubinius or TruffleRuby, this
|
63
|
+
should be the Ruby version that the engine is compatible with.
|
64
64
|
|
65
65
|
ruby "1.9.3"
|
66
66
|
|
67
|
-
### ENGINE
|
67
|
+
### ENGINE
|
68
68
|
|
69
69
|
Each application _may_ specify a Ruby engine. If an engine is specified, an
|
70
70
|
engine version _must_ also be specified.
|
71
71
|
|
72
|
-
|
72
|
+
What exactly is an Engine?
|
73
|
+
- A Ruby engine is an implementation of the Ruby language.
|
74
|
+
|
75
|
+
- For background: the reference or original implementation of the Ruby
|
76
|
+
programming language is called
|
77
|
+
[Matz's Ruby Interpreter](https://en.wikipedia.org/wiki/Ruby_MRI), or MRI
|
78
|
+
for short. This is named after Ruby creator Yukihiro Matsumoto,
|
79
|
+
also known as Matz. MRI is also known as CRuby, because it is written in C.
|
80
|
+
MRI is the most widely used Ruby engine.
|
81
|
+
|
82
|
+
- [Other implementations](https://www.ruby-lang.org/en/about/) of Ruby exist.
|
83
|
+
Some of the more well-known implementations include
|
84
|
+
[Rubinius](https://rubinius.com/), and [JRuby](http://jruby.org/).
|
85
|
+
Rubinius is an alternative implementation of Ruby written in Ruby.
|
86
|
+
JRuby is an implementation of Ruby on the JVM, short for Java Virtual Machine.
|
87
|
+
|
88
|
+
### ENGINE VERSION
|
73
89
|
|
74
90
|
Each application _may_ specify a Ruby engine version. If an engine version is
|
75
91
|
specified, an engine _must_ also be specified. If the engine is "ruby" the
|
@@ -77,13 +93,13 @@ engine version specified _must_ match the Ruby version.
|
|
77
93
|
|
78
94
|
ruby "1.8.7", :engine => "jruby", :engine_version => "1.6.7"
|
79
95
|
|
80
|
-
### PATCHLEVEL
|
96
|
+
### PATCHLEVEL
|
81
97
|
|
82
98
|
Each application _may_ specify a Ruby patchlevel.
|
83
99
|
|
84
100
|
ruby "2.0.0", :patchlevel => "247"
|
85
101
|
|
86
|
-
## GEMS
|
102
|
+
## GEMS
|
87
103
|
|
88
104
|
Specify gem requirements using the `gem` method, with the following arguments.
|
89
105
|
All parameters are `OPTIONAL` unless otherwise specified.
|
@@ -101,16 +117,16 @@ Each _gem_ `MAY` have one or more version specifiers.
|
|
101
117
|
gem "nokogiri", ">= 1.4.2"
|
102
118
|
gem "RedCloth", ">= 4.1.0", "< 4.2.0"
|
103
119
|
|
104
|
-
### REQUIRE AS
|
120
|
+
### REQUIRE AS
|
105
121
|
|
106
122
|
Each _gem_ `MAY` specify files that should be used when autorequiring via
|
107
|
-
`Bundler.require`. You may pass an array with multiple files or `true` if file
|
108
|
-
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
|
109
125
|
prevent any file from being autorequired.
|
110
126
|
|
111
127
|
gem "redis", :require => ["redis/connection/hiredis", "redis"]
|
112
128
|
gem "webmock", :require => false
|
113
|
-
gem "
|
129
|
+
gem "byebug", :require => true
|
114
130
|
|
115
131
|
The argument defaults to the name of the gem. For example, these are identical:
|
116
132
|
|
@@ -118,7 +134,7 @@ The argument defaults to the name of the gem. For example, these are identical:
|
|
118
134
|
gem "nokogiri", :require => "nokogiri"
|
119
135
|
gem "nokogiri", :require => true
|
120
136
|
|
121
|
-
### GROUPS
|
137
|
+
### GROUPS
|
122
138
|
|
123
139
|
Each _gem_ `MAY` specify membership in one or more groups. Any _gem_ that does
|
124
140
|
not specify membership in any group is placed in the `default` group.
|
@@ -137,32 +153,29 @@ The Bundler runtime allows its two main methods, `Bundler.setup` and
|
|
137
153
|
Bundler.setup(:default, :test) # set up the _default_ and _test_ groups, but no others
|
138
154
|
|
139
155
|
# require requires all of the gems in the specified groups
|
140
|
-
Bundler.require # defaults to
|
156
|
+
Bundler.require # defaults to the _default_ group
|
141
157
|
Bundler.require(:default) # identical
|
142
158
|
Bundler.require(:default, :test) # requires the _default_ and _test_ groups
|
143
|
-
Bundler.require(:test) # requires
|
159
|
+
Bundler.require(:test) # requires the _test_ group
|
144
160
|
|
145
161
|
The Bundler CLI allows you to specify a list of groups whose gems `bundle install` should
|
146
|
-
not install with the
|
147
|
-
list of groups separated by spaces.
|
162
|
+
not install with the `without` configuration.
|
148
163
|
|
149
|
-
|
150
|
-
bundle install --without development test
|
164
|
+
To specify multiple groups to ignore, specify a list of groups separated by spaces.
|
151
165
|
|
152
|
-
|
153
|
-
|
154
|
-
without any `--without option`, bundler will recall it.
|
166
|
+
bundle config set --local without test
|
167
|
+
bundle config set --local without development test
|
155
168
|
|
156
169
|
Also, calling `Bundler.setup` with no parameters, or calling `require "bundler/setup"`
|
157
170
|
will setup all groups except for the ones you excluded via `--without` (since they
|
158
|
-
are
|
171
|
+
are not available).
|
159
172
|
|
160
173
|
Note that on `bundle install`, bundler downloads and evaluates all gems, in order to
|
161
174
|
create a single canonical list of all of the required gems and their dependencies.
|
162
175
|
This means that you cannot list different versions of the same gems in different
|
163
|
-
groups. For more details, see [Understanding Bundler](
|
176
|
+
groups. For more details, see [Understanding Bundler](https://bundler.io/rationale.html).
|
164
177
|
|
165
|
-
### PLATFORMS
|
178
|
+
### PLATFORMS
|
166
179
|
|
167
180
|
If a gem should only be used in a particular platform or set of platforms, you can
|
168
181
|
specify them. Platforms are essentially identical to groups, except that you do not
|
@@ -172,63 +185,41 @@ platforms.
|
|
172
185
|
There are a number of `Gemfile` platforms:
|
173
186
|
|
174
187
|
* `ruby`:
|
175
|
-
C Ruby (MRI) or
|
176
|
-
* `ruby_18`:
|
177
|
-
_ruby_ `AND` version 1.8
|
178
|
-
* `ruby_19`:
|
179
|
-
_ruby_ `AND` version 1.9
|
180
|
-
* `ruby_20`:
|
181
|
-
_ruby_ `AND` version 2.0
|
182
|
-
* `ruby_21`:
|
183
|
-
_ruby_ `AND` version 2.1
|
184
|
-
* `ruby_22`:
|
185
|
-
_ruby_ `AND` version 2.2
|
186
|
-
* `ruby_23`:
|
187
|
-
_ruby_ `AND` version 2.3
|
188
|
+
C Ruby (MRI), Rubinius or TruffleRuby, but `NOT` Windows
|
188
189
|
* `mri`:
|
189
|
-
Same as _ruby_, but
|
190
|
-
* `
|
191
|
-
|
192
|
-
* `
|
193
|
-
|
194
|
-
* `mri_20`:
|
195
|
-
_mri_ `AND` version 2.0
|
196
|
-
* `mri_21`:
|
197
|
-
_mri_ `AND` version 2.1
|
198
|
-
* `mri_22`:
|
199
|
-
_mri_ `AND` version 2.2
|
200
|
-
* `mri_23`:
|
201
|
-
_mri_ `AND` version 2.3
|
190
|
+
Same as _ruby_, but only C Ruby (MRI)
|
191
|
+
* `mingw`:
|
192
|
+
Windows 32 bit 'mingw32' platform (aka RubyInstaller)
|
193
|
+
* `x64_mingw`:
|
194
|
+
Windows 64 bit 'mingw32' platform (aka RubyInstaller x64)
|
202
195
|
* `rbx`:
|
203
|
-
|
196
|
+
Rubinius
|
204
197
|
* `jruby`:
|
205
198
|
JRuby
|
199
|
+
* `truffleruby`:
|
200
|
+
TruffleRuby
|
206
201
|
* `mswin`:
|
207
202
|
Windows
|
203
|
+
|
204
|
+
You can restrict further by platform and version for all platforms *except* for
|
205
|
+
`rbx`, `jruby`, `truffleruby` and `mswin`.
|
206
|
+
|
207
|
+
To specify a version in addition to a platform, append the version number without
|
208
|
+
the delimiter to the platform. For example, to specify that a gem should only be
|
209
|
+
used on platforms with Ruby 2.3, use:
|
210
|
+
|
211
|
+
ruby_23
|
212
|
+
|
213
|
+
The full list of platforms and supported versions includes:
|
214
|
+
|
215
|
+
* `ruby`:
|
216
|
+
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
|
217
|
+
* `mri`:
|
218
|
+
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
|
208
219
|
* `mingw`:
|
209
|
-
|
210
|
-
* `mingw_18`:
|
211
|
-
_mingw_ `AND` version 1.8
|
212
|
-
* `mingw_19`:
|
213
|
-
_mingw_ `AND` version 1.9
|
214
|
-
* `mingw_20`:
|
215
|
-
_mingw_ `AND` version 2.0
|
216
|
-
* `mingw_21`:
|
217
|
-
_mingw_ `AND` version 2.1
|
218
|
-
* `mingw_22`:
|
219
|
-
_mingw_ `AND` version 2.2
|
220
|
-
* `mingw_23`:
|
221
|
-
_mingw_ `AND` version 2.3
|
220
|
+
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
|
222
221
|
* `x64_mingw`:
|
223
|
-
|
224
|
-
* `x64_mingw_20`:
|
225
|
-
_x64_mingw_ `AND` version 2.0
|
226
|
-
* `x64_mingw_21`:
|
227
|
-
_x64_mingw_ `AND` version 2.1
|
228
|
-
* `x64_mingw_22`:
|
229
|
-
_x64_mingw_ `AND` version 2.2
|
230
|
-
* `x64_mingw_23`:
|
231
|
-
_x64_mingw_ `AND` version 2.3
|
222
|
+
2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
|
232
223
|
|
233
224
|
As with groups, you can specify one or more platforms:
|
234
225
|
|
@@ -236,11 +227,11 @@ As with groups, you can specify one or more platforms:
|
|
236
227
|
gem "ruby-debug", :platforms => :mri_18
|
237
228
|
gem "nokogiri", :platforms => [:mri_18, :jruby]
|
238
229
|
|
239
|
-
All operations involving groups (`bundle install
|
230
|
+
All operations involving groups ([`bundle install`](bundle-install.1.html), `Bundler.setup`,
|
240
231
|
`Bundler.require`) behave exactly the same as if any groups not
|
241
232
|
matching the current platform were explicitly excluded.
|
242
233
|
|
243
|
-
### SOURCE
|
234
|
+
### SOURCE
|
244
235
|
|
245
236
|
You can select an alternate Rubygems repository for a gem using the ':source'
|
246
237
|
option.
|
@@ -257,9 +248,15 @@ back on global sources using the ordering described in [SOURCE PRIORITY][].
|
|
257
248
|
|
258
249
|
Selecting a specific source repository this way also suppresses the ambiguous
|
259
250
|
gem warning described above in
|
260
|
-
[GLOBAL SOURCES (#source)](#GLOBAL-SOURCES
|
251
|
+
[GLOBAL SOURCES (#source)](#GLOBAL-SOURCES).
|
252
|
+
|
253
|
+
Using the `:source` option for an individual gem will also make that source
|
254
|
+
available as a possible global source for any other gems which do not specify
|
255
|
+
explicit sources. Thus, when adding gems with explicit sources, it is
|
256
|
+
recommended that you also ensure all other gems in the Gemfile are using
|
257
|
+
explicit sources.
|
261
258
|
|
262
|
-
### GIT
|
259
|
+
### GIT
|
263
260
|
|
264
261
|
If necessary, you can specify that a gem is located at a particular
|
265
262
|
git repository using the `:git` parameter. The repository can be accessed via
|
@@ -310,8 +307,17 @@ Git repositories support a number of additional options.
|
|
310
307
|
|
311
308
|
* `branch`, `tag`, and `ref`:
|
312
309
|
You `MUST` only specify at most one of these options. The default
|
313
|
-
is `:branch => "master"
|
310
|
+
is `:branch => "master"`. For example:
|
311
|
+
|
312
|
+
gem "rails", :git => "https://github.com/rails/rails.git", :branch => "5-0-stable"
|
313
|
+
|
314
|
+
gem "rails", :git => "https://github.com/rails/rails.git", :tag => "v5.0.0"
|
315
|
+
|
316
|
+
gem "rails", :git => "https://github.com/rails/rails.git", :ref => "4aded"
|
317
|
+
|
314
318
|
* `submodules`:
|
319
|
+
For reference, a [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules)
|
320
|
+
lets you have another git repository within a subfolder of your repository.
|
315
321
|
Specify `:submodules => true` to cause bundler to expand any
|
316
322
|
submodules included in the git repository
|
317
323
|
|
@@ -333,7 +339,7 @@ and then installs the resulting gem. The `gem build` command,
|
|
333
339
|
which comes standard with Rubygems, evaluates the `.gemspec` in
|
334
340
|
the context of the directory in which it is located.
|
335
341
|
|
336
|
-
### GIT SOURCE
|
342
|
+
### GIT SOURCE
|
337
343
|
|
338
344
|
A custom git source can be defined via the `git_source` method. Provide the source's name
|
339
345
|
as an argument, and a block which receives a single argument and interpolates it into a
|
@@ -346,14 +352,14 @@ In addition, if you wish to choose a specific branch:
|
|
346
352
|
|
347
353
|
gem "rails", :stash => "forks/rails", :branch => "branch_name"
|
348
354
|
|
349
|
-
### GITHUB
|
355
|
+
### GITHUB
|
350
356
|
|
351
357
|
`NOTE`: This shorthand should be avoided until Bundler 2.0, since it
|
352
358
|
currently expands to an insecure `git://` URL. This allows a
|
353
359
|
man-in-the-middle attacker to compromise your system.
|
354
360
|
|
355
361
|
If the git repository you want to use is hosted on GitHub and is public, you can use the
|
356
|
-
:github shorthand to specify
|
362
|
+
:github shorthand to specify the github username and repository name (without the
|
357
363
|
trailing ".git"), separated by a slash. If both the username and repository name are the
|
358
364
|
same, you can omit one.
|
359
365
|
|
@@ -366,10 +372,10 @@ Are both equivalent to
|
|
366
372
|
|
367
373
|
Since the `github` method is a specialization of `git_source`, it accepts a `:branch` named argument.
|
368
374
|
|
369
|
-
### GIST
|
375
|
+
### GIST
|
370
376
|
|
371
377
|
If the git repository you want to use is hosted as a Github Gist and is public, you can use
|
372
|
-
the :gist shorthand to specify
|
378
|
+
the :gist shorthand to specify the gist identifier (without the trailing ".git").
|
373
379
|
|
374
380
|
gem "the_hatch", :gist => "4815162342"
|
375
381
|
|
@@ -379,10 +385,10 @@ Is equivalent to:
|
|
379
385
|
|
380
386
|
Since the `gist` method is a specialization of `git_source`, it accepts a `:branch` named argument.
|
381
387
|
|
382
|
-
### BITBUCKET
|
388
|
+
### BITBUCKET
|
383
389
|
|
384
390
|
If the git repository you want to use is hosted on Bitbucket and is public, you can use the
|
385
|
-
:bitbucket shorthand to specify
|
391
|
+
:bitbucket shorthand to specify the bitbucket username and repository name (without the
|
386
392
|
trailing ".git"), separated by a slash. If both the username and repository name are the
|
387
393
|
same, you can omit one.
|
388
394
|
|
@@ -395,7 +401,7 @@ Are both equivalent to
|
|
395
401
|
|
396
402
|
Since the `bitbucket` method is a specialization of `git_source`, it accepts a `:branch` named argument.
|
397
403
|
|
398
|
-
### PATH
|
404
|
+
### PATH
|
399
405
|
|
400
406
|
You can specify that a gem is located in a particular location
|
401
407
|
on the file system. Relative paths are resolved relative to the
|
@@ -451,7 +457,14 @@ In the case of the `git` block form, the `:ref`, `:branch`, `:tag`,
|
|
451
457
|
and `:submodules` options may be passed to the `git` method, and
|
452
458
|
all gems in the block will inherit those options.
|
453
459
|
|
454
|
-
|
460
|
+
The presence of a `source` block in a Gemfile also makes that source
|
461
|
+
available as a possible global source for any other gems which do not specify
|
462
|
+
explicit sources. Thus, when defining source blocks, it is
|
463
|
+
recommended that you also ensure all other gems in the Gemfile are using
|
464
|
+
explicit sources, either via source blocks or `:source` directives on
|
465
|
+
individual gems.
|
466
|
+
|
467
|
+
## INSTALL_IF
|
455
468
|
|
456
469
|
The `install_if` method allows gems to be installed based on a proc or lambda.
|
457
470
|
This is especially useful for optional gems that can only be used if certain
|
@@ -461,7 +474,12 @@ software is installed or some other conditions are met.
|
|
461
474
|
gem "pasteboard"
|
462
475
|
end
|
463
476
|
|
464
|
-
## GEMSPEC
|
477
|
+
## GEMSPEC
|
478
|
+
|
479
|
+
The [`.gemspec`](http://guides.rubygems.org/specification-reference/) file is where
|
480
|
+
you provide metadata about your gem to Rubygems. Some required Gemspec
|
481
|
+
attributes include the name, description, and homepage of your gem. This is
|
482
|
+
also where you specify the dependencies your gem needs to run.
|
465
483
|
|
466
484
|
If you wish to use Bundler to help install dependencies for a gem while it is
|
467
485
|
being developed, use the `gemspec` method to pull in the dependencies listed in
|
@@ -480,6 +498,10 @@ options, which control where bundler looks for the `.gemspec`, the glob it uses
|
|
480
498
|
for the gemspec (defaults to: "{,*,*/*}.gemspec"), what named `.gemspec` it uses
|
481
499
|
(if more than one is present), and which group development dependencies are included in.
|
482
500
|
|
501
|
+
When a `gemspec` dependency encounters version conflicts during resolution, the
|
502
|
+
local version under development will always be selected -- even if there are
|
503
|
+
remote versions that better match other requirements for the `gemspec` gem.
|
504
|
+
|
483
505
|
## SOURCE PRIORITY
|
484
506
|
|
485
507
|
When attempting to locate a gem to satisfy a gem requirement,
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Gemfile(5) gemfile.5
|
2
|
+
bundle(1) bundle.1
|
3
|
+
bundle-add(1) bundle-add.1
|
4
|
+
bundle-binstubs(1) bundle-binstubs.1
|
5
|
+
bundle-cache(1) bundle-cache.1
|
6
|
+
bundle-check(1) bundle-check.1
|
7
|
+
bundle-clean(1) bundle-clean.1
|
8
|
+
bundle-config(1) bundle-config.1
|
9
|
+
bundle-doctor(1) bundle-doctor.1
|
10
|
+
bundle-exec(1) bundle-exec.1
|
11
|
+
bundle-gem(1) bundle-gem.1
|
12
|
+
bundle-info(1) bundle-info.1
|
13
|
+
bundle-init(1) bundle-init.1
|
14
|
+
bundle-inject(1) bundle-inject.1
|
15
|
+
bundle-install(1) bundle-install.1
|
16
|
+
bundle-list(1) bundle-list.1
|
17
|
+
bundle-lock(1) bundle-lock.1
|
18
|
+
bundle-open(1) bundle-open.1
|
19
|
+
bundle-outdated(1) bundle-outdated.1
|
20
|
+
bundle-platform(1) bundle-platform.1
|
21
|
+
bundle-pristine(1) bundle-pristine.1
|
22
|
+
bundle-remove(1) bundle-remove.1
|
23
|
+
bundle-show(1) bundle-show.1
|
24
|
+
bundle-update(1) bundle-update.1
|
25
|
+
bundle-viz(1) bundle-viz.1
|
@@ -1,13 +1,24 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "gem_helpers"
|
2
4
|
|
3
5
|
module Bundler
|
4
6
|
module MatchPlatform
|
5
7
|
include GemHelpers
|
6
8
|
|
7
9
|
def match_platform(p)
|
8
|
-
|
9
|
-
|
10
|
-
|
10
|
+
MatchPlatform.platforms_match?(platform, p)
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.platforms_match?(gemspec_platform, local_platform)
|
14
|
+
return true if gemspec_platform.nil?
|
15
|
+
return true if Gem::Platform::RUBY == gemspec_platform
|
16
|
+
return true if local_platform == gemspec_platform
|
17
|
+
gemspec_platform = Gem::Platform.new(gemspec_platform)
|
18
|
+
return true if GemHelpers.generic(gemspec_platform) === local_platform
|
19
|
+
return true if gemspec_platform === local_platform
|
20
|
+
|
21
|
+
false
|
11
22
|
end
|
12
23
|
end
|
13
24
|
end
|