rubygems-update 3.2.15 → 3.2.28
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/CHANGELOG.md +155 -9
- data/CONTRIBUTING.md +2 -2
- data/Manifest.txt +11 -8
- data/bundler/CHANGELOG.md +204 -6
- data/bundler/bundler.gemspec +2 -3
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/cache.rb +1 -1
- data/bundler/lib/bundler/cli/check.rb +4 -2
- data/bundler/lib/bundler/cli/common.rb +15 -2
- data/bundler/lib/bundler/cli/doctor.rb +12 -2
- data/bundler/lib/bundler/cli/exec.rb +1 -6
- data/bundler/lib/bundler/cli/gem.rb +12 -3
- data/bundler/lib/bundler/cli/install.rb +10 -24
- data/bundler/lib/bundler/cli/list.rb +7 -1
- data/bundler/lib/bundler/cli/lock.rb +5 -1
- data/bundler/lib/bundler/cli/open.rb +1 -2
- data/bundler/lib/bundler/cli/outdated.rb +10 -11
- data/bundler/lib/bundler/cli/remove.rb +1 -2
- data/bundler/lib/bundler/cli/update.rb +9 -4
- data/bundler/lib/bundler/cli.rb +29 -44
- data/bundler/lib/bundler/compact_index_client/updater.rb +9 -5
- data/bundler/lib/bundler/current_ruby.rb +5 -4
- data/bundler/lib/bundler/definition.rb +75 -175
- data/bundler/lib/bundler/dsl.rb +23 -21
- data/bundler/lib/bundler/errors.rb +1 -1
- data/bundler/lib/bundler/feature_flag.rb +0 -4
- data/bundler/lib/bundler/fetcher/compact_index.rb +1 -1
- data/bundler/lib/bundler/fetcher/downloader.rb +9 -6
- data/bundler/lib/bundler/fetcher/index.rb +0 -1
- data/bundler/lib/bundler/fetcher.rb +2 -1
- data/bundler/lib/bundler/friendly_errors.rb +2 -4
- data/bundler/lib/bundler/gem_helper.rb +16 -0
- data/bundler/lib/bundler/index.rb +2 -7
- data/bundler/lib/bundler/injector.rb +2 -2
- data/bundler/lib/bundler/inline.rb +1 -1
- data/bundler/lib/bundler/installer/gem_installer.rb +3 -16
- data/bundler/lib/bundler/installer/standalone.rb +14 -9
- data/bundler/lib/bundler/installer.rb +5 -13
- data/bundler/lib/bundler/lazy_specification.rb +3 -3
- data/bundler/lib/bundler/lockfile_parser.rb +3 -20
- data/bundler/lib/bundler/man/bundle-add.1 +1 -1
- data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
- data/bundler/lib/bundler/man/bundle-check.1 +1 -1
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +21 -13
- data/bundler/lib/bundler/man/bundle-config.1.ronn +21 -14
- data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
- data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
- data/bundler/lib/bundler/man/bundle-info.1 +1 -1
- data/bundler/lib/bundler/man/bundle-init.1 +1 -1
- data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
- data/bundler/lib/bundler/man/bundle-install.1 +1 -1
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
- data/bundler/lib/bundler/man/bundle-open.1 +1 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
- data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +1 -1
- data/bundler/lib/bundler/man/bundle-update.1 +4 -4
- data/bundler/lib/bundler/man/bundle-update.1.ronn +3 -3
- data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
- data/bundler/lib/bundler/man/bundle.1 +1 -1
- data/bundler/lib/bundler/man/gemfile.5 +1 -1
- data/bundler/lib/bundler/plugin/api/source.rb +14 -0
- data/bundler/lib/bundler/plugin/index.rb +4 -1
- data/bundler/lib/bundler/plugin/installer.rb +3 -1
- data/bundler/lib/bundler/plugin.rb +27 -8
- data/bundler/lib/bundler/resolver/spec_group.rb +0 -24
- data/bundler/lib/bundler/resolver.rb +24 -112
- data/bundler/lib/bundler/retry.rb +1 -1
- data/bundler/lib/bundler/rubygems_ext.rb +24 -8
- data/bundler/lib/bundler/rubygems_gem_installer.rb +5 -1
- data/bundler/lib/bundler/rubygems_integration.rb +6 -3
- data/bundler/lib/bundler/runtime.rb +16 -9
- data/bundler/lib/bundler/settings.rb +95 -20
- data/bundler/lib/bundler/setup.rb +2 -2
- data/bundler/lib/bundler/shared_helpers.rb +0 -7
- data/bundler/lib/bundler/source/git/git_proxy.rb +1 -2
- data/bundler/lib/bundler/source/rubygems.rb +47 -26
- data/bundler/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/bundler/lib/bundler/source.rb +15 -0
- data/bundler/lib/bundler/source_list.rb +82 -27
- data/bundler/lib/bundler/source_map.rb +58 -0
- data/bundler/lib/bundler/spec_set.rb +14 -30
- data/bundler/lib/bundler/templates/Executable.bundler +6 -6
- data/bundler/lib/bundler/templates/Gemfile +1 -1
- data/bundler/lib/bundler/templates/gems.rb +1 -1
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +15 -6
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +5 -3
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +1 -1
- data/bundler/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +1 -1
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler/worker.rb +17 -2
- data/bundler/lib/bundler.rb +17 -27
- data/lib/rubygems/command.rb +2 -0
- data/lib/rubygems/command_manager.rb +3 -3
- data/lib/rubygems/commands/build_command.rb +4 -4
- data/lib/rubygems/commands/cert_command.rb +44 -40
- data/lib/rubygems/commands/check_command.rb +4 -4
- data/lib/rubygems/commands/cleanup_command.rb +3 -3
- data/lib/rubygems/commands/contents_command.rb +2 -2
- data/lib/rubygems/commands/dependency_command.rb +3 -3
- data/lib/rubygems/commands/environment_command.rb +1 -1
- data/lib/rubygems/commands/fetch_command.rb +3 -3
- data/lib/rubygems/commands/generate_index_command.rb +2 -2
- data/lib/rubygems/commands/help_command.rb +1 -1
- data/lib/rubygems/commands/info_command.rb +2 -2
- data/lib/rubygems/commands/install_command.rb +13 -12
- data/lib/rubygems/commands/list_command.rb +2 -2
- data/lib/rubygems/commands/lock_command.rb +1 -1
- data/lib/rubygems/commands/mirror_command.rb +1 -1
- data/lib/rubygems/commands/open_command.rb +3 -3
- data/lib/rubygems/commands/outdated_command.rb +4 -4
- data/lib/rubygems/commands/owner_command.rb +4 -4
- data/lib/rubygems/commands/pristine_command.rb +5 -5
- data/lib/rubygems/commands/push_command.rb +4 -4
- data/lib/rubygems/commands/query_command.rb +3 -3
- data/lib/rubygems/commands/rdoc_command.rb +3 -3
- data/lib/rubygems/commands/search_command.rb +2 -2
- data/lib/rubygems/commands/server_command.rb +3 -3
- data/lib/rubygems/commands/setup_command.rb +5 -5
- data/lib/rubygems/commands/signin_command.rb +2 -2
- data/lib/rubygems/commands/signout_command.rb +1 -1
- data/lib/rubygems/commands/sources_command.rb +4 -4
- data/lib/rubygems/commands/specification_command.rb +4 -4
- data/lib/rubygems/commands/stale_command.rb +1 -1
- data/lib/rubygems/commands/uninstall_command.rb +3 -3
- data/lib/rubygems/commands/unpack_command.rb +5 -5
- data/lib/rubygems/commands/update_command.rb +9 -9
- data/lib/rubygems/commands/which_command.rb +1 -1
- data/lib/rubygems/commands/yank_command.rb +5 -5
- data/lib/rubygems/config_file.rb +5 -5
- data/lib/rubygems/defaults.rb +1 -1
- data/lib/rubygems/dependency_installer.rb +8 -8
- data/lib/rubygems/dependency_list.rb +1 -1
- data/lib/rubygems/deprecate.rb +3 -1
- data/lib/rubygems/doctor.rb +2 -2
- data/lib/rubygems/exceptions.rb +1 -1
- data/lib/rubygems/ext/builder.rb +1 -0
- data/lib/rubygems/ext/ext_conf_builder.rb +5 -6
- data/lib/rubygems/ext/rake_builder.rb +1 -2
- data/lib/rubygems/gem_runner.rb +3 -3
- data/lib/rubygems/gemcutter_utilities.rb +14 -6
- data/lib/rubygems/indexer.rb +3 -3
- data/lib/rubygems/install_default_message.rb +2 -2
- data/lib/rubygems/install_message.rb +2 -2
- data/lib/rubygems/install_update_options.rb +2 -2
- data/lib/rubygems/installer.rb +26 -10
- data/lib/rubygems/local_remote_options.rb +1 -1
- data/lib/rubygems/mock_gem_ui.rb +1 -1
- data/lib/rubygems/package/io_source.rb +4 -0
- data/lib/rubygems/package/tar_reader.rb +1 -1
- data/lib/rubygems/package.rb +13 -20
- data/lib/rubygems/package_task.rb +2 -2
- data/lib/rubygems/platform.rb +2 -1
- data/lib/rubygems/rdoc.rb +1 -1
- data/lib/rubygems/remote_fetcher.rb +14 -21
- data/lib/rubygems/request.rb +6 -6
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +1 -1
- data/lib/rubygems/request_set/lockfile.rb +1 -1
- data/lib/rubygems/request_set.rb +4 -4
- data/lib/rubygems/requirement.rb +3 -22
- data/lib/rubygems/resolver/git_specification.rb +1 -1
- data/lib/rubygems/resolver/installer_set.rb +3 -3
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb +1 -1
- data/lib/rubygems/resolver/molinillo.rb +1 -1
- data/lib/rubygems/resolver/set.rb +0 -1
- data/lib/rubygems/resolver/specification.rb +1 -1
- data/lib/rubygems/resolver.rb +31 -31
- data/lib/rubygems/s3_uri_signer.rb +0 -1
- data/lib/rubygems/safe_yaml.rb +0 -2
- data/lib/rubygems/security/policy.rb +1 -1
- data/lib/rubygems/security/signer.rb +1 -1
- data/lib/rubygems/security.rb +5 -5
- data/lib/rubygems/security_option.rb +2 -2
- data/lib/rubygems/server.rb +2 -2
- data/lib/rubygems/source.rb +6 -6
- data/lib/rubygems/spec_fetcher.rb +5 -5
- data/lib/rubygems/specification.rb +15 -19
- data/lib/rubygems/specification_policy.rb +7 -6
- data/lib/rubygems/uninstaller.rb +42 -11
- data/lib/rubygems/uri.rb +111 -0
- data/lib/rubygems/user_interaction.rb +2 -2
- data/lib/rubygems/util/licenses.rb +108 -3
- data/lib/rubygems/validator.rb +2 -2
- data/lib/rubygems/version_option.rb +1 -1
- data/lib/rubygems.rb +40 -50
- data/rubygems-update.gemspec +1 -1
- data/setup.rb +1 -2
- data/test/rubygems/data/null-type.gemspec.rz +0 -0
- data/{lib/rubygems/test_case.rb → test/rubygems/helper.rb} +122 -37
- data/{lib → test}/rubygems/installer_test_case.rb +1 -1
- data/{lib → test}/rubygems/package/tar_test_case.rb +1 -1
- data/test/rubygems/packages/ascii_binder-0.1.10.1.gem +0 -0
- data/test/rubygems/packages/ill-formatted-platform-1.0.0.10.gem +0 -0
- data/test/rubygems/test_bundled_ca.rb +3 -3
- data/test/rubygems/test_config.rb +1 -1
- data/test/rubygems/test_deprecate.rb +50 -6
- data/test/rubygems/test_gem.rb +219 -163
- data/test/rubygems/test_gem_available_set.rb +1 -1
- data/test/rubygems/test_gem_bundler_version_finder.rb +4 -6
- data/test/rubygems/test_gem_command.rb +14 -2
- data/test/rubygems/test_gem_command_manager.rb +6 -6
- data/test/rubygems/test_gem_commands_build_command.rb +11 -11
- data/test/rubygems/test_gem_commands_cert_command.rb +37 -37
- data/test/rubygems/test_gem_commands_check_command.rb +6 -6
- data/test/rubygems/test_gem_commands_cleanup_command.rb +25 -25
- data/test/rubygems/test_gem_commands_contents_command.rb +4 -4
- data/test/rubygems/test_gem_commands_dependency_command.rb +3 -3
- data/test/rubygems/test_gem_commands_environment_command.rb +2 -2
- data/test/rubygems/test_gem_commands_fetch_command.rb +10 -10
- data/test/rubygems/test_gem_commands_generate_index_command.rb +1 -1
- data/test/rubygems/test_gem_commands_help_command.rb +9 -2
- data/test/rubygems/test_gem_commands_info_command.rb +1 -1
- data/test/rubygems/test_gem_commands_install_command.rb +86 -61
- data/test/rubygems/test_gem_commands_list_command.rb +2 -2
- data/test/rubygems/test_gem_commands_lock_command.rb +2 -2
- data/test/rubygems/test_gem_commands_mirror.rb +1 -1
- data/test/rubygems/test_gem_commands_open_command.rb +9 -10
- data/test/rubygems/test_gem_commands_outdated_command.rb +1 -1
- data/test/rubygems/test_gem_commands_owner_command.rb +4 -4
- data/test/rubygems/test_gem_commands_pristine_command.rb +15 -15
- data/test/rubygems/test_gem_commands_push_command.rb +7 -12
- data/test/rubygems/test_gem_commands_query_command.rb +8 -8
- data/test/rubygems/test_gem_commands_search_command.rb +1 -1
- data/test/rubygems/test_gem_commands_server_command.rb +3 -3
- data/test/rubygems/test_gem_commands_setup_command.rb +25 -25
- data/test/rubygems/test_gem_commands_signin_command.rb +14 -7
- data/test/rubygems/test_gem_commands_signout_command.rb +1 -1
- data/test/rubygems/test_gem_commands_sources_command.rb +6 -6
- data/test/rubygems/test_gem_commands_specification_command.rb +7 -7
- data/test/rubygems/test_gem_commands_stale_command.rb +1 -1
- data/test/rubygems/test_gem_commands_uninstall_command.rb +5 -5
- data/test/rubygems/test_gem_commands_unpack_command.rb +3 -3
- data/test/rubygems/test_gem_commands_update_command.rb +11 -11
- data/test/rubygems/test_gem_commands_which_command.rb +4 -4
- data/test/rubygems/test_gem_commands_yank_command.rb +2 -2
- data/test/rubygems/test_gem_config_file.rb +10 -10
- data/test/rubygems/test_gem_dependency.rb +13 -7
- data/test/rubygems/test_gem_dependency_installer.rb +5 -5
- data/test/rubygems/test_gem_dependency_list.rb +1 -1
- data/test/rubygems/test_gem_dependency_resolution_error.rb +1 -1
- data/test/rubygems/test_gem_doctor.rb +31 -31
- data/test/rubygems/test_gem_ext_builder.rb +24 -21
- data/test/rubygems/test_gem_ext_cmake_builder.rb +5 -5
- data/test/rubygems/test_gem_ext_configure_builder.rb +5 -5
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +15 -14
- data/test/rubygems/test_gem_ext_rake_builder.rb +4 -2
- data/test/rubygems/test_gem_gem_runner.rb +1 -1
- data/test/rubygems/test_gem_gemcutter_utilities.rb +21 -15
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +1 -1
- data/test/rubygems/test_gem_indexer.rb +1 -1
- data/test/rubygems/test_gem_install_update_options.rb +10 -10
- data/test/rubygems/test_gem_installer.rb +186 -142
- data/test/rubygems/test_gem_local_remote_options.rb +2 -2
- data/test/rubygems/test_gem_name_tuple.rb +1 -1
- data/test/rubygems/test_gem_package.rb +58 -51
- data/test/rubygems/test_gem_package_old.rb +10 -10
- data/test/rubygems/test_gem_package_tar_header.rb +6 -6
- data/test/rubygems/test_gem_package_tar_reader.rb +1 -1
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +9 -9
- data/test/rubygems/test_gem_package_tar_writer.rb +19 -21
- data/test/rubygems/test_gem_package_task.rb +3 -3
- data/test/rubygems/test_gem_path_support.rb +2 -2
- data/test/rubygems/test_gem_platform.rb +2 -1
- data/test/rubygems/test_gem_rdoc.rb +10 -10
- data/test/rubygems/test_gem_remote_fetcher.rb +48 -19
- data/test/rubygems/test_gem_request.rb +38 -12
- data/test/rubygems/test_gem_request_connection_pools.rb +2 -2
- data/test/rubygems/test_gem_request_set.rb +16 -15
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +17 -17
- data/test/rubygems/test_gem_request_set_lockfile.rb +4 -4
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +4 -4
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +5 -5
- data/test/rubygems/test_gem_requirement.rb +48 -14
- data/test/rubygems/test_gem_resolver.rb +12 -12
- data/test/rubygems/test_gem_resolver_activation_request.rb +1 -1
- data/test/rubygems/test_gem_resolver_api_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_api_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_best_set.rb +2 -2
- data/test/rubygems/test_gem_resolver_composed_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_conflict.rb +1 -1
- data/test/rubygems/test_gem_resolver_dependency_request.rb +1 -1
- data/test/rubygems/test_gem_resolver_git_set.rb +2 -2
- data/test/rubygems/test_gem_resolver_git_specification.rb +4 -3
- data/test/rubygems/test_gem_resolver_index_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_index_specification.rb +2 -2
- data/test/rubygems/test_gem_resolver_installed_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_installer_set.rb +23 -5
- data/test/rubygems/test_gem_resolver_local_specification.rb +2 -2
- data/test/rubygems/test_gem_resolver_lock_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_lock_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_requirement_list.rb +1 -1
- data/test/rubygems/test_gem_resolver_specification.rb +2 -2
- data/test/rubygems/test_gem_resolver_vendor_set.rb +3 -3
- data/test/rubygems/test_gem_resolver_vendor_specification.rb +1 -1
- data/test/rubygems/test_gem_security.rb +6 -6
- data/test/rubygems/test_gem_security_policy.rb +28 -28
- data/test/rubygems/test_gem_security_signer.rb +8 -8
- data/test/rubygems/test_gem_security_trust_dir.rb +5 -5
- data/test/rubygems/test_gem_server.rb +7 -7
- data/test/rubygems/test_gem_silent_ui.rb +10 -10
- data/test/rubygems/test_gem_source.rb +3 -3
- data/test/rubygems/test_gem_source_fetch_problem.rb +2 -2
- data/test/rubygems/test_gem_source_git.rb +12 -12
- data/test/rubygems/test_gem_source_installed.rb +1 -1
- data/test/rubygems/test_gem_source_list.rb +1 -1
- data/test/rubygems/test_gem_source_local.rb +1 -1
- data/test/rubygems/test_gem_source_lock.rb +1 -1
- data/test/rubygems/test_gem_source_specific_file.rb +2 -2
- data/test/rubygems/test_gem_source_subpath_problem.rb +1 -1
- data/test/rubygems/test_gem_source_vendor.rb +1 -1
- data/test/rubygems/test_gem_spec_fetcher.rb +2 -2
- data/test/rubygems/test_gem_specification.rb +101 -271
- data/test/rubygems/test_gem_stream_ui.rb +2 -2
- data/test/rubygems/test_gem_stub_specification.rb +5 -5
- data/test/rubygems/test_gem_text.rb +1 -1
- data/test/rubygems/test_gem_uninstaller.rb +26 -19
- data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +1 -1
- data/test/rubygems/test_gem_uri.rb +39 -0
- data/test/rubygems/test_gem_uri_formatter.rb +1 -1
- data/test/rubygems/test_gem_util.rb +9 -7
- data/test/rubygems/test_gem_validator.rb +1 -1
- data/test/rubygems/test_gem_version.rb +5 -14
- data/test/rubygems/test_gem_version_option.rb +1 -1
- data/test/rubygems/test_kernel.rb +7 -5
- data/test/rubygems/test_project_sanity.rb +2 -2
- data/test/rubygems/test_remote_fetch_error.rb +2 -2
- data/test/rubygems/test_require.rb +13 -15
- data/test/rubygems/test_rubygems.rb +44 -0
- data/{lib/rubygems/test_utilities.rb → test/rubygems/utilities.rb} +1 -3
- data/test/test_changelog_generator.rb +1 -2
- metadata +14 -11
- data/Rakefile +0 -402
- data/lib/rubygems/syck_hack.rb +0 -77
- data/lib/rubygems/uri_parser.rb +0 -34
- data/lib/rubygems/uri_parsing.rb +0 -23
|
@@ -36,10 +36,15 @@ module Bundler
|
|
|
36
36
|
def self.without_groups_message(command)
|
|
37
37
|
command_in_past_tense = command == :install ? "installed" : "updated"
|
|
38
38
|
groups = Bundler.settings[:without]
|
|
39
|
+
"Gems in the #{verbalize_groups(groups)} were not #{command_in_past_tense}."
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def self.verbalize_groups(groups)
|
|
43
|
+
groups.map!{|g| "'#{g}'" }
|
|
39
44
|
group_list = [groups[0...-1].join(", "), groups[-1..-1]].
|
|
40
45
|
reject {|s| s.to_s.empty? }.join(" and ")
|
|
41
46
|
group_str = groups.size == 1 ? "group" : "groups"
|
|
42
|
-
"
|
|
47
|
+
"#{group_str} #{group_list}"
|
|
43
48
|
end
|
|
44
49
|
|
|
45
50
|
def self.select_spec(name, regex_match = nil)
|
|
@@ -53,7 +58,13 @@ module Bundler
|
|
|
53
58
|
|
|
54
59
|
case specs.count
|
|
55
60
|
when 0
|
|
56
|
-
|
|
61
|
+
dep_in_other_group = Bundler.definition.current_dependencies.find {|dep|dep.name == name }
|
|
62
|
+
|
|
63
|
+
if dep_in_other_group
|
|
64
|
+
raise GemNotFound, "Could not find gem '#{name}', because it's in the #{verbalize_groups(dep_in_other_group.groups)}, configured to be ignored."
|
|
65
|
+
else
|
|
66
|
+
raise GemNotFound, gem_not_found_message(name, Bundler.definition.dependencies)
|
|
67
|
+
end
|
|
57
68
|
when 1
|
|
58
69
|
specs.first
|
|
59
70
|
else
|
|
@@ -83,6 +94,8 @@ module Bundler
|
|
|
83
94
|
end
|
|
84
95
|
|
|
85
96
|
def self.ensure_all_gems_in_lockfile!(names, locked_gems = Bundler.locked_gems)
|
|
97
|
+
return unless locked_gems
|
|
98
|
+
|
|
86
99
|
locked_names = locked_gems.specs.map(&:name).uniq
|
|
87
100
|
names.-(locked_names).each do |g|
|
|
88
101
|
raise GemNotFound, gem_not_found_message(g, locked_names)
|
|
@@ -61,7 +61,7 @@ module Bundler
|
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
def run
|
|
64
|
-
Bundler.ui.level = "
|
|
64
|
+
Bundler.ui.level = "warn" if options[:quiet]
|
|
65
65
|
Bundler.settings.validate!
|
|
66
66
|
check!
|
|
67
67
|
|
|
@@ -100,8 +100,11 @@ module Bundler
|
|
|
100
100
|
files_not_readable_or_writable = []
|
|
101
101
|
files_not_rw_and_owned_by_different_user = []
|
|
102
102
|
files_not_owned_by_current_user_but_still_rw = []
|
|
103
|
+
broken_symlinks = []
|
|
103
104
|
Find.find(Bundler.bundle_path.to_s).each do |f|
|
|
104
|
-
if !File.
|
|
105
|
+
if !File.exist?(f)
|
|
106
|
+
broken_symlinks << f
|
|
107
|
+
elsif !File.writable?(f) || !File.readable?(f)
|
|
105
108
|
if File.stat(f).uid != Process.uid
|
|
106
109
|
files_not_rw_and_owned_by_different_user << f
|
|
107
110
|
else
|
|
@@ -113,6 +116,13 @@ module Bundler
|
|
|
113
116
|
end
|
|
114
117
|
|
|
115
118
|
ok = true
|
|
119
|
+
|
|
120
|
+
if broken_symlinks.any?
|
|
121
|
+
Bundler.ui.warn "Broken links exist in the Bundler home. Please report them to the offending gem's upstream repo. These files are:\n - #{broken_symlinks.join("\n - ")}"
|
|
122
|
+
|
|
123
|
+
ok = false
|
|
124
|
+
end
|
|
125
|
+
|
|
116
126
|
if files_not_owned_by_current_user_but_still_rw.any?
|
|
117
127
|
Bundler.ui.warn "Files exist in the Bundler home that are owned by another " \
|
|
118
128
|
"user, but are still readable/writable. These files are:\n - #{files_not_owned_by_current_user_but_still_rw.join("\n - ")}"
|
|
@@ -12,12 +12,7 @@ module Bundler
|
|
|
12
12
|
@options = options
|
|
13
13
|
@cmd = args.shift
|
|
14
14
|
@args = args
|
|
15
|
-
|
|
16
|
-
if !Bundler.current_ruby.jruby?
|
|
17
|
-
@args << { :close_others => !options.keep_file_descriptors? }
|
|
18
|
-
elsif options.keep_file_descriptors?
|
|
19
|
-
Bundler.ui.warn "Ruby version #{RUBY_VERSION} defaults to keeping non-standard file descriptors on Kernel#exec."
|
|
20
|
-
end
|
|
15
|
+
@args << { :close_others => !options.keep_file_descriptors? } unless Bundler.current_ruby.jruby?
|
|
21
16
|
end
|
|
22
17
|
|
|
23
18
|
def run
|
|
@@ -42,9 +42,17 @@ module Bundler
|
|
|
42
42
|
use_git = Bundler.git_present? && options[:git]
|
|
43
43
|
|
|
44
44
|
git_author_name = use_git ? `git config user.name`.chomp : ""
|
|
45
|
-
|
|
45
|
+
git_username = use_git ? `git config github.user`.chomp : ""
|
|
46
46
|
git_user_email = use_git ? `git config user.email`.chomp : ""
|
|
47
47
|
|
|
48
|
+
github_username = if options[:github_username].nil?
|
|
49
|
+
git_username
|
|
50
|
+
elsif options[:github_username] == false
|
|
51
|
+
""
|
|
52
|
+
else
|
|
53
|
+
options[:github_username]
|
|
54
|
+
end
|
|
55
|
+
|
|
48
56
|
config = {
|
|
49
57
|
:name => name,
|
|
50
58
|
:underscored_name => underscored_name,
|
|
@@ -176,14 +184,15 @@ module Bundler
|
|
|
176
184
|
)
|
|
177
185
|
end
|
|
178
186
|
|
|
179
|
-
if
|
|
187
|
+
if target.exist? && !target.directory?
|
|
180
188
|
Bundler.ui.error "Couldn't create a new gem named `#{gem_name}` because there's an existing file named `#{gem_name}`."
|
|
181
189
|
exit Bundler::BundlerError.all_errors[Bundler::GenericSystemCallError]
|
|
182
190
|
end
|
|
183
191
|
|
|
184
192
|
if use_git
|
|
185
193
|
Bundler.ui.info "Initializing git repo in #{target}"
|
|
186
|
-
|
|
194
|
+
require "shellwords"
|
|
195
|
+
`git init #{target.to_s.shellescape}`
|
|
187
196
|
|
|
188
197
|
config[:git_default_branch] = File.read("#{target}/.git/HEAD").split("/").last.chomp
|
|
189
198
|
end
|
|
@@ -8,7 +8,7 @@ module Bundler
|
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def run
|
|
11
|
-
Bundler.ui.level = "
|
|
11
|
+
Bundler.ui.level = "warn" if options[:quiet]
|
|
12
12
|
|
|
13
13
|
warn_if_root
|
|
14
14
|
|
|
@@ -33,12 +33,8 @@ module Bundler
|
|
|
33
33
|
|
|
34
34
|
options[:local] = true if Bundler.app_cache.exist?
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
else
|
|
39
|
-
Bundler.settings.set_command_option :deployment, true if options[:deployment]
|
|
40
|
-
Bundler.settings.set_command_option :frozen, true if options[:frozen]
|
|
41
|
-
end
|
|
36
|
+
Bundler.settings.set_command_option :deployment, true if options[:deployment]
|
|
37
|
+
Bundler.settings.set_command_option :frozen, true if options[:frozen]
|
|
42
38
|
end
|
|
43
39
|
|
|
44
40
|
# When install is called with --no-deployment, disable deployment mode
|
|
@@ -62,7 +58,10 @@ module Bundler
|
|
|
62
58
|
definition.validate_runtime!
|
|
63
59
|
|
|
64
60
|
installer = Installer.install(Bundler.root, definition, options)
|
|
65
|
-
|
|
61
|
+
|
|
62
|
+
Bundler.settings.temporary(:cache_all_platforms => options[:local] ? false : Bundler.settings[:cache_all_platforms]) do
|
|
63
|
+
Bundler.load.cache(nil, options[:local]) if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle?
|
|
64
|
+
end
|
|
66
65
|
|
|
67
66
|
Bundler.ui.confirm "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}."
|
|
68
67
|
Bundler::CLI::Common.output_without_groups_message(:install)
|
|
@@ -84,28 +83,15 @@ module Bundler
|
|
|
84
83
|
end
|
|
85
84
|
|
|
86
85
|
Bundler::CLI::Common.output_fund_metadata_summary
|
|
87
|
-
rescue
|
|
88
|
-
if options[:local] && Bundler.app_cache.exist?
|
|
89
|
-
Bundler.ui.warn "Some gems seem to be missing from your #{Bundler.settings.app_cache_path} directory."
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
unless Bundler.definition.has_rubygems_remotes?
|
|
93
|
-
Bundler.ui.warn <<-WARN, :wrap => true
|
|
94
|
-
Your Gemfile has no gem server sources. If you need gems that are \
|
|
95
|
-
not already on your machine, add a line like this to your Gemfile:
|
|
96
|
-
source 'https://rubygems.org'
|
|
97
|
-
WARN
|
|
98
|
-
end
|
|
99
|
-
raise e
|
|
100
|
-
rescue Gem::InvalidSpecificationException => e
|
|
86
|
+
rescue Gem::InvalidSpecificationException
|
|
101
87
|
Bundler.ui.warn "You have one or more invalid gemspecs that need to be fixed."
|
|
102
|
-
raise
|
|
88
|
+
raise
|
|
103
89
|
end
|
|
104
90
|
|
|
105
91
|
private
|
|
106
92
|
|
|
107
93
|
def warn_if_root
|
|
108
|
-
return if Bundler.settings[:silence_root_warning] ||
|
|
94
|
+
return if Bundler.settings[:silence_root_warning] || Gem.win_platform? || !Process.uid.zero?
|
|
109
95
|
Bundler.ui.warn "Don't run Bundler as root. Bundler can ask for sudo " \
|
|
110
96
|
"if it is needed, and installing your bundle as root will break this " \
|
|
111
97
|
"application for all non-root users on this machine.", :wrap => true
|
|
@@ -16,7 +16,13 @@ module Bundler
|
|
|
16
16
|
specs = if @only_group.any? || @without_group.any?
|
|
17
17
|
filtered_specs_by_groups
|
|
18
18
|
else
|
|
19
|
-
|
|
19
|
+
begin
|
|
20
|
+
Bundler.load.specs
|
|
21
|
+
rescue GemNotFound => e
|
|
22
|
+
Bundler.ui.error e.message
|
|
23
|
+
Bundler.ui.warn "Install missing gems with `bundle install`."
|
|
24
|
+
exit 1
|
|
25
|
+
end
|
|
20
26
|
end.reject {|s| s.name == "bundler" }.sort_by(&:name)
|
|
21
27
|
|
|
22
28
|
return Bundler.ui.info "No gems in the Gemfile" if specs.empty?
|
|
@@ -21,9 +21,13 @@ module Bundler
|
|
|
21
21
|
Bundler::Fetcher.disable_endpoint = options["full-index"]
|
|
22
22
|
|
|
23
23
|
update = options[:update]
|
|
24
|
+
conservative = options[:conservative]
|
|
25
|
+
|
|
24
26
|
if update.is_a?(Array) # unlocking specific gems
|
|
25
27
|
Bundler::CLI::Common.ensure_all_gems_in_lockfile!(update)
|
|
26
|
-
update = { :gems => update, :
|
|
28
|
+
update = { :gems => update, :conservative => conservative }
|
|
29
|
+
elsif update
|
|
30
|
+
update = { :conservative => conservative } if conservative
|
|
27
31
|
end
|
|
28
32
|
definition = Bundler.definition(update)
|
|
29
33
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "shellwords"
|
|
4
|
-
|
|
5
3
|
module Bundler
|
|
6
4
|
class CLI::Open
|
|
7
5
|
attr_reader :options, :name
|
|
@@ -19,6 +17,7 @@ module Bundler
|
|
|
19
17
|
else
|
|
20
18
|
path = spec.full_gem_path
|
|
21
19
|
Dir.chdir(path) do
|
|
20
|
+
require "shellwords"
|
|
22
21
|
command = Shellwords.split(editor) + [path]
|
|
23
22
|
Bundler.with_original_env do
|
|
24
23
|
system(*command)
|
|
@@ -72,7 +72,7 @@ module Bundler
|
|
|
72
72
|
gemfile_specs + dependency_specs
|
|
73
73
|
end
|
|
74
74
|
|
|
75
|
-
specs.sort_by(&:name).each do |current_spec|
|
|
75
|
+
specs.sort_by(&:name).uniq(&:name).each do |current_spec|
|
|
76
76
|
next unless gems.empty? || gems.include?(current_spec.name)
|
|
77
77
|
|
|
78
78
|
active_spec = retrieve_active_spec(definition, current_spec)
|
|
@@ -146,17 +146,16 @@ module Bundler
|
|
|
146
146
|
end
|
|
147
147
|
|
|
148
148
|
def retrieve_active_spec(definition, current_spec)
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
else
|
|
152
|
-
active_specs = definition.find_indexed_specs(current_spec)
|
|
153
|
-
if !current_spec.version.prerelease? && !options[:pre] && active_specs.size > 1
|
|
154
|
-
active_specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
|
|
155
|
-
end
|
|
156
|
-
active_spec = active_specs.last
|
|
157
|
-
end
|
|
149
|
+
active_spec = definition.resolve.find_by_name_and_platform(current_spec.name, current_spec.platform)
|
|
150
|
+
return unless active_spec
|
|
158
151
|
|
|
159
|
-
active_spec
|
|
152
|
+
return active_spec if strict
|
|
153
|
+
|
|
154
|
+
active_specs = active_spec.source.specs.search(current_spec.name).select {|spec| spec.match_platform(current_spec.platform) }.sort_by(&:version)
|
|
155
|
+
if !current_spec.version.prerelease? && !options[:pre] && active_specs.size > 1
|
|
156
|
+
active_specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
|
|
157
|
+
end
|
|
158
|
+
active_specs.last
|
|
160
159
|
end
|
|
161
160
|
|
|
162
161
|
def print_gems(gems_list)
|
|
@@ -11,8 +11,7 @@ module Bundler
|
|
|
11
11
|
raise InvalidOption, "Please specify gems to remove." if @gems.empty?
|
|
12
12
|
|
|
13
13
|
Injector.remove(@gems, {})
|
|
14
|
-
|
|
15
|
-
Installer.install(Bundler.root, Bundler.definition) if @options["install"]
|
|
14
|
+
Installer.install(Bundler.root, Bundler.definition)
|
|
16
15
|
end
|
|
17
16
|
end
|
|
18
17
|
end
|
|
@@ -9,7 +9,7 @@ module Bundler
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def run
|
|
12
|
-
Bundler.ui.level = "
|
|
12
|
+
Bundler.ui.level = "warn" if options[:quiet]
|
|
13
13
|
|
|
14
14
|
Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
|
|
15
15
|
|
|
@@ -27,9 +27,14 @@ module Bundler
|
|
|
27
27
|
raise InvalidOption, "Cannot specify --all along with specific options."
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
+
conservative = options[:conservative]
|
|
31
|
+
|
|
30
32
|
if full_update
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
if conservative
|
|
34
|
+
Bundler.definition(:conservative => conservative)
|
|
35
|
+
else
|
|
36
|
+
Bundler.definition(true)
|
|
37
|
+
end
|
|
33
38
|
else
|
|
34
39
|
unless Bundler.default_lockfile.exist?
|
|
35
40
|
raise GemfileLockNotFound, "This Bundle hasn't been installed yet. " \
|
|
@@ -43,7 +48,7 @@ module Bundler
|
|
|
43
48
|
end
|
|
44
49
|
|
|
45
50
|
Bundler.definition(:gems => gems, :sources => sources, :ruby => options[:ruby],
|
|
46
|
-
:
|
|
51
|
+
:conservative => conservative,
|
|
47
52
|
:bundler => options[:bundler])
|
|
48
53
|
end
|
|
49
54
|
|
data/bundler/lib/bundler/cli.rb
CHANGED
|
@@ -14,6 +14,7 @@ module Bundler
|
|
|
14
14
|
COMMAND_ALIASES = {
|
|
15
15
|
"check" => "c",
|
|
16
16
|
"install" => "i",
|
|
17
|
+
"plugin" => "",
|
|
17
18
|
"list" => "ls",
|
|
18
19
|
"exec" => ["e", "ex", "exe"],
|
|
19
20
|
"cache" => ["package", "pack"],
|
|
@@ -72,14 +73,6 @@ module Bundler
|
|
|
72
73
|
Bundler.ui = UI::Shell.new(options)
|
|
73
74
|
Bundler.ui.level = "debug" if options["verbose"]
|
|
74
75
|
unprinted_warnings.each {|w| Bundler.ui.warn(w) }
|
|
75
|
-
|
|
76
|
-
if ENV["RUBYGEMS_GEMDEPS"] && !ENV["RUBYGEMS_GEMDEPS"].empty?
|
|
77
|
-
Bundler.ui.warn(
|
|
78
|
-
"The RUBYGEMS_GEMDEPS environment variable is set. This enables RubyGems' " \
|
|
79
|
-
"experimental Gemfile mode, which may conflict with Bundler and cause unexpected errors. " \
|
|
80
|
-
"To remove this warning, unset RUBYGEMS_GEMDEPS.", :wrap => true
|
|
81
|
-
)
|
|
82
|
-
end
|
|
83
76
|
end
|
|
84
77
|
|
|
85
78
|
check_unknown_options!(:except => [:config, :exec])
|
|
@@ -191,6 +184,7 @@ module Bundler
|
|
|
191
184
|
method_option "install", :type => :boolean, :banner =>
|
|
192
185
|
"Runs 'bundle install' after removing the gems from the Gemfile"
|
|
193
186
|
def remove(*gems)
|
|
187
|
+
SharedHelpers.major_deprecation(2, "The `--install` flag has been deprecated. `bundle install` is triggered by default.") if ARGV.include?("--install")
|
|
194
188
|
require_relative "cli/remove"
|
|
195
189
|
Remove.new(gems, options).run
|
|
196
190
|
end
|
|
@@ -308,39 +302,19 @@ module Bundler
|
|
|
308
302
|
end
|
|
309
303
|
end
|
|
310
304
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
if flag = rest.find{|arg| ["--verbose", "--outdated"].include?(arg) }
|
|
326
|
-
Bundler::SharedHelpers.major_deprecation(2, "the `#{flag}` flag to `bundle show` was undocumented and will be removed without replacement")
|
|
327
|
-
else
|
|
328
|
-
new_command = rest.find {|arg| !arg.start_with?("--") } ? "info" : "list"
|
|
329
|
-
|
|
330
|
-
new_arguments = rest.map do |arg|
|
|
331
|
-
next arg if arg != "--paths"
|
|
332
|
-
next "--path" if new_command == "info"
|
|
333
|
-
end
|
|
334
|
-
|
|
335
|
-
old_argv = ARGV.join(" ")
|
|
336
|
-
new_argv = [new_command, *new_arguments.compact].join(" ")
|
|
337
|
-
|
|
338
|
-
Bundler::SharedHelpers.major_deprecation(2, "use `bundle #{new_argv}` instead of `bundle #{old_argv}`")
|
|
339
|
-
end
|
|
340
|
-
end
|
|
341
|
-
require_relative "cli/show"
|
|
342
|
-
Show.new(options, gem_name).run
|
|
343
|
-
end
|
|
305
|
+
desc "show GEM [OPTIONS]", "Shows all gems that are part of the bundle, or the path to a given gem"
|
|
306
|
+
long_desc <<-D
|
|
307
|
+
Show lists the names and versions of all gems that are required by your Gemfile.
|
|
308
|
+
Calling show with [GEM] will list the exact location of that gem on your machine.
|
|
309
|
+
D
|
|
310
|
+
method_option "paths", :type => :boolean,
|
|
311
|
+
:banner => "List the paths of all gems that are required by your Gemfile."
|
|
312
|
+
method_option "outdated", :type => :boolean,
|
|
313
|
+
:banner => "Show verbose output including whether gems are outdated."
|
|
314
|
+
def show(gem_name = nil)
|
|
315
|
+
SharedHelpers.major_deprecation(2, "the `--outdated` flag to `bundle show` was undocumented and will be removed without replacement") if ARGV.include?("--outdated")
|
|
316
|
+
require_relative "cli/show"
|
|
317
|
+
Show.new(options, gem_name).run
|
|
344
318
|
end
|
|
345
319
|
|
|
346
320
|
desc "list", "List all gems in the bundle"
|
|
@@ -475,6 +449,12 @@ module Bundler
|
|
|
475
449
|
"do in future versions. Instead please use `bundle config set cache_all true`, " \
|
|
476
450
|
"and stop using this flag" if ARGV.include?("--all")
|
|
477
451
|
|
|
452
|
+
SharedHelpers.major_deprecation 2,
|
|
453
|
+
"The `--path` flag is deprecated because its semantics are unclear. " \
|
|
454
|
+
"Use `bundle config cache_path` to configure the path of your cache of gems, " \
|
|
455
|
+
"and `bundle config path` to configure the path where your gems are installed, " \
|
|
456
|
+
"and stop using this flag" if ARGV.include?("--path")
|
|
457
|
+
|
|
478
458
|
require_relative "cli/cache"
|
|
479
459
|
Cache.new(options).run
|
|
480
460
|
end
|
|
@@ -482,7 +462,7 @@ module Bundler
|
|
|
482
462
|
map aliases_for("cache")
|
|
483
463
|
|
|
484
464
|
desc "exec [OPTIONS]", "Run the command in context of the bundle"
|
|
485
|
-
method_option :keep_file_descriptors, :type => :boolean, :default =>
|
|
465
|
+
method_option :keep_file_descriptors, :type => :boolean, :default => true
|
|
486
466
|
method_option :gemfile, :type => :string, :required => false
|
|
487
467
|
long_desc <<-D
|
|
488
468
|
Exec runs a command, providing it access to the gems in the bundle. While using
|
|
@@ -490,6 +470,10 @@ module Bundler
|
|
|
490
470
|
into the system wide RubyGems repository.
|
|
491
471
|
D
|
|
492
472
|
def exec(*args)
|
|
473
|
+
if ARGV.include?("--no-keep-file-descriptors")
|
|
474
|
+
SharedHelpers.major_deprecation(2, "The `--no-keep-file-descriptors` has been deprecated. `bundle exec` no longer mess with your file descriptors. Close them in the exec'd script if you need to")
|
|
475
|
+
end
|
|
476
|
+
|
|
493
477
|
require_relative "cli/exec"
|
|
494
478
|
Exec.new(options, args).run
|
|
495
479
|
end
|
|
@@ -504,8 +488,8 @@ module Bundler
|
|
|
504
488
|
By default, setting a configuration value sets it for all projects
|
|
505
489
|
on the machine.
|
|
506
490
|
|
|
507
|
-
If a global setting is
|
|
508
|
-
will show the current value, as well as any
|
|
491
|
+
If a global setting is superseded by local configuration, this command
|
|
492
|
+
will show the current value, as well as any superseded values and
|
|
509
493
|
where they were specified.
|
|
510
494
|
D
|
|
511
495
|
require_relative "cli/config"
|
|
@@ -591,6 +575,7 @@ module Bundler
|
|
|
591
575
|
:desc => "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`."
|
|
592
576
|
method_option :ci, :type => :string, :lazy_default => Bundler.settings["gem.ci"] || "",
|
|
593
577
|
:desc => "Generate CI configuration, either GitHub Actions, Travis CI, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|travis|gitlab|circle)`"
|
|
578
|
+
method_option :github_username, :type => :string, :default => Bundler.settings["gem.github_username"], :banner => "Set your username on GitHub", :desc => "Fill in GitHub username on README so that you don't have to do it manually. Set a default with `bundle config set --global gem.github_username <your_username>`."
|
|
594
579
|
|
|
595
580
|
def gem(name)
|
|
596
581
|
end
|
|
@@ -50,16 +50,20 @@ module Bundler
|
|
|
50
50
|
|
|
51
51
|
content = response.body
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
etag = (response["ETag"] || "").gsub(%r{\AW/}, "")
|
|
54
|
+
correct_response = SharedHelpers.filesystem_access(local_temp_path) do
|
|
54
55
|
if response.is_a?(Net::HTTPPartialContent) && local_temp_path.size.nonzero?
|
|
55
56
|
local_temp_path.open("a") {|f| f << slice_body(content, 1..-1) }
|
|
57
|
+
|
|
58
|
+
etag_for(local_temp_path) == etag
|
|
56
59
|
else
|
|
57
60
|
local_temp_path.open("wb") {|f| f << content }
|
|
61
|
+
|
|
62
|
+
etag.length.zero? || etag_for(local_temp_path) == etag
|
|
58
63
|
end
|
|
59
64
|
end
|
|
60
65
|
|
|
61
|
-
|
|
62
|
-
if etag.length.zero? || etag_for(local_temp_path) == etag
|
|
66
|
+
if correct_response
|
|
63
67
|
SharedHelpers.filesystem_access(local_path) do
|
|
64
68
|
FileUtils.mv(local_temp_path, local_path)
|
|
65
69
|
end
|
|
@@ -92,11 +96,11 @@ module Bundler
|
|
|
92
96
|
|
|
93
97
|
def checksum_for_file(path)
|
|
94
98
|
return nil unless path.file?
|
|
95
|
-
# This must use
|
|
99
|
+
# This must use File.read instead of Digest.file().hexdigest
|
|
96
100
|
# because we need to preserve \n line endings on windows when calculating
|
|
97
101
|
# the checksum
|
|
98
102
|
SharedHelpers.filesystem_access(path, :read) do
|
|
99
|
-
SharedHelpers.digest(:MD5).hexdigest(
|
|
103
|
+
SharedHelpers.digest(:MD5).hexdigest(File.read(path))
|
|
100
104
|
end
|
|
101
105
|
end
|
|
102
106
|
end
|
|
@@ -20,6 +20,7 @@ module Bundler
|
|
|
20
20
|
2.5
|
|
21
21
|
2.6
|
|
22
22
|
2.7
|
|
23
|
+
3.0
|
|
23
24
|
].freeze
|
|
24
25
|
|
|
25
26
|
KNOWN_MAJOR_VERSIONS = KNOWN_MINOR_VERSIONS.map {|v| v.split(".", 2).first }.uniq.freeze
|
|
@@ -64,19 +65,19 @@ module Bundler
|
|
|
64
65
|
end
|
|
65
66
|
|
|
66
67
|
def mswin?
|
|
67
|
-
|
|
68
|
+
Gem.win_platform?
|
|
68
69
|
end
|
|
69
70
|
|
|
70
71
|
def mswin64?
|
|
71
|
-
|
|
72
|
+
Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mswin64" && Bundler.local_platform.cpu == "x64"
|
|
72
73
|
end
|
|
73
74
|
|
|
74
75
|
def mingw?
|
|
75
|
-
|
|
76
|
+
Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu != "x64"
|
|
76
77
|
end
|
|
77
78
|
|
|
78
79
|
def x64_mingw?
|
|
79
|
-
|
|
80
|
+
Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu == "x64"
|
|
80
81
|
end
|
|
81
82
|
|
|
82
83
|
(KNOWN_MINOR_VERSIONS + KNOWN_MAJOR_VERSIONS).each do |version|
|