rubygems-update 2.7.11 → 3.0.9
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.
- checksums.yaml +4 -4
- data/.rubocop.yml +67 -0
- data/.travis.yml +24 -18
- data/CODE_OF_CONDUCT.md +10 -8
- data/CONTRIBUTING.md +148 -0
- data/History.txt +458 -8
- data/MAINTAINERS.txt +1 -0
- data/Manifest.txt +16 -9
- data/POLICIES.md +92 -0
- data/README.md +53 -26
- data/Rakefile +77 -211
- data/{UPGRADING.rdoc → UPGRADING.md} +31 -32
- data/appveyor.yml +20 -45
- data/bin/gem +1 -2
- data/bin/update_rubygems +2 -3
- data/bundler/CHANGELOG.md +65 -0
- data/bundler/bundler.gemspec +7 -1
- data/bundler/lib/bundler/build_metadata.rb +1 -1
- data/bundler/lib/bundler/cli/add.rb +15 -5
- data/bundler/lib/bundler/cli/binstubs.rb +8 -2
- data/bundler/lib/bundler/cli/doctor.rb +47 -1
- data/bundler/lib/bundler/cli/install.rb +8 -5
- data/bundler/lib/bundler/cli/list.rb +41 -5
- data/bundler/lib/bundler/cli/outdated.rb +7 -1
- data/bundler/lib/bundler/cli/pristine.rb +4 -0
- data/bundler/lib/bundler/cli/remove.rb +18 -0
- data/bundler/lib/bundler/cli.rb +63 -21
- data/bundler/lib/bundler/definition.rb +15 -16
- data/bundler/lib/bundler/dependency.rb +2 -2
- data/bundler/lib/bundler/dsl.rb +19 -3
- data/bundler/lib/bundler/feature_flag.rb +7 -0
- data/bundler/lib/bundler/gem_version_promoter.rb +4 -2
- data/bundler/lib/bundler/injector.rb +168 -9
- data/bundler/lib/bundler/installer/parallel_installer.rb +5 -0
- data/bundler/lib/bundler/installer.rb +29 -6
- data/bundler/lib/bundler/plugin/events.rb +61 -0
- data/bundler/lib/bundler/plugin.rb +10 -3
- data/bundler/lib/bundler/resolver.rb +2 -2
- data/bundler/lib/bundler/rubygems_gem_installer.rb +7 -0
- data/bundler/lib/bundler/runtime.rb +8 -2
- data/bundler/lib/bundler/settings/validator.rb +23 -0
- data/bundler/lib/bundler/settings.rb +24 -3
- data/bundler/lib/bundler/shared_helpers.rb +19 -3
- data/bundler/lib/bundler/source/metadata.rb +2 -3
- data/bundler/lib/bundler/source.rb +9 -9
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +1 -0
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler.rb +26 -8
- data/bundler/man/bundle-add.ronn +13 -2
- data/bundler/man/bundle-config.ronn +21 -0
- data/bundler/man/bundle-install.ronn +1 -1
- data/bundler/man/bundle-list.ronn +19 -1
- data/bundler/man/bundle-outdated.ronn +4 -0
- data/bundler/man/bundle-remove.ronn +23 -0
- data/bundler/man/bundle-update.ronn +1 -1
- data/bundler/man/bundle.ronn +3 -0
- data/lib/rubygems/available_set.rb +1 -1
- data/lib/rubygems/basic_specification.rb +12 -12
- data/lib/rubygems/bundler_version_finder.rb +3 -3
- data/lib/rubygems/command.rb +22 -15
- data/lib/rubygems/command_manager.rb +22 -5
- data/lib/rubygems/commands/build_command.rb +41 -7
- data/lib/rubygems/commands/cert_command.rb +45 -24
- data/lib/rubygems/commands/check_command.rb +1 -1
- data/lib/rubygems/commands/cleanup_command.rb +14 -7
- data/lib/rubygems/commands/contents_command.rb +14 -15
- data/lib/rubygems/commands/dependency_command.rb +17 -17
- data/lib/rubygems/commands/environment_command.rb +20 -1
- data/lib/rubygems/commands/fetch_command.rb +2 -3
- data/lib/rubygems/commands/generate_index_command.rb +2 -3
- data/lib/rubygems/commands/help_command.rb +12 -13
- data/lib/rubygems/commands/info_command.rb +33 -0
- data/lib/rubygems/commands/install_command.rb +21 -17
- data/lib/rubygems/commands/list_command.rb +0 -1
- data/lib/rubygems/commands/lock_command.rb +3 -4
- data/lib/rubygems/commands/open_command.rb +16 -10
- data/lib/rubygems/commands/owner_command.rb +21 -7
- data/lib/rubygems/commands/pristine_command.rb +23 -16
- data/lib/rubygems/commands/push_command.rb +19 -8
- data/lib/rubygems/commands/query_command.rb +24 -24
- data/lib/rubygems/commands/rdoc_command.rb +3 -4
- data/lib/rubygems/commands/search_command.rb +0 -1
- data/lib/rubygems/commands/server_command.rb +1 -2
- data/lib/rubygems/commands/setup_command.rb +86 -48
- data/lib/rubygems/commands/signin_command.rb +2 -1
- data/lib/rubygems/commands/signout_command.rb +2 -2
- data/lib/rubygems/commands/sources_command.rb +11 -12
- data/lib/rubygems/commands/specification_command.rb +7 -7
- data/lib/rubygems/commands/uninstall_command.rb +50 -18
- data/lib/rubygems/commands/unpack_command.rb +16 -7
- data/lib/rubygems/commands/update_command.rb +28 -23
- data/lib/rubygems/commands/which_command.rb +5 -8
- data/lib/rubygems/commands/yank_command.rb +1 -2
- data/lib/rubygems/compatibility.rb +1 -21
- data/lib/rubygems/config_file.rb +36 -36
- data/lib/rubygems/core_ext/kernel_require.rb +6 -6
- data/lib/rubygems/core_ext/kernel_warn.rb +45 -0
- data/lib/rubygems/defaults.rb +31 -19
- data/lib/rubygems/dependency.rb +15 -15
- data/lib/rubygems/dependency_installer.rb +30 -33
- data/lib/rubygems/dependency_list.rb +9 -10
- data/lib/rubygems/deprecate.rb +2 -3
- data/lib/rubygems/doctor.rb +5 -6
- data/lib/rubygems/errors.rb +3 -3
- data/lib/rubygems/exceptions.rb +11 -8
- data/lib/rubygems/ext/build_error.rb +0 -1
- data/lib/rubygems/ext/builder.rb +50 -23
- data/lib/rubygems/ext/cmake_builder.rb +2 -2
- data/lib/rubygems/ext/configure_builder.rb +2 -3
- data/lib/rubygems/ext/ext_conf_builder.rb +8 -7
- data/lib/rubygems/ext/rake_builder.rb +16 -18
- data/lib/rubygems/ext.rb +0 -1
- data/lib/rubygems/gem_runner.rb +2 -2
- data/lib/rubygems/gemcutter_utilities.rb +46 -12
- data/lib/rubygems/indexer.rb +19 -12
- data/lib/rubygems/install_default_message.rb +0 -1
- data/lib/rubygems/install_message.rb +0 -1
- data/lib/rubygems/install_update_options.rb +3 -29
- data/lib/rubygems/installer.rb +97 -55
- data/lib/rubygems/installer_test_case.rb +2 -16
- data/lib/rubygems/local_remote_options.rb +5 -4
- data/lib/rubygems/mock_gem_ui.rb +3 -4
- data/lib/rubygems/name_tuple.rb +4 -4
- data/lib/rubygems/package/digest_io.rb +3 -4
- data/lib/rubygems/package/file_source.rb +3 -4
- data/lib/rubygems/package/io_source.rb +1 -2
- data/lib/rubygems/package/old.rb +8 -16
- data/lib/rubygems/package/source.rb +0 -1
- data/lib/rubygems/package/tar_header.rb +13 -4
- data/lib/rubygems/package/tar_reader/entry.rb +20 -4
- data/lib/rubygems/package/tar_reader.rb +2 -4
- data/lib/rubygems/package/tar_test_case.rb +2 -8
- data/lib/rubygems/package/tar_writer.rb +13 -15
- data/lib/rubygems/package.rb +90 -63
- data/lib/rubygems/package_task.rb +0 -1
- data/lib/rubygems/path_support.rb +16 -6
- data/lib/rubygems/platform.rb +4 -5
- data/lib/rubygems/psych_tree.rb +1 -1
- data/lib/rubygems/rdoc.rb +2 -313
- data/lib/rubygems/remote_fetcher.rb +29 -82
- data/lib/rubygems/request/connection_pools.rb +24 -13
- data/lib/rubygems/request/http_pool.rb +3 -4
- data/lib/rubygems/request/https_pool.rb +1 -3
- data/lib/rubygems/request.rb +17 -16
- data/lib/rubygems/request_set/gem_dependency_api.rb +46 -49
- data/lib/rubygems/request_set/lockfile/parser.rb +18 -29
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +9 -9
- data/lib/rubygems/request_set/lockfile.rb +12 -12
- data/lib/rubygems/request_set.rb +52 -25
- data/lib/rubygems/requirement.rb +32 -21
- data/lib/rubygems/resolver/activation_request.rb +6 -6
- data/lib/rubygems/resolver/api_set.rb +5 -6
- data/lib/rubygems/resolver/api_specification.rb +2 -3
- data/lib/rubygems/resolver/best_set.rb +5 -6
- data/lib/rubygems/resolver/composed_set.rb +5 -6
- data/lib/rubygems/resolver/conflict.rb +5 -5
- data/lib/rubygems/resolver/current_set.rb +1 -2
- data/lib/rubygems/resolver/dependency_request.rb +4 -4
- data/lib/rubygems/resolver/git_set.rb +5 -6
- data/lib/rubygems/resolver/git_specification.rb +4 -5
- data/lib/rubygems/resolver/index_set.rb +5 -6
- data/lib/rubygems/resolver/index_specification.rb +3 -4
- data/lib/rubygems/resolver/installed_specification.rb +3 -4
- data/lib/rubygems/resolver/installer_set.rb +12 -12
- data/lib/rubygems/resolver/local_specification.rb +1 -2
- data/lib/rubygems/resolver/lock_set.rb +5 -6
- data/lib/rubygems/resolver/lock_specification.rb +7 -8
- data/lib/rubygems/resolver/requirement_list.rb +1 -1
- data/lib/rubygems/resolver/set.rb +2 -2
- data/lib/rubygems/resolver/source_set.rb +4 -5
- data/lib/rubygems/resolver/spec_specification.rb +1 -2
- data/lib/rubygems/resolver/specification.rb +10 -7
- data/lib/rubygems/resolver/stats.rb +1 -1
- data/lib/rubygems/resolver/vendor_set.rb +4 -5
- data/lib/rubygems/resolver/vendor_specification.rb +2 -3
- data/lib/rubygems/resolver.rb +14 -16
- data/lib/rubygems/s3_uri_signer.rb +183 -0
- data/lib/rubygems/safe_yaml.rb +18 -10
- data/lib/rubygems/security/policies.rb +1 -2
- data/lib/rubygems/security/policy.rb +25 -25
- data/lib/rubygems/security/signer.rb +72 -24
- data/lib/rubygems/security/trust_dir.rb +10 -10
- data/lib/rubygems/security.rb +21 -22
- data/lib/rubygems/security_option.rb +0 -1
- data/lib/rubygems/server.rb +21 -21
- data/lib/rubygems/source/git.rb +9 -10
- data/lib/rubygems/source/installed.rb +3 -4
- data/lib/rubygems/source/local.rb +7 -7
- data/lib/rubygems/source/lock.rb +4 -4
- data/lib/rubygems/source/specific_file.rb +5 -5
- data/lib/rubygems/source/vendor.rb +2 -3
- data/lib/rubygems/source.rb +16 -25
- data/lib/rubygems/source_list.rb +2 -2
- data/lib/rubygems/source_local.rb +0 -1
- data/lib/rubygems/spec_fetcher.rb +5 -6
- data/lib/rubygems/specification.rb +219 -558
- data/lib/rubygems/specification_policy.rb +407 -0
- data/lib/rubygems/stub_specification.rb +12 -17
- data/lib/rubygems/test_case.rb +161 -75
- data/lib/rubygems/test_utilities.rb +20 -35
- data/lib/rubygems/text.rb +6 -6
- data/lib/rubygems/uninstaller.rb +38 -27
- data/lib/rubygems/uri_formatter.rb +1 -2
- data/lib/rubygems/user_interaction.rb +37 -89
- data/lib/rubygems/util/licenses.rb +27 -1
- data/lib/rubygems/util/list.rb +1 -1
- data/lib/rubygems/util.rb +32 -14
- data/lib/rubygems/validator.rb +4 -5
- data/lib/rubygems/version.rb +15 -15
- data/lib/rubygems/version_option.rb +2 -3
- data/lib/rubygems.rb +71 -102
- data/rubygems-update.gemspec +43 -0
- data/setup.rb +2 -8
- data/test/rubygems/ca_cert.pem +74 -65
- data/test/rubygems/client.pem +103 -45
- data/test/rubygems/rubygems_plugin.rb +0 -1
- data/test/rubygems/simple_gem.rb +1 -1
- data/test/rubygems/ssl_cert.pem +78 -17
- data/test/rubygems/ssl_key.pem +25 -13
- data/test/rubygems/test_bundled_ca.rb +1 -1
- data/test/rubygems/test_config.rb +7 -2
- data/test/rubygems/test_gem.rb +205 -132
- data/test/rubygems/test_gem_bundler_version_finder.rb +4 -0
- data/test/rubygems/test_gem_command.rb +0 -1
- data/test/rubygems/test_gem_command_manager.rb +18 -3
- data/test/rubygems/test_gem_commands_build_command.rb +220 -15
- data/test/rubygems/test_gem_commands_cert_command.rb +69 -8
- data/test/rubygems/test_gem_commands_check_command.rb +1 -1
- data/test/rubygems/test_gem_commands_cleanup_command.rb +27 -1
- data/test/rubygems/test_gem_commands_contents_command.rb +1 -2
- data/test/rubygems/test_gem_commands_dependency_command.rb +33 -34
- data/test/rubygems/test_gem_commands_environment_command.rb +1 -0
- data/test/rubygems/test_gem_commands_fetch_command.rb +0 -1
- data/test/rubygems/test_gem_commands_generate_index_command.rb +0 -1
- data/test/rubygems/test_gem_commands_help_command.rb +7 -4
- data/test/rubygems/test_gem_commands_info_command.rb +44 -0
- data/test/rubygems/test_gem_commands_install_command.rb +79 -12
- data/test/rubygems/test_gem_commands_lock_command.rb +0 -1
- data/test/rubygems/test_gem_commands_open_command.rb +29 -0
- data/test/rubygems/test_gem_commands_outdated_command.rb +0 -1
- data/test/rubygems/test_gem_commands_owner_command.rb +93 -57
- data/test/rubygems/test_gem_commands_pristine_command.rb +65 -30
- data/test/rubygems/test_gem_commands_push_command.rb +54 -0
- data/test/rubygems/test_gem_commands_query_command.rb +102 -100
- data/test/rubygems/test_gem_commands_search_command.rb +0 -1
- data/test/rubygems/test_gem_commands_server_command.rb +0 -1
- data/test/rubygems/test_gem_commands_setup_command.rb +50 -15
- data/test/rubygems/test_gem_commands_signin_command.rb +1 -1
- data/test/rubygems/test_gem_commands_sources_command.rb +0 -1
- data/test/rubygems/test_gem_commands_specification_command.rb +2 -3
- data/test/rubygems/test_gem_commands_stale_command.rb +3 -2
- data/test/rubygems/test_gem_commands_uninstall_command.rb +161 -8
- data/test/rubygems/test_gem_commands_unpack_command.rb +17 -1
- data/test/rubygems/test_gem_commands_update_command.rb +19 -2
- data/test/rubygems/test_gem_commands_which_command.rb +0 -1
- data/test/rubygems/test_gem_commands_yank_command.rb +0 -1
- data/test/rubygems/test_gem_config_file.rb +4 -2
- data/test/rubygems/test_gem_dependency.rb +0 -1
- data/test/rubygems/test_gem_dependency_installer.rb +8 -5
- data/test/rubygems/test_gem_dependency_list.rb +6 -7
- data/test/rubygems/test_gem_dependency_resolution_error.rb +0 -1
- data/test/rubygems/test_gem_doctor.rb +1 -2
- data/test/rubygems/test_gem_ext_builder.rb +10 -23
- data/test/rubygems/test_gem_ext_cmake_builder.rb +5 -4
- data/test/rubygems/test_gem_ext_configure_builder.rb +3 -3
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +8 -9
- data/test/rubygems/test_gem_ext_rake_builder.rb +20 -5
- data/test/rubygems/test_gem_gem_runner.rb +0 -1
- data/test/rubygems/test_gem_gemcutter_utilities.rb +32 -6
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +0 -1
- data/test/rubygems/test_gem_indexer.rb +16 -10
- data/test/rubygems/test_gem_install_update_options.rb +1 -20
- data/test/rubygems/test_gem_installer.rb +154 -119
- data/test/rubygems/test_gem_local_remote_options.rb +3 -3
- data/test/rubygems/test_gem_name_tuple.rb +0 -1
- data/test/rubygems/test_gem_package.rb +77 -31
- data/test/rubygems/test_gem_package_old.rb +0 -1
- data/test/rubygems/test_gem_package_tar_header.rb +42 -2
- data/test/rubygems/test_gem_package_tar_reader.rb +0 -1
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +11 -0
- data/test/rubygems/test_gem_package_tar_writer.rb +43 -7
- data/test/rubygems/test_gem_package_task.rb +2 -2
- data/test/rubygems/test_gem_path_support.rb +28 -11
- data/test/rubygems/test_gem_platform.rb +4 -5
- data/test/rubygems/test_gem_rdoc.rb +1 -136
- data/test/rubygems/test_gem_remote_fetcher.rb +241 -141
- data/test/rubygems/test_gem_request.rb +9 -9
- data/test/rubygems/test_gem_request_connection_pools.rb +24 -3
- data/test/rubygems/test_gem_request_set.rb +5 -5
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +82 -64
- data/test/rubygems/test_gem_request_set_lockfile.rb +1 -2
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +4 -9
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +1 -1
- data/test/rubygems/test_gem_requirement.rb +24 -4
- data/test/rubygems/test_gem_resolver.rb +13 -17
- data/test/rubygems/test_gem_resolver_activation_request.rb +0 -1
- data/test/rubygems/test_gem_resolver_api_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_api_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_best_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_composed_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_conflict.rb +0 -1
- data/test/rubygems/test_gem_resolver_dependency_request.rb +0 -1
- data/test/rubygems/test_gem_resolver_git_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_git_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_index_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_index_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_installed_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_installer_set.rb +2 -3
- data/test/rubygems/test_gem_resolver_local_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_lock_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_lock_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_requirement_list.rb +0 -1
- data/test/rubygems/test_gem_resolver_specification.rb +1 -2
- data/test/rubygems/test_gem_resolver_vendor_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_vendor_specification.rb +0 -1
- data/test/rubygems/test_gem_security.rb +1 -3
- data/test/rubygems/test_gem_security_policy.rb +5 -6
- data/test/rubygems/test_gem_security_signer.rb +4 -3
- data/test/rubygems/test_gem_security_trust_dir.rb +1 -2
- data/test/rubygems/test_gem_server.rb +4 -4
- data/test/rubygems/test_gem_source.rb +0 -13
- data/test/rubygems/test_gem_source_fetch_problem.rb +0 -1
- data/test/rubygems/test_gem_source_git.rb +0 -1
- data/test/rubygems/test_gem_source_installed.rb +0 -1
- data/test/rubygems/test_gem_source_lock.rb +0 -1
- data/test/rubygems/test_gem_source_vendor.rb +0 -1
- data/test/rubygems/test_gem_spec_fetcher.rb +0 -1
- data/test/rubygems/test_gem_specification.rb +366 -198
- data/test/rubygems/test_gem_stream_ui.rb +15 -32
- data/test/rubygems/test_gem_stub_specification.rb +0 -2
- data/test/rubygems/test_gem_text.rb +4 -0
- data/test/rubygems/test_gem_uninstaller.rb +42 -3
- data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +0 -1
- data/test/rubygems/test_gem_uri_formatter.rb +0 -1
- data/test/rubygems/test_gem_util.rb +31 -11
- data/test/rubygems/test_gem_validator.rb +0 -1
- data/test/rubygems/test_gem_version.rb +11 -11
- data/test/rubygems/test_gem_version_option.rb +0 -1
- data/test/rubygems/test_remote_fetch_error.rb +0 -1
- data/test/rubygems/test_require.rb +67 -52
- data/util/CL2notes +1 -2
- data/util/ci +20 -12
- data/util/cops/deprecations.rb +52 -0
- data/util/create_certs.rb +6 -7
- data/util/create_certs.sh +27 -0
- data/util/create_encrypted_key.rb +4 -5
- data/util/patch_with_prs.rb +1 -1
- data/util/rubocop +8 -0
- data/util/update_bundled_ca_certificates.rb +12 -13
- data/util/update_changelog.rb +1 -1
- metadata +61 -51
- data/.autotest +0 -71
- data/.document +0 -5
- data/CONTRIBUTING.rdoc +0 -130
- data/CVE-2013-4287.txt +0 -35
- data/CVE-2013-4363.txt +0 -45
- data/CVE-2015-3900.txt +0 -40
- data/POLICIES.rdoc +0 -74
- data/test/rubygems/fix_openssl_warnings.rb +0 -13
@@ -21,8 +21,9 @@ module Bundler
|
|
21
21
|
# For more information see the #run method on this class.
|
22
22
|
def self.install(root, definition, options = {})
|
23
23
|
installer = new(root, definition)
|
24
|
-
Plugin.hook(
|
24
|
+
Plugin.hook(Plugin::Events::GEM_BEFORE_INSTALL_ALL, definition.dependencies)
|
25
25
|
installer.run(options)
|
26
|
+
Plugin.hook(Plugin::Events::GEM_AFTER_INSTALL_ALL, definition.dependencies)
|
26
27
|
installer
|
27
28
|
end
|
28
29
|
|
@@ -192,14 +193,36 @@ module Bundler
|
|
192
193
|
# installation is SO MUCH FASTER. so we let people opt in.
|
193
194
|
def install(options)
|
194
195
|
force = options["force"]
|
195
|
-
jobs = options
|
196
|
-
|
197
|
-
|
196
|
+
jobs = installation_parallelization(options)
|
197
|
+
install_in_parallel jobs, options[:standalone], force
|
198
|
+
end
|
199
|
+
|
200
|
+
def installation_parallelization(options)
|
201
|
+
if jobs = options.delete(:jobs)
|
202
|
+
return jobs
|
203
|
+
end
|
204
|
+
|
205
|
+
return 1 unless can_install_in_parallel?
|
206
|
+
|
207
|
+
auto_config_jobs = Bundler.feature_flag.auto_config_jobs?
|
208
|
+
if jobs = Bundler.settings[:jobs]
|
209
|
+
if auto_config_jobs
|
210
|
+
jobs
|
198
211
|
else
|
199
|
-
1
|
212
|
+
[jobs.pred, 1].max
|
200
213
|
end
|
214
|
+
elsif auto_config_jobs
|
215
|
+
processor_count
|
216
|
+
else
|
217
|
+
1
|
201
218
|
end
|
202
|
-
|
219
|
+
end
|
220
|
+
|
221
|
+
def processor_count
|
222
|
+
require "etc"
|
223
|
+
Etc.nprocessors
|
224
|
+
rescue
|
225
|
+
1
|
203
226
|
end
|
204
227
|
|
205
228
|
def load_plugins
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
module Plugin
|
5
|
+
module Events
|
6
|
+
def self.define(const, event)
|
7
|
+
const = const.to_sym.freeze
|
8
|
+
if const_defined?(const) && const_get(const) != event
|
9
|
+
raise ArgumentError, "Attempting to reassign #{const} to a different value"
|
10
|
+
end
|
11
|
+
const_set(const, event) unless const_defined?(const)
|
12
|
+
@events ||= {}
|
13
|
+
@events[event] = const
|
14
|
+
end
|
15
|
+
private_class_method :define
|
16
|
+
|
17
|
+
def self.reset
|
18
|
+
@events.each_value do |const|
|
19
|
+
remove_const(const)
|
20
|
+
end
|
21
|
+
@events = nil
|
22
|
+
end
|
23
|
+
private_class_method :reset
|
24
|
+
|
25
|
+
# Check if an event has been defined
|
26
|
+
# @param event [String] An event to check
|
27
|
+
# @return [Boolean] A boolean indicating if the event has been defined
|
28
|
+
def self.defined_event?(event)
|
29
|
+
@events ||= {}
|
30
|
+
@events.key?(event)
|
31
|
+
end
|
32
|
+
|
33
|
+
# @!parse
|
34
|
+
# A hook called before each individual gem is installed
|
35
|
+
# Includes a Bundler::ParallelInstaller::SpecInstallation.
|
36
|
+
# No state, error, post_install_message will be present as nothing has installed yet
|
37
|
+
# GEM_BEFORE_INSTALL = "before-install"
|
38
|
+
define :GEM_BEFORE_INSTALL, "before-install"
|
39
|
+
|
40
|
+
# @!parse
|
41
|
+
# A hook called after each individual gem is installed
|
42
|
+
# Includes a Bundler::ParallelInstaller::SpecInstallation.
|
43
|
+
# - If state is failed, an error will be present.
|
44
|
+
# - If state is success, a post_install_message may be present.
|
45
|
+
# GEM_AFTER_INSTALL = "after-install"
|
46
|
+
define :GEM_AFTER_INSTALL, "after-install"
|
47
|
+
|
48
|
+
# @!parse
|
49
|
+
# A hook called before any gems install
|
50
|
+
# Includes an Array of Bundler::Dependency objects
|
51
|
+
# GEM_BEFORE_INSTALL_ALL = "before-install-all"
|
52
|
+
define :GEM_BEFORE_INSTALL_ALL, "before-install-all"
|
53
|
+
|
54
|
+
# @!parse
|
55
|
+
# A hook called after any gems install
|
56
|
+
# Includes an Array of Bundler::Dependency objects
|
57
|
+
# GEM_AFTER_INSTALL_ALL = "after-install-all"
|
58
|
+
define :GEM_AFTER_INSTALL_ALL, "after-install-all"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -5,6 +5,7 @@ require "bundler/plugin/api"
|
|
5
5
|
module Bundler
|
6
6
|
module Plugin
|
7
7
|
autoload :DSL, "bundler/plugin/dsl"
|
8
|
+
autoload :Events, "bundler/plugin/events"
|
8
9
|
autoload :Index, "bundler/plugin/index"
|
9
10
|
autoload :Installer, "bundler/plugin/installer"
|
10
11
|
autoload :SourceList, "bundler/plugin/source_list"
|
@@ -80,8 +81,8 @@ module Bundler
|
|
80
81
|
|
81
82
|
# The directory root for all plugin related data
|
82
83
|
#
|
83
|
-
#
|
84
|
-
# in user_bundle_path
|
84
|
+
# If run in an app, points to local root, in app_config_path
|
85
|
+
# Otherwise, points to global root, in Bundler.user_bundle_path("plugin")
|
85
86
|
def root
|
86
87
|
@root ||= if SharedHelpers.in_bundle?
|
87
88
|
local_root
|
@@ -96,7 +97,7 @@ module Bundler
|
|
96
97
|
|
97
98
|
# The global directory root for all plugin related data
|
98
99
|
def global_root
|
99
|
-
Bundler.user_bundle_path
|
100
|
+
Bundler.user_bundle_path("plugin")
|
100
101
|
end
|
101
102
|
|
102
103
|
# The cache directory for plugin stuffs
|
@@ -155,6 +156,9 @@ module Bundler
|
|
155
156
|
# To be called via the API to register a hooks and corresponding block that
|
156
157
|
# will be called to handle the hook
|
157
158
|
def add_hook(event, &block)
|
159
|
+
unless Events.defined_event?(event)
|
160
|
+
raise ArgumentError, "Event '#{event}' not defined in Bundler::Plugin::Events"
|
161
|
+
end
|
158
162
|
@hooks_by_event[event.to_s] << block
|
159
163
|
end
|
160
164
|
|
@@ -166,6 +170,9 @@ module Bundler
|
|
166
170
|
# @param [String] event
|
167
171
|
def hook(event, *args, &arg_blk)
|
168
172
|
return unless Bundler.feature_flag.plugins?
|
173
|
+
unless Events.defined_event?(event)
|
174
|
+
raise ArgumentError, "Event '#{event}' not defined in Bundler::Plugin::Events"
|
175
|
+
end
|
169
176
|
|
170
177
|
plugins = index.hook_plugins(event)
|
171
178
|
return unless plugins.any?
|
@@ -39,7 +39,7 @@ module Bundler
|
|
39
39
|
@gem_version_promoter = gem_version_promoter
|
40
40
|
@allow_bundler_dependency_conflicts = Bundler.feature_flag.allow_bundler_dependency_conflicts?
|
41
41
|
@lockfile_uses_separate_rubygems_sources = Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
|
42
|
-
@use_gvp = !@gem_version_promoter.major?
|
42
|
+
@use_gvp = Bundler.feature_flag.use_gem_version_promoter_for_major_updates? || !@gem_version_promoter.major?
|
43
43
|
end
|
44
44
|
|
45
45
|
def start(requirements)
|
@@ -137,7 +137,7 @@ module Bundler
|
|
137
137
|
end
|
138
138
|
# GVP handles major itself, but it's still a bit risky to trust it with it
|
139
139
|
# until we get it settled with new behavior. For 2.x it can take over all cases.
|
140
|
-
if
|
140
|
+
if !@use_gvp
|
141
141
|
spec_groups
|
142
142
|
else
|
143
143
|
@gem_version_promoter.sort_versions(dependency, spec_groups)
|
@@ -10,6 +10,13 @@ module Bundler
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
+
attr_reader :options
|
14
|
+
|
15
|
+
def initialize(gem, options = {})
|
16
|
+
@options = {}
|
17
|
+
super
|
18
|
+
end
|
19
|
+
|
13
20
|
def check_executable_overwrite(filename)
|
14
21
|
# Bundler needs to install gems regardless of binstub overwriting
|
15
22
|
end
|
@@ -163,6 +163,7 @@ module Bundler
|
|
163
163
|
gem_dirs = Dir["#{Gem.dir}/gems/*"]
|
164
164
|
gem_files = Dir["#{Gem.dir}/cache/*.gem"]
|
165
165
|
gemspec_files = Dir["#{Gem.dir}/specifications/*.gemspec"]
|
166
|
+
extension_dirs = Dir["#{Gem.dir}/extensions/*/*/*"]
|
166
167
|
spec_gem_paths = []
|
167
168
|
# need to keep git sources around
|
168
169
|
spec_git_paths = @definition.spec_git_paths
|
@@ -170,6 +171,7 @@ module Bundler
|
|
170
171
|
spec_gem_executables = []
|
171
172
|
spec_cache_paths = []
|
172
173
|
spec_gemspec_paths = []
|
174
|
+
spec_extension_paths = []
|
173
175
|
specs.each do |spec|
|
174
176
|
spec_gem_paths << spec.full_gem_path
|
175
177
|
# need to check here in case gems are nested like for the rails git repo
|
@@ -181,6 +183,7 @@ module Bundler
|
|
181
183
|
end
|
182
184
|
spec_cache_paths << spec.cache_file
|
183
185
|
spec_gemspec_paths << spec.spec_file
|
186
|
+
spec_extension_paths << spec.extension_dir if spec.respond_to?(:extension_dir)
|
184
187
|
spec_git_cache_dirs << spec.source.cache_path.to_s if spec.source.is_a?(Bundler::Source::Git)
|
185
188
|
end
|
186
189
|
spec_gem_paths.uniq!
|
@@ -192,6 +195,7 @@ module Bundler
|
|
192
195
|
stale_gem_dirs = gem_dirs - spec_gem_paths
|
193
196
|
stale_gem_files = gem_files - spec_cache_paths
|
194
197
|
stale_gemspec_files = gemspec_files - spec_gemspec_paths
|
198
|
+
stale_extension_dirs = extension_dirs - spec_extension_paths
|
195
199
|
|
196
200
|
removed_stale_gem_dirs = stale_gem_dirs.collect {|dir| remove_dir(dir, dry_run) }
|
197
201
|
removed_stale_git_dirs = stale_git_dirs.collect {|dir| remove_dir(dir, dry_run) }
|
@@ -204,8 +208,10 @@ module Bundler
|
|
204
208
|
FileUtils.rm(file) if File.exist?(file)
|
205
209
|
end
|
206
210
|
end
|
207
|
-
|
208
|
-
|
211
|
+
|
212
|
+
stale_dirs = stale_git_cache_dirs + stale_extension_dirs
|
213
|
+
stale_dirs.each do |stale_dir|
|
214
|
+
SharedHelpers.filesystem_access(stale_dir) do |dir|
|
209
215
|
FileUtils.rm_rf(dir) if File.exist?(dir)
|
210
216
|
end
|
211
217
|
end
|
@@ -74,6 +74,29 @@ module Bundler
|
|
74
74
|
fail!(key, value, "`#{other_key}` is current set to #{other_setting.inspect}", "the `#{conflicting.join("`, `")}` groups conflict")
|
75
75
|
end
|
76
76
|
end
|
77
|
+
|
78
|
+
rule %w[path], "relative paths are expanded relative to the current working directory" do |key, value, settings|
|
79
|
+
next if value.nil?
|
80
|
+
|
81
|
+
path = Pathname.new(value)
|
82
|
+
next if !path.relative? || !Bundler.feature_flag.path_relative_to_cwd?
|
83
|
+
|
84
|
+
path = path.expand_path
|
85
|
+
|
86
|
+
root = begin
|
87
|
+
Bundler.root
|
88
|
+
rescue GemfileNotFound
|
89
|
+
Pathname.pwd.expand_path
|
90
|
+
end
|
91
|
+
|
92
|
+
path = begin
|
93
|
+
path.relative_path_from(root)
|
94
|
+
rescue ArgumentError
|
95
|
+
path
|
96
|
+
end
|
97
|
+
|
98
|
+
set(settings, key, path.to_s)
|
99
|
+
end
|
77
100
|
end
|
78
101
|
end
|
79
102
|
end
|
@@ -14,6 +14,7 @@ module Bundler
|
|
14
14
|
allow_offline_install
|
15
15
|
auto_clean_without_path
|
16
16
|
auto_install
|
17
|
+
auto_config_jobs
|
17
18
|
cache_all
|
18
19
|
cache_all_platforms
|
19
20
|
cache_command_is_package
|
@@ -25,6 +26,7 @@ module Bundler
|
|
25
26
|
disable_exec_load
|
26
27
|
disable_local_branch_check
|
27
28
|
disable_multisource
|
29
|
+
disable_platform_warnings
|
28
30
|
disable_shared_gems
|
29
31
|
disable_version_check
|
30
32
|
error_on_stderr
|
@@ -33,6 +35,7 @@ module Bundler
|
|
33
35
|
frozen
|
34
36
|
gem.coc
|
35
37
|
gem.mit
|
38
|
+
global_path_appends_ruby_scope
|
36
39
|
global_gem_cache
|
37
40
|
ignore_messages
|
38
41
|
init_gems_rb
|
@@ -42,6 +45,7 @@ module Bundler
|
|
42
45
|
no_install
|
43
46
|
no_prune
|
44
47
|
only_update_to_newer_versions
|
48
|
+
path_relative_to_cwd
|
45
49
|
path.system
|
46
50
|
plugins
|
47
51
|
prefer_gems_rb
|
@@ -53,9 +57,12 @@ module Bundler
|
|
53
57
|
suppress_install_using_messages
|
54
58
|
unlock_source_unlocks_spec
|
55
59
|
update_requires_all_flag
|
60
|
+
use_gem_version_promoter_for_major_updates
|
61
|
+
viz_command
|
56
62
|
].freeze
|
57
63
|
|
58
64
|
NUMBER_KEYS = %w[
|
65
|
+
jobs
|
59
66
|
redirect
|
60
67
|
retry
|
61
68
|
ssl_verify_mode
|
@@ -213,13 +220,13 @@ module Bundler
|
|
213
220
|
locations
|
214
221
|
end
|
215
222
|
|
216
|
-
# for legacy reasons, the ruby scope isnt appended when the setting comes from ENV or the global config,
|
223
|
+
# for legacy reasons, in Bundler 1, the ruby scope isnt appended when the setting comes from ENV or the global config,
|
217
224
|
# nor do we respect :disable_shared_gems
|
218
225
|
def path
|
219
226
|
key = key_for(:path)
|
220
227
|
path = ENV[key] || @global_config[key]
|
221
228
|
if path && !@temporary.key?(key) && !@local_config.key?(key)
|
222
|
-
return Path.new(path,
|
229
|
+
return Path.new(path, Bundler.feature_flag.global_path_appends_ruby_scope?, false, false)
|
223
230
|
end
|
224
231
|
|
225
232
|
system_path = self["path.system"] || (self[:disable_shared_gems] == false)
|
@@ -246,6 +253,20 @@ module Bundler
|
|
246
253
|
path
|
247
254
|
end
|
248
255
|
|
256
|
+
def base_path_relative_to_pwd
|
257
|
+
base_path = Pathname.new(self.base_path)
|
258
|
+
expanded_base_path = base_path.expand_path(Bundler.root)
|
259
|
+
relative_path = expanded_base_path.relative_path_from(Pathname.pwd)
|
260
|
+
if relative_path.to_s.start_with?("..")
|
261
|
+
relative_path = base_path if base_path.absolute?
|
262
|
+
else
|
263
|
+
relative_path = Pathname.new(File.join(".", relative_path))
|
264
|
+
end
|
265
|
+
relative_path
|
266
|
+
rescue ArgumentError
|
267
|
+
expanded_base_path
|
268
|
+
end
|
269
|
+
|
249
270
|
def validate!
|
250
271
|
return unless explicit_path && system_path
|
251
272
|
path = Bundler.settings.pretty_values_for(:path)
|
@@ -374,7 +395,7 @@ module Bundler
|
|
374
395
|
Pathname.new(ENV["BUNDLE_CONFIG"])
|
375
396
|
else
|
376
397
|
begin
|
377
|
-
Bundler.user_bundle_path
|
398
|
+
Bundler.user_bundle_path("config")
|
378
399
|
rescue PermissionError, GenericSystemCallError
|
379
400
|
nil
|
380
401
|
end
|
@@ -197,10 +197,12 @@ module Bundler
|
|
197
197
|
def pretty_dependency(dep, print_source = false)
|
198
198
|
msg = String.new(dep.name)
|
199
199
|
msg << " (#{dep.requirement})" unless dep.requirement == Gem::Requirement.default
|
200
|
+
|
200
201
|
if dep.is_a?(Bundler::Dependency)
|
201
202
|
platform_string = dep.platforms.join(", ")
|
202
203
|
msg << " " << platform_string if !platform_string.empty? && platform_string != Gem::Platform::RUBY
|
203
204
|
end
|
205
|
+
|
204
206
|
msg << " from the `#{dep.source}` source" if print_source && dep.source
|
205
207
|
msg
|
206
208
|
end
|
@@ -223,6 +225,10 @@ module Bundler
|
|
223
225
|
Digest(name)
|
224
226
|
end
|
225
227
|
|
228
|
+
def write_to_gemfile(gemfile_path, contents)
|
229
|
+
filesystem_access(gemfile_path) {|g| File.open(g, "w") {|file| file.puts contents } }
|
230
|
+
end
|
231
|
+
|
226
232
|
private
|
227
233
|
|
228
234
|
def validate_bundle_path
|
@@ -268,7 +274,15 @@ module Bundler
|
|
268
274
|
until !File.directory?(current) || current == previous
|
269
275
|
if ENV["BUNDLE_SPEC_RUN"]
|
270
276
|
# avoid stepping above the tmp directory when testing
|
271
|
-
|
277
|
+
gemspec = if ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"]
|
278
|
+
# for Ruby Core
|
279
|
+
"lib/bundler.gemspec"
|
280
|
+
else
|
281
|
+
"bundler.gemspec"
|
282
|
+
end
|
283
|
+
|
284
|
+
# avoid stepping above the tmp directory when testing
|
285
|
+
return nil if File.file?(File.join(current, gemspec))
|
272
286
|
end
|
273
287
|
|
274
288
|
names.each do |name|
|
@@ -297,10 +311,12 @@ module Bundler
|
|
297
311
|
unless File.exist?(exe_file)
|
298
312
|
exe_file = File.expand_path("../../../exe/bundle", __FILE__)
|
299
313
|
end
|
300
|
-
|
301
314
|
Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", exe_file
|
302
315
|
rescue Gem::GemNotFoundException
|
303
|
-
|
316
|
+
exe_file = File.expand_path("../../../exe/bundle", __FILE__)
|
317
|
+
# for Ruby core repository
|
318
|
+
exe_file = File.expand_path("../../../../bin/bundle", __FILE__) unless File.exist?(exe_file)
|
319
|
+
Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", exe_file
|
304
320
|
end
|
305
321
|
|
306
322
|
# Set BUNDLE_GEMFILE
|
@@ -19,9 +19,8 @@ module Bundler
|
|
19
19
|
# can't point to the actual gemspec or else the require paths will be wrong
|
20
20
|
s.loaded_from = File.expand_path("..", __FILE__)
|
21
21
|
end
|
22
|
-
|
23
|
-
|
24
|
-
elsif local_spec = Bundler.rubygems.find_name("bundler").find {|s| s.version.to_s == VERSION }
|
22
|
+
|
23
|
+
if local_spec = Bundler.rubygems.find_name("bundler").find {|s| s.version.to_s == VERSION }
|
25
24
|
idx << local_spec
|
26
25
|
end
|
27
26
|
|
@@ -54,6 +54,15 @@ module Bundler
|
|
54
54
|
instance_of?(Bundler::Source::Path)
|
55
55
|
end
|
56
56
|
|
57
|
+
def extension_cache_path(spec)
|
58
|
+
return unless Bundler.feature_flag.global_gem_cache?
|
59
|
+
return unless source_slug = extension_cache_slug(spec)
|
60
|
+
Bundler.user_cache.join(
|
61
|
+
"extensions", Gem::Platform.local.to_s, Bundler.ruby_scope,
|
62
|
+
source_slug, spec.full_name
|
63
|
+
)
|
64
|
+
end
|
65
|
+
|
57
66
|
private
|
58
67
|
|
59
68
|
def version_color(spec_version, locked_spec_version)
|
@@ -78,15 +87,6 @@ module Bundler
|
|
78
87
|
end
|
79
88
|
end
|
80
89
|
|
81
|
-
def extension_cache_path(spec)
|
82
|
-
return unless Bundler.feature_flag.global_gem_cache?
|
83
|
-
return unless source_slug = extension_cache_slug(spec)
|
84
|
-
Bundler.user_cache.join(
|
85
|
-
"extensions", Gem::Platform.local.to_s, Bundler.ruby_scope,
|
86
|
-
source_slug, spec.full_name
|
87
|
-
)
|
88
|
-
end
|
89
|
-
|
90
90
|
def extension_cache_slug(_)
|
91
91
|
nil
|
92
92
|
end
|
@@ -6,6 +6,7 @@ require "<%= config[:namespaced_path] %>/<%= config[:underscored_name] %>"
|
|
6
6
|
<%- config[:constant_array].each_with_index do |c, i| -%>
|
7
7
|
<%= " " * i %>module <%= c %>
|
8
8
|
<%- end -%>
|
9
|
+
<%= " " * config[:constant_array].size %>class Error < StandardError; end
|
9
10
|
<%= " " * config[:constant_array].size %># Your code goes here...
|
10
11
|
<%- (config[:constant_array].size-1).downto(0) do |i| -%>
|
11
12
|
<%= " " * i %>end
|
@@ -7,7 +7,7 @@ module Bundler
|
|
7
7
|
# We're doing this because we might write tests that deal
|
8
8
|
# with other versions of bundler and we are unsure how to
|
9
9
|
# handle this better.
|
10
|
-
VERSION = "1.
|
10
|
+
VERSION = "1.17.3" unless defined?(::Bundler::VERSION)
|
11
11
|
|
12
12
|
def self.overwrite_loaded_gem_version
|
13
13
|
begin
|
data/bundler/lib/bundler.rb
CHANGED
@@ -195,8 +195,26 @@ module Bundler
|
|
195
195
|
raise e.exception("#{warning}\nBundler also failed to create a temporary home directory at `#{path}':\n#{e}")
|
196
196
|
end
|
197
197
|
|
198
|
-
def user_bundle_path
|
199
|
-
|
198
|
+
def user_bundle_path(dir = "home")
|
199
|
+
env_var, fallback = case dir
|
200
|
+
when "home"
|
201
|
+
["BUNDLE_USER_HOME", Pathname.new(user_home).join(".bundle")]
|
202
|
+
when "cache"
|
203
|
+
["BUNDLE_USER_CACHE", user_bundle_path.join("cache")]
|
204
|
+
when "config"
|
205
|
+
["BUNDLE_USER_CONFIG", user_bundle_path.join("config")]
|
206
|
+
when "plugin"
|
207
|
+
["BUNDLE_USER_PLUGIN", user_bundle_path.join("plugin")]
|
208
|
+
else
|
209
|
+
raise BundlerError, "Unknown user path requested: #{dir}"
|
210
|
+
end
|
211
|
+
# `fallback` will already be a Pathname, but Pathname.new() is
|
212
|
+
# idempotent so it's OK
|
213
|
+
Pathname.new(ENV.fetch(env_var, fallback))
|
214
|
+
end
|
215
|
+
|
216
|
+
def user_cache
|
217
|
+
user_bundle_path("cache")
|
200
218
|
end
|
201
219
|
|
202
220
|
def home
|
@@ -211,10 +229,6 @@ module Bundler
|
|
211
229
|
bundle_path.join("specifications")
|
212
230
|
end
|
213
231
|
|
214
|
-
def user_cache
|
215
|
-
user_bundle_path.join("cache")
|
216
|
-
end
|
217
|
-
|
218
232
|
def root
|
219
233
|
@root ||= begin
|
220
234
|
SharedHelpers.root
|
@@ -353,8 +367,12 @@ EOF
|
|
353
367
|
bin_dir = bin_dir.parent until bin_dir.exist?
|
354
368
|
|
355
369
|
# if any directory is not writable, we need sudo
|
356
|
-
files = [path, bin_dir] | Dir[
|
357
|
-
|
370
|
+
files = [path, bin_dir] | Dir[bundle_path.join("build_info/*").to_s] | Dir[bundle_path.join("*").to_s]
|
371
|
+
unwritable_files = files.reject {|f| File.writable?(f) }
|
372
|
+
sudo_needed = !unwritable_files.empty?
|
373
|
+
if sudo_needed
|
374
|
+
Bundler.ui.warn "Following files may not be writable, so sudo is needed:\n #{unwritable_files.map(&:to_s).sort.join("\n ")}"
|
375
|
+
end
|
358
376
|
end
|
359
377
|
|
360
378
|
@requires_sudo_ran = true
|
data/bundler/man/bundle-add.ronn
CHANGED
@@ -3,10 +3,10 @@ bundle-add(1) -- Add gem to the Gemfile and run bundle install
|
|
3
3
|
|
4
4
|
## SYNOPSIS
|
5
5
|
|
6
|
-
`bundle add` <GEM_NAME> [--group=GROUP] [--version=VERSION] [--source=SOURCE]
|
6
|
+
`bundle add` <GEM_NAME> [--group=GROUP] [--version=VERSION] [--source=SOURCE] [--skip-install] [--strict] [--optimistic]
|
7
7
|
|
8
8
|
## DESCRIPTION
|
9
|
-
Adds the named gem to the Gemfile and run `bundle install`.
|
9
|
+
Adds the named gem to the Gemfile and run `bundle install`. `bundle install` can be avoided by using the flag `--skip-install`.
|
10
10
|
|
11
11
|
Example:
|
12
12
|
|
@@ -16,6 +16,8 @@ bundle add rails --version "< 3.0, > 1.1"
|
|
16
16
|
|
17
17
|
bundle add rails --version "~> 5.0.0" --source "https://gems.example.com" --group "development"
|
18
18
|
|
19
|
+
bundle add rails --skip-install
|
20
|
+
|
19
21
|
bundle add rails --group "development, test"
|
20
22
|
|
21
23
|
## OPTIONS
|
@@ -27,3 +29,12 @@ bundle add rails --group "development, test"
|
|
27
29
|
|
28
30
|
* `--source`, , `-s`:
|
29
31
|
Specify the source for the added gem.
|
32
|
+
|
33
|
+
* `--skip-install`:
|
34
|
+
Adds the gem to the Gemfile but does not install it.
|
35
|
+
|
36
|
+
* `--optimistic`:
|
37
|
+
Adds optimistic declaration of version
|
38
|
+
|
39
|
+
* `--strict`:
|
40
|
+
Adds strict declaration of version
|
@@ -170,6 +170,8 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|
170
170
|
When set, Gemfiles containing multiple sources will produce errors
|
171
171
|
instead of warnings.
|
172
172
|
Use `bundle config --delete disable_multisource` to unset.
|
173
|
+
* `disable_platform_warnings` (`BUNDLE_DISABLE_PLATFORM_WARNINGS`):
|
174
|
+
Disable warnings during bundle install when a dependency is unused on the current platform.
|
173
175
|
* `disable_shared_gems` (`BUNDLE_DISABLE_SHARED_GEMS`):
|
174
176
|
Stop Bundler from accessing gems installed to RubyGems' normal location.
|
175
177
|
* `disable_version_check` (`BUNDLE_DISABLE_VERSION_CHECK`):
|
@@ -196,6 +198,9 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|
196
198
|
* `global_gem_cache` (`BUNDLE_GLOBAL_GEM_CACHE`):
|
197
199
|
Whether Bundler should cache all gems globally, rather than locally to the
|
198
200
|
installing Ruby installation.
|
201
|
+
* `global_path_appends_ruby_scope` (`BUNDLE_GLOBAL_PATH_APPENDS_RUBY_SCOPE`):
|
202
|
+
Whether Bundler should append the Ruby scope (e.g. engine and ABI version)
|
203
|
+
to a globally-configured path.
|
199
204
|
* `ignore_messages` (`BUNDLE_IGNORE_MESSAGES`): When set, no post install
|
200
205
|
messages will be printed. To silence a single gem, use dot notation like
|
201
206
|
`ignore_messages.httparty true`.
|
@@ -222,6 +227,8 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|
222
227
|
is used, defaults to vendor/bundle.
|
223
228
|
* `path.system` (`BUNDLE_PATH__SYSTEM`):
|
224
229
|
Whether Bundler will install gems into the default system path (`Gem.dir`).
|
230
|
+
* `path_relative_to_cwd` (`PATH_RELATIVE_TO_CWD`)
|
231
|
+
Makes `--path` relative to the CWD instead of the `Gemfile`.
|
225
232
|
* `plugins` (`BUNDLE_PLUGINS`):
|
226
233
|
Enable Bundler's experimental plugin system.
|
227
234
|
* `prefer_gems_rb` (`BUNDLE_PREFER_GEMS_RB`)
|
@@ -374,3 +381,17 @@ This is especially useful for private repositories on hosts such as Github,
|
|
374
381
|
where you can use personal OAuth tokens:
|
375
382
|
|
376
383
|
export BUNDLE_GITHUB__COM=abcd0123generatedtoken:x-oauth-basic
|
384
|
+
|
385
|
+
|
386
|
+
## CONFIGURE BUNDLER DIRECTORIES
|
387
|
+
|
388
|
+
Bundler's home, config, cache and plugin directories are able to be configured
|
389
|
+
through environment variables. The default location for Bundler's home directory is
|
390
|
+
`~/.bundle`, which all directories inherit from by default. The following
|
391
|
+
outlines the available environment variables and their default values
|
392
|
+
|
393
|
+
BUNDLE_USER_HOME : $HOME/.bundle
|
394
|
+
BUNDLE_USER_CACHE : $BUNDLE_USER_HOME/cache
|
395
|
+
BUNDLE_USER_CONFIG : $BUNDLE_USER_HOME/config
|
396
|
+
BUNDLE_USER_PLUGIN : $BUNDLE_USER_HOME/plugin
|
397
|
+
|
@@ -66,7 +66,7 @@ time `bundle install` is run, use `bundle config` (see bundle-config(1)).
|
|
66
66
|
|
67
67
|
* `--force`:
|
68
68
|
Force download every gem, even if the required versions are already available
|
69
|
-
locally.
|
69
|
+
locally. `--redownload` is an alias of this option.
|
70
70
|
|
71
71
|
* `--frozen`:
|
72
72
|
Do not allow the Gemfile.lock to be updated after this install. Exits
|
@@ -3,13 +3,31 @@ bundle-list(1) -- List all the gems in the bundle
|
|
3
3
|
|
4
4
|
## SYNOPSIS
|
5
5
|
|
6
|
-
`bundle list` [--name-only]
|
6
|
+
`bundle list` [--name-only] [--paths] [--without-group=GROUP] [--only-group=GROUP]
|
7
7
|
|
8
8
|
## DESCRIPTION
|
9
9
|
|
10
10
|
Prints a list of all the gems in the bundle including their version.
|
11
11
|
|
12
|
+
Example:
|
13
|
+
|
14
|
+
bundle list --name-only
|
15
|
+
|
16
|
+
bundle list --paths
|
17
|
+
|
18
|
+
bundle list --without-group test
|
19
|
+
|
20
|
+
bundle list --only-group dev
|
21
|
+
|
22
|
+
bundle list --only-group dev --paths
|
23
|
+
|
12
24
|
## OPTIONS
|
13
25
|
|
14
26
|
* `--name-only`:
|
15
27
|
Print only the name of each gem.
|
28
|
+
* `--paths`:
|
29
|
+
Print the path to each gem in the bundle.
|
30
|
+
* `--without-group`:
|
31
|
+
Print all gems expect from a group.
|
32
|
+
* `--only-group`:
|
33
|
+
Print gems from a particular group.
|
@@ -15,6 +15,7 @@ bundle-outdated(1) -- List installed gems with newer versions available
|
|
15
15
|
[--filter-major]
|
16
16
|
[--filter-minor]
|
17
17
|
[--filter-patch]
|
18
|
+
[--only-explicit]
|
18
19
|
|
19
20
|
## DESCRIPTION
|
20
21
|
|
@@ -67,6 +68,9 @@ are up to date, Bundler will exit with a status of 0. Otherwise, it will exit 1.
|
|
67
68
|
* `--filter-patch`:
|
68
69
|
Only list patch newer versions.
|
69
70
|
|
71
|
+
* `--only-explicit`:
|
72
|
+
Only list gems specified in your Gemfile, not their dependencies.
|
73
|
+
|
70
74
|
## PATCH LEVEL OPTIONS
|
71
75
|
|
72
76
|
See [bundle update(1)](bundle-update.1.html) for details.
|