rubygems-update 2.6.3 → 2.7.7
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rubygems-update might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/.travis.yml +17 -34
- data/CODE_OF_CONDUCT.md +36 -33
- data/CONTRIBUTING.rdoc +56 -55
- data/History.txt +467 -10
- data/Manifest.txt +276 -4
- data/POLICIES.rdoc +4 -4
- data/README.md +72 -0
- data/Rakefile +77 -10
- data/appveyor.yml +61 -31
- data/bin/gem +1 -1
- data/bin/update_rubygems +2 -2
- data/bundler/CHANGELOG.md +2910 -0
- data/bundler/CODE_OF_CONDUCT.md +42 -0
- data/bundler/CONTRIBUTING.md +17 -0
- data/bundler/LICENSE.md +23 -0
- data/bundler/README.md +63 -0
- data/bundler/bundler.gemspec +57 -0
- data/bundler/exe/bundle +31 -0
- data/bundler/exe/bundle_ruby +60 -0
- data/bundler/exe/bundler +4 -0
- data/bundler/lib/bundler/build_metadata.rb +36 -0
- data/bundler/lib/bundler/capistrano.rb +22 -0
- data/bundler/lib/bundler/cli/add.rb +25 -0
- data/bundler/lib/bundler/cli/binstubs.rb +43 -0
- data/bundler/lib/bundler/cli/cache.rb +36 -0
- data/bundler/lib/bundler/cli/check.rb +38 -0
- data/bundler/lib/bundler/cli/clean.rb +25 -0
- data/bundler/lib/bundler/cli/common.rb +102 -0
- data/bundler/lib/bundler/cli/config.rb +119 -0
- data/bundler/lib/bundler/cli/console.rb +43 -0
- data/bundler/lib/bundler/cli/doctor.rb +94 -0
- data/bundler/lib/bundler/cli/exec.rb +104 -0
- data/bundler/lib/bundler/cli/gem.rb +252 -0
- data/bundler/lib/bundler/cli/info.rb +50 -0
- data/bundler/lib/bundler/cli/init.rb +47 -0
- data/bundler/lib/bundler/cli/inject.rb +60 -0
- data/bundler/lib/bundler/cli/install.rb +214 -0
- data/bundler/lib/bundler/cli/issue.rb +40 -0
- data/bundler/lib/bundler/cli/list.rb +22 -0
- data/bundler/lib/bundler/cli/lock.rb +63 -0
- data/bundler/lib/bundler/cli/open.rb +26 -0
- data/bundler/lib/bundler/cli/outdated.rb +260 -0
- data/bundler/lib/bundler/cli/package.rb +49 -0
- data/bundler/lib/bundler/cli/platform.rb +46 -0
- data/bundler/lib/bundler/cli/plugin.rb +24 -0
- data/bundler/lib/bundler/cli/pristine.rb +43 -0
- data/bundler/lib/bundler/cli/show.rb +75 -0
- data/bundler/lib/bundler/cli/update.rb +91 -0
- data/bundler/lib/bundler/cli/viz.rb +31 -0
- data/bundler/lib/bundler/cli.rb +748 -0
- data/bundler/lib/bundler/compact_index_client/cache.rb +118 -0
- data/bundler/lib/bundler/compact_index_client/updater.rb +116 -0
- data/bundler/lib/bundler/compact_index_client.rb +109 -0
- data/bundler/lib/bundler/compatibility_guard.rb +14 -0
- data/bundler/lib/bundler/constants.rb +7 -0
- data/bundler/lib/bundler/current_ruby.rb +86 -0
- data/bundler/lib/bundler/definition.rb +989 -0
- data/bundler/lib/bundler/dep_proxy.rb +48 -0
- data/bundler/lib/bundler/dependency.rb +138 -0
- data/bundler/lib/bundler/deployment.rb +69 -0
- data/bundler/lib/bundler/deprecate.rb +43 -0
- data/bundler/lib/bundler/dsl.rb +599 -0
- data/bundler/lib/bundler/endpoint_specification.rb +141 -0
- data/bundler/lib/bundler/env.rb +153 -0
- data/bundler/lib/bundler/environment_preserver.rb +59 -0
- data/bundler/lib/bundler/errors.rb +158 -0
- data/bundler/lib/bundler/feature_flag.rb +67 -0
- data/bundler/lib/bundler/fetcher/base.rb +52 -0
- data/bundler/lib/bundler/fetcher/compact_index.rb +126 -0
- data/bundler/lib/bundler/fetcher/dependency.rb +82 -0
- data/bundler/lib/bundler/fetcher/downloader.rb +79 -0
- data/bundler/lib/bundler/fetcher/index.rb +52 -0
- data/bundler/lib/bundler/fetcher.rb +312 -0
- data/bundler/lib/bundler/friendly_errors.rb +131 -0
- data/bundler/lib/bundler/gem_helper.rb +202 -0
- data/bundler/lib/bundler/gem_helpers.rb +101 -0
- data/bundler/lib/bundler/gem_remote_fetcher.rb +43 -0
- data/bundler/lib/bundler/gem_tasks.rb +7 -0
- data/bundler/lib/bundler/gem_version_promoter.rb +176 -0
- data/bundler/lib/bundler/gemdeps.rb +29 -0
- data/bundler/lib/bundler/graph.rb +152 -0
- data/bundler/lib/bundler/index.rb +213 -0
- data/bundler/lib/bundler/injector.rb +94 -0
- data/bundler/lib/bundler/inline.rb +74 -0
- data/bundler/lib/bundler/installer/gem_installer.rb +83 -0
- data/bundler/lib/bundler/installer/parallel_installer.rb +228 -0
- data/bundler/lib/bundler/installer/standalone.rb +53 -0
- data/bundler/lib/bundler/installer.rb +295 -0
- data/bundler/lib/bundler/lazy_specification.rb +123 -0
- data/bundler/lib/bundler/lockfile_generator.rb +95 -0
- data/bundler/lib/bundler/lockfile_parser.rb +256 -0
- data/bundler/lib/bundler/match_platform.rb +24 -0
- data/bundler/lib/bundler/mirror.rb +223 -0
- data/bundler/lib/bundler/plugin/api/source.rb +306 -0
- data/bundler/lib/bundler/plugin/api.rb +81 -0
- data/bundler/lib/bundler/plugin/dsl.rb +53 -0
- data/bundler/lib/bundler/plugin/index.rb +162 -0
- data/bundler/lib/bundler/plugin/installer/git.rb +38 -0
- data/bundler/lib/bundler/plugin/installer/rubygems.rb +27 -0
- data/bundler/lib/bundler/plugin/installer.rb +96 -0
- data/bundler/lib/bundler/plugin/source_list.rb +27 -0
- data/bundler/lib/bundler/plugin.rb +285 -0
- data/bundler/lib/bundler/process_lock.rb +24 -0
- data/bundler/lib/bundler/psyched_yaml.rb +37 -0
- data/bundler/lib/bundler/remote_specification.rb +114 -0
- data/bundler/lib/bundler/resolver/spec_group.rb +110 -0
- data/bundler/lib/bundler/resolver.rb +372 -0
- data/bundler/lib/bundler/retry.rb +66 -0
- data/bundler/lib/bundler/ruby_dsl.rb +18 -0
- data/bundler/lib/bundler/ruby_version.rb +152 -0
- data/bundler/lib/bundler/rubygems_ext.rb +210 -0
- data/bundler/lib/bundler/rubygems_gem_installer.rb +99 -0
- data/bundler/lib/bundler/rubygems_integration.rb +898 -0
- data/bundler/lib/bundler/runtime.rb +316 -0
- data/bundler/lib/bundler/settings/validator.rb +79 -0
- data/bundler/lib/bundler/settings.rb +442 -0
- data/bundler/lib/bundler/setup.rb +28 -0
- data/bundler/lib/bundler/shared_helpers.rb +356 -0
- data/bundler/lib/bundler/similarity_detector.rb +63 -0
- data/bundler/lib/bundler/source/gemspec.rb +18 -0
- data/bundler/lib/bundler/source/git/git_proxy.rb +262 -0
- data/bundler/lib/bundler/source/git.rb +329 -0
- data/bundler/lib/bundler/source/metadata.rb +63 -0
- data/bundler/lib/bundler/source/path/installer.rb +74 -0
- data/bundler/lib/bundler/source/path.rb +249 -0
- data/bundler/lib/bundler/source/rubygems/remote.rb +66 -0
- data/bundler/lib/bundler/source/rubygems.rb +535 -0
- data/bundler/lib/bundler/source.rb +94 -0
- data/bundler/lib/bundler/source_list.rb +186 -0
- data/bundler/lib/bundler/spec_set.rb +192 -0
- data/bundler/lib/bundler/ssl_certs/.document +1 -0
- data/bundler/lib/bundler/ssl_certs/certificate_manager.rb +66 -0
- data/bundler/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +21 -0
- data/bundler/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +23 -0
- data/bundler/lib/bundler/stub_specification.rb +108 -0
- data/bundler/lib/bundler/templates/.document +1 -0
- data/bundler/lib/bundler/templates/Executable +29 -0
- data/bundler/lib/bundler/templates/Executable.bundler +105 -0
- data/bundler/lib/bundler/templates/Executable.standalone +14 -0
- data/bundler/lib/bundler/templates/Gemfile +7 -0
- data/bundler/lib/bundler/templates/gems.rb +8 -0
- data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +74 -0
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +6 -0
- data/bundler/lib/bundler/templates/newgem/LICENSE.txt.tt +21 -0
- data/bundler/lib/bundler/templates/newgem/README.md.tt +47 -0
- data/bundler/lib/bundler/templates/newgem/Rakefile.tt +29 -0
- data/bundler/lib/bundler/templates/newgem/bin/console.tt +14 -0
- data/bundler/lib/bundler/templates/newgem/bin/setup.tt +8 -0
- data/bundler/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +9 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +6 -0
- data/bundler/lib/bundler/templates/newgem/gitignore.tt +20 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +12 -0
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +51 -0
- data/bundler/lib/bundler/templates/newgem/rspec.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +9 -0
- data/bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +14 -0
- data/bundler/lib/bundler/templates/newgem/test/newgem_test.rb.tt +11 -0
- data/bundler/lib/bundler/templates/newgem/test/test_helper.rb.tt +4 -0
- data/bundler/lib/bundler/templates/newgem/travis.yml.tt +5 -0
- data/bundler/lib/bundler/ui/rg_proxy.rb +19 -0
- data/bundler/lib/bundler/ui/shell.rb +146 -0
- data/bundler/lib/bundler/ui/silent.rb +69 -0
- data/bundler/lib/bundler/ui.rb +9 -0
- data/bundler/lib/bundler/uri_credentials_filter.rb +37 -0
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +1638 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +26 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +81 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +36 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +66 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +62 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +63 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +61 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +126 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +46 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +36 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +126 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +223 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +138 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +6 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +101 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +67 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +837 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +46 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +58 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +12 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb +27 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb +129 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1233 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +104 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +60 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +118 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +143 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +364 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +109 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +321 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +679 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/command.rb +135 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +97 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +12 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +129 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +32 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +281 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb +177 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +37 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +88 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor.rb +17 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +70 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +175 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +146 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +221 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +71 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +324 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +437 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +149 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +126 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell.rb +81 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +268 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +3 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +509 -0
- data/bundler/lib/bundler/vendored_fileutils.rb +9 -0
- data/bundler/lib/bundler/vendored_molinillo.rb +4 -0
- data/bundler/lib/bundler/vendored_persistent.rb +52 -0
- data/bundler/lib/bundler/vendored_thor.rb +8 -0
- data/bundler/lib/bundler/version.rb +28 -0
- data/bundler/lib/bundler/version_ranges.rb +76 -0
- data/bundler/lib/bundler/vlad.rb +17 -0
- data/bundler/lib/bundler/worker.rb +106 -0
- data/bundler/lib/bundler/yaml_serializer.rb +90 -0
- data/bundler/lib/bundler.rb +545 -0
- data/bundler/man/bundle-add.ronn +29 -0
- data/bundler/man/bundle-binstubs.ronn +43 -0
- data/bundler/man/bundle-check.ronn +26 -0
- data/bundler/man/bundle-clean.ronn +18 -0
- data/bundler/man/bundle-config.ronn +376 -0
- data/bundler/man/bundle-doctor.ronn +33 -0
- data/bundler/man/bundle-exec.ronn +152 -0
- data/bundler/man/bundle-gem.ronn +78 -0
- data/bundler/man/bundle-info.ronn +17 -0
- data/bundler/man/bundle-init.ronn +29 -0
- data/bundler/man/bundle-inject.ronn +22 -0
- data/bundler/man/bundle-install.ronn +369 -0
- data/bundler/man/bundle-list.ronn +15 -0
- data/bundler/man/bundle-lock.ronn +94 -0
- data/bundler/man/bundle-open.ronn +19 -0
- data/bundler/man/bundle-outdated.ronn +107 -0
- data/bundler/man/bundle-package.ronn +72 -0
- data/bundler/man/bundle-platform.ronn +42 -0
- data/bundler/man/bundle-pristine.ronn +34 -0
- data/bundler/man/bundle-show.ronn +20 -0
- data/bundler/man/bundle-update.ronn +346 -0
- data/bundler/man/bundle-viz.ronn +30 -0
- data/bundler/man/bundle.ronn +108 -0
- data/bundler/man/gemfile.5.ronn +506 -0
- data/lib/rubygems/basic_specification.rb +8 -4
- data/lib/rubygems/bundler_version_finder.rb +116 -0
- data/lib/rubygems/command.rb +10 -2
- data/lib/rubygems/command_manager.rb +3 -1
- data/lib/rubygems/commands/cert_command.rb +31 -6
- data/lib/rubygems/commands/cleanup_command.rb +10 -3
- data/lib/rubygems/commands/generate_index_command.rb +1 -1
- data/lib/rubygems/commands/help_command.rb +1 -1
- data/lib/rubygems/commands/open_command.rb +1 -1
- data/lib/rubygems/commands/owner_command.rb +4 -2
- data/lib/rubygems/commands/pristine_command.rb +11 -8
- data/lib/rubygems/commands/push_command.rb +3 -2
- data/lib/rubygems/commands/query_command.rb +17 -17
- data/lib/rubygems/commands/setup_command.rb +175 -70
- data/lib/rubygems/commands/signin_command.rb +33 -0
- data/lib/rubygems/commands/signout_command.rb +33 -0
- data/lib/rubygems/commands/sources_command.rb +1 -1
- data/lib/rubygems/commands/uninstall_command.rb +4 -3
- data/lib/rubygems/commands/unpack_command.rb +19 -7
- data/lib/rubygems/commands/update_command.rb +2 -2
- data/lib/rubygems/commands/which_command.rb +1 -1
- data/lib/rubygems/commands/yank_command.rb +4 -11
- data/lib/rubygems/config_file.rb +21 -28
- data/lib/rubygems/core_ext/kernel_require.rb +10 -9
- data/lib/rubygems/defaults.rb +18 -0
- data/lib/rubygems/dependency.rb +10 -4
- data/lib/rubygems/dependency_installer.rb +8 -2
- data/lib/rubygems/dependency_list.rb +1 -1
- data/lib/rubygems/errors.rb +4 -0
- data/lib/rubygems/exceptions.rb +11 -1
- data/lib/rubygems/ext/builder.rb +2 -2
- data/lib/rubygems/ext/ext_conf_builder.rb +7 -7
- data/lib/rubygems/ext/rake_builder.rb +2 -2
- data/lib/rubygems/gem_runner.rb +5 -1
- data/lib/rubygems/indexer.rb +6 -5
- data/lib/rubygems/install_update_options.rb +5 -28
- data/lib/rubygems/installer.rb +53 -22
- data/lib/rubygems/installer_test_case.rb +6 -3
- data/lib/rubygems/package/file_source.rb +2 -2
- data/lib/rubygems/package/old.rb +3 -3
- data/lib/rubygems/package/tar_header.rb +14 -9
- data/lib/rubygems/package/tar_writer.rb +12 -16
- data/lib/rubygems/package.rb +48 -9
- data/lib/rubygems/platform.rb +1 -1
- data/lib/rubygems/remote_fetcher.rb +13 -18
- data/lib/rubygems/request.rb +47 -1
- data/lib/rubygems/request_set/gem_dependency_api.rb +3 -3
- 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 +22 -3
- data/lib/rubygems/requirement.rb +5 -1
- data/lib/rubygems/resolver/installer_set.rb +4 -6
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +50 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb +80 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb +35 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +65 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +61 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +62 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +60 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb +125 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb +45 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb +35 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +125 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +78 -147
- data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +110 -75
- data/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb +4 -2
- data/lib/rubygems/resolver/set.rb +1 -1
- data/lib/rubygems/resolver.rb +61 -5
- data/lib/rubygems/safe_yaml.rb +51 -0
- data/lib/rubygems/security/signer.rb +2 -0
- data/lib/rubygems/security/trust_dir.rb +1 -1
- data/lib/rubygems/security.rb +12 -5
- data/lib/rubygems/security_option.rb +43 -0
- data/lib/rubygems/server.rb +49 -40
- data/lib/rubygems/source/git.rb +2 -1
- data/lib/rubygems/source/local.rb +38 -35
- data/lib/rubygems/source/lock.rb +4 -1
- data/lib/rubygems/source.rb +9 -6
- data/lib/rubygems/source_local.rb +3 -1
- data/lib/rubygems/source_specific_file.rb +3 -2
- data/lib/rubygems/spec_fetcher.rb +7 -3
- data/lib/rubygems/specification.rb +317 -251
- data/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +21 -0
- data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +25 -0
- data/lib/rubygems/stub_specification.rb +10 -4
- data/lib/rubygems/test_case.rb +51 -11
- data/lib/rubygems/test_utilities.rb +2 -2
- data/lib/rubygems/text.rb +14 -1
- data/lib/rubygems/user_interaction.rb +22 -20
- data/lib/rubygems/util/licenses.rb +37 -0
- data/lib/rubygems/util.rb +6 -16
- data/lib/rubygems/validator.rb +3 -3
- data/lib/rubygems/version.rb +24 -5
- data/lib/rubygems/version_option.rb +6 -1
- data/lib/rubygems.rb +147 -45
- data/lib/ubygems.rb +3 -0
- data/setup.rb +1 -1
- data/test/rubygems/alternate_cert.pem +10 -9
- data/test/rubygems/alternate_cert_32.pem +10 -9
- data/test/rubygems/child_cert.pem +11 -9
- data/test/rubygems/child_cert_32.pem +11 -9
- data/test/rubygems/encrypted_private_key.pem +26 -26
- data/test/rubygems/expired_cert.pem +9 -8
- data/test/rubygems/future_cert.pem +9 -8
- data/test/rubygems/future_cert_32.pem +9 -8
- data/test/rubygems/grandchild_cert.pem +11 -9
- data/test/rubygems/grandchild_cert_32.pem +11 -9
- data/test/rubygems/invalid_issuer_cert.pem +11 -9
- data/test/rubygems/invalid_issuer_cert_32.pem +11 -9
- data/test/rubygems/invalid_signer_cert.pem +10 -9
- data/test/rubygems/invalid_signer_cert_32.pem +10 -9
- data/test/rubygems/invalidchild_cert.pem +11 -9
- data/test/rubygems/invalidchild_cert_32.pem +11 -9
- data/test/rubygems/private3072_key.pem +40 -0
- data/test/rubygems/public3072_cert.pem +25 -0
- data/test/rubygems/public_cert.pem +11 -9
- data/test/rubygems/public_cert_32.pem +10 -9
- data/test/rubygems/rubygems_plugin.rb +4 -0
- data/test/rubygems/test_bundled_ca.rb +1 -1
- data/test/rubygems/test_config.rb +1 -1
- data/test/rubygems/test_gem.rb +168 -55
- data/test/rubygems/test_gem_bundler_version_finder.rb +125 -0
- data/test/rubygems/test_gem_command.rb +7 -1
- data/test/rubygems/test_gem_commands_build_command.rb +27 -1
- data/test/rubygems/test_gem_commands_cert_command.rb +64 -0
- data/test/rubygems/test_gem_commands_cleanup_command.rb +44 -1
- data/test/rubygems/test_gem_commands_install_command.rb +36 -2
- data/test/rubygems/test_gem_commands_open_command.rb +2 -1
- data/test/rubygems/test_gem_commands_owner_command.rb +25 -0
- data/test/rubygems/test_gem_commands_pristine_command.rb +1 -1
- data/test/rubygems/test_gem_commands_push_command.rb +5 -5
- data/test/rubygems/test_gem_commands_query_command.rb +154 -1
- data/test/rubygems/test_gem_commands_setup_command.rb +140 -10
- data/test/rubygems/test_gem_commands_signin_command.rb +98 -0
- data/test/rubygems/test_gem_commands_signout_command.rb +37 -0
- data/test/rubygems/test_gem_commands_sources_command.rb +52 -0
- data/test/rubygems/test_gem_commands_uninstall_command.rb +14 -2
- data/test/rubygems/test_gem_commands_update_command.rb +1 -7
- data/test/rubygems/test_gem_commands_which_command.rb +3 -3
- data/test/rubygems/test_gem_config_file.rb +1 -2
- data/test/rubygems/test_gem_dependency.rb +28 -0
- data/test/rubygems/test_gem_dependency_installer.rb +1 -1
- data/test/rubygems/test_gem_doctor.rb +2 -2
- data/test/rubygems/test_gem_ext_builder.rb +8 -8
- data/test/rubygems/test_gem_ext_configure_builder.rb +1 -1
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +23 -0
- data/test/rubygems/test_gem_ext_rake_builder.rb +33 -16
- data/test/rubygems/test_gem_gemcutter_utilities.rb +4 -4
- data/test/rubygems/test_gem_indexer.rb +1 -2
- data/test/rubygems/test_gem_install_update_options.rb +4 -1
- data/test/rubygems/test_gem_installer.rb +230 -32
- data/test/rubygems/test_gem_package.rb +156 -29
- data/test/rubygems/test_gem_package_old.rb +1 -1
- data/test/rubygems/test_gem_package_tar_header.rb +21 -0
- data/test/rubygems/test_gem_package_tar_writer.rb +24 -0
- data/test/rubygems/test_gem_rdoc.rb +2 -0
- data/test/rubygems/test_gem_remote_fetcher.rb +38 -19
- data/test/rubygems/test_gem_request.rb +132 -0
- data/test/rubygems/test_gem_request_connection_pools.rb +6 -7
- data/test/rubygems/test_gem_request_set.rb +7 -7
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +3 -3
- data/test/rubygems/test_gem_request_set_lockfile.rb +4 -4
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +1 -1
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +1 -1
- data/test/rubygems/test_gem_requirement.rb +6 -0
- data/test/rubygems/test_gem_resolver.rb +29 -3
- data/test/rubygems/test_gem_resolver_conflict.rb +1 -1
- data/test/rubygems/test_gem_resolver_git_specification.rb +1 -1
- data/test/rubygems/test_gem_security.rb +5 -0
- data/test/rubygems/test_gem_security_policy.rb +27 -27
- data/test/rubygems/test_gem_security_signer.rb +14 -6
- data/test/rubygems/test_gem_security_trust_dir.rb +2 -2
- data/test/rubygems/test_gem_server.rb +210 -12
- data/test/rubygems/test_gem_source.rb +12 -3
- data/test/rubygems/test_gem_source_fetch_problem.rb +8 -0
- data/test/rubygems/test_gem_source_git.rb +1 -1
- data/test/rubygems/test_gem_spec_fetcher.rb +20 -0
- data/test/rubygems/test_gem_specification.rb +163 -32
- data/test/rubygems/test_gem_stream_ui.rb +6 -6
- data/test/rubygems/test_gem_stub_specification.rb +85 -6
- data/test/rubygems/test_gem_text.rb +11 -0
- data/test/rubygems/test_gem_util.rb +26 -0
- data/test/rubygems/test_gem_version.rb +46 -7
- data/test/rubygems/test_gem_version_option.rb +15 -0
- data/test/rubygems/test_kernel.rb +30 -0
- data/test/rubygems/test_remote_fetch_error.rb +21 -0
- data/test/rubygems/test_require.rb +95 -21
- data/test/rubygems/wrong_key_cert.pem +10 -9
- data/test/rubygems/wrong_key_cert_32.pem +10 -9
- data/util/ci +74 -0
- data/util/create_certs.rb +64 -49
- data/util/generate_spdx_license_list.rb +2 -1
- data/util/patch_with_prs.rb +77 -0
- data/util/update_bundled_ca_certificates.rb +23 -2
- data/util/update_changelog.rb +67 -0
- metadata +301 -48
- data/README.rdoc +0 -54
- data/lib/gauntlet_rubygems.rb +0 -51
- data/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRoot.pem +0 -18
- /data/{lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot-2048.pem → bundler/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem} +0 -0
@@ -0,0 +1,260 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class CLI::Outdated
|
5
|
+
attr_reader :options, :gems
|
6
|
+
|
7
|
+
def initialize(options, gems)
|
8
|
+
@options = options
|
9
|
+
@gems = gems
|
10
|
+
end
|
11
|
+
|
12
|
+
def run
|
13
|
+
check_for_deployment_mode
|
14
|
+
|
15
|
+
sources = Array(options[:source])
|
16
|
+
|
17
|
+
gems.each do |gem_name|
|
18
|
+
Bundler::CLI::Common.select_spec(gem_name)
|
19
|
+
end
|
20
|
+
|
21
|
+
Bundler.definition.validate_runtime!
|
22
|
+
current_specs = Bundler.ui.silence { Bundler.definition.resolve }
|
23
|
+
current_dependencies = {}
|
24
|
+
Bundler.ui.silence do
|
25
|
+
Bundler.load.dependencies.each do |dep|
|
26
|
+
current_dependencies[dep.name] = dep
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
definition = if gems.empty? && sources.empty?
|
31
|
+
# We're doing a full update
|
32
|
+
Bundler.definition(true)
|
33
|
+
else
|
34
|
+
Bundler.definition(:gems => gems, :sources => sources)
|
35
|
+
end
|
36
|
+
|
37
|
+
Bundler::CLI::Common.configure_gem_version_promoter(
|
38
|
+
Bundler.definition,
|
39
|
+
options
|
40
|
+
)
|
41
|
+
|
42
|
+
# the patch level options imply strict is also true. It wouldn't make
|
43
|
+
# sense otherwise.
|
44
|
+
strict = options[:strict] ||
|
45
|
+
Bundler::CLI::Common.patch_level_options(options).any?
|
46
|
+
|
47
|
+
filter_options_patch = options.keys &
|
48
|
+
%w[filter-major filter-minor filter-patch]
|
49
|
+
|
50
|
+
definition_resolution = proc do
|
51
|
+
options[:local] ? definition.resolve_with_cache! : definition.resolve_remotely!
|
52
|
+
end
|
53
|
+
|
54
|
+
if options[:parseable]
|
55
|
+
Bundler.ui.silence(&definition_resolution)
|
56
|
+
else
|
57
|
+
definition_resolution.call
|
58
|
+
end
|
59
|
+
|
60
|
+
Bundler.ui.info ""
|
61
|
+
outdated_gems_by_groups = {}
|
62
|
+
outdated_gems_list = []
|
63
|
+
|
64
|
+
# Loop through the current specs
|
65
|
+
gemfile_specs, dependency_specs = current_specs.partition do |spec|
|
66
|
+
current_dependencies.key? spec.name
|
67
|
+
end
|
68
|
+
|
69
|
+
(gemfile_specs + dependency_specs).sort_by(&:name).each do |current_spec|
|
70
|
+
next if !gems.empty? && !gems.include?(current_spec.name)
|
71
|
+
|
72
|
+
dependency = current_dependencies[current_spec.name]
|
73
|
+
active_spec = retrieve_active_spec(strict, definition, current_spec)
|
74
|
+
|
75
|
+
next if active_spec.nil?
|
76
|
+
if filter_options_patch.any?
|
77
|
+
update_present = update_present_via_semver_portions(current_spec, active_spec, options)
|
78
|
+
next unless update_present
|
79
|
+
end
|
80
|
+
|
81
|
+
gem_outdated = Gem::Version.new(active_spec.version) > Gem::Version.new(current_spec.version)
|
82
|
+
next unless gem_outdated || (current_spec.git_version != active_spec.git_version)
|
83
|
+
groups = nil
|
84
|
+
if dependency && !options[:parseable]
|
85
|
+
groups = dependency.groups.join(", ")
|
86
|
+
end
|
87
|
+
|
88
|
+
outdated_gems_list << { :active_spec => active_spec,
|
89
|
+
:current_spec => current_spec,
|
90
|
+
:dependency => dependency,
|
91
|
+
:groups => groups }
|
92
|
+
|
93
|
+
outdated_gems_by_groups[groups] ||= []
|
94
|
+
outdated_gems_by_groups[groups] << { :active_spec => active_spec,
|
95
|
+
:current_spec => current_spec,
|
96
|
+
:dependency => dependency,
|
97
|
+
:groups => groups }
|
98
|
+
end
|
99
|
+
|
100
|
+
if outdated_gems_list.empty?
|
101
|
+
display_nothing_outdated_message(filter_options_patch)
|
102
|
+
else
|
103
|
+
unless options[:parseable]
|
104
|
+
if options[:pre]
|
105
|
+
Bundler.ui.info "Outdated gems included in the bundle (including " \
|
106
|
+
"pre-releases):"
|
107
|
+
else
|
108
|
+
Bundler.ui.info "Outdated gems included in the bundle:"
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
options_include_groups = [:group, :groups].select do |v|
|
113
|
+
options.keys.include?(v.to_s)
|
114
|
+
end
|
115
|
+
|
116
|
+
if options_include_groups.any?
|
117
|
+
ordered_groups = outdated_gems_by_groups.keys.compact.sort
|
118
|
+
[nil, ordered_groups].flatten.each do |groups|
|
119
|
+
gems = outdated_gems_by_groups[groups]
|
120
|
+
contains_group = if groups
|
121
|
+
groups.split(",").include?(options[:group])
|
122
|
+
else
|
123
|
+
options[:group] == "group"
|
124
|
+
end
|
125
|
+
|
126
|
+
next if (!options[:groups] && !contains_group) || gems.nil?
|
127
|
+
|
128
|
+
unless options[:parseable]
|
129
|
+
if groups
|
130
|
+
Bundler.ui.info "===== Group #{groups} ====="
|
131
|
+
else
|
132
|
+
Bundler.ui.info "===== Without group ====="
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
gems.each do |gem|
|
137
|
+
print_gem(
|
138
|
+
gem[:current_spec],
|
139
|
+
gem[:active_spec],
|
140
|
+
gem[:dependency],
|
141
|
+
groups,
|
142
|
+
options_include_groups.any?
|
143
|
+
)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
else
|
147
|
+
outdated_gems_list.each do |gem|
|
148
|
+
print_gem(
|
149
|
+
gem[:current_spec],
|
150
|
+
gem[:active_spec],
|
151
|
+
gem[:dependency],
|
152
|
+
gem[:groups],
|
153
|
+
options_include_groups.any?
|
154
|
+
)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
exit 1
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
private
|
163
|
+
|
164
|
+
def retrieve_active_spec(strict, definition, current_spec)
|
165
|
+
if strict
|
166
|
+
active_spec = definition.find_resolved_spec(current_spec)
|
167
|
+
else
|
168
|
+
active_specs = definition.find_indexed_specs(current_spec)
|
169
|
+
if !current_spec.version.prerelease? && !options[:pre] && active_specs.size > 1
|
170
|
+
active_specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
|
171
|
+
end
|
172
|
+
active_spec = active_specs.last
|
173
|
+
end
|
174
|
+
|
175
|
+
active_spec
|
176
|
+
end
|
177
|
+
|
178
|
+
def display_nothing_outdated_message(filter_options_patch)
|
179
|
+
unless options[:parseable]
|
180
|
+
if filter_options_patch.any?
|
181
|
+
display = filter_options_patch.map do |o|
|
182
|
+
o.sub("filter-", "")
|
183
|
+
end.join(" or ")
|
184
|
+
|
185
|
+
Bundler.ui.info "No #{display} updates to display.\n"
|
186
|
+
else
|
187
|
+
Bundler.ui.info "Bundle up to date!\n"
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
def print_gem(current_spec, active_spec, dependency, groups, options_include_groups)
|
193
|
+
spec_version = "#{active_spec.version}#{active_spec.git_version}"
|
194
|
+
spec_version += " (from #{active_spec.loaded_from})" if Bundler.ui.debug? && active_spec.loaded_from
|
195
|
+
current_version = "#{current_spec.version}#{current_spec.git_version}"
|
196
|
+
|
197
|
+
if dependency && dependency.specific?
|
198
|
+
dependency_version = %(, requested #{dependency.requirement})
|
199
|
+
end
|
200
|
+
|
201
|
+
spec_outdated_info = "#{active_spec.name} (newest #{spec_version}, " \
|
202
|
+
"installed #{current_version}#{dependency_version})"
|
203
|
+
|
204
|
+
output_message = if options[:parseable]
|
205
|
+
spec_outdated_info.to_s
|
206
|
+
elsif options_include_groups || !groups
|
207
|
+
" * #{spec_outdated_info}"
|
208
|
+
else
|
209
|
+
" * #{spec_outdated_info} in groups \"#{groups}\""
|
210
|
+
end
|
211
|
+
|
212
|
+
Bundler.ui.info output_message.rstrip
|
213
|
+
end
|
214
|
+
|
215
|
+
def check_for_deployment_mode
|
216
|
+
return unless Bundler.frozen_bundle?
|
217
|
+
suggested_command = if Bundler.settings.locations("frozen")[:global]
|
218
|
+
"bundle config --delete frozen"
|
219
|
+
elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
|
220
|
+
"bundle config --delete deployment"
|
221
|
+
else
|
222
|
+
"bundle install --no-deployment"
|
223
|
+
end
|
224
|
+
raise ProductionError, "You are trying to check outdated gems in " \
|
225
|
+
"deployment mode. Run `bundle outdated` elsewhere.\n" \
|
226
|
+
"\nIf this is a development machine, remove the " \
|
227
|
+
"#{Bundler.default_gemfile} freeze" \
|
228
|
+
"\nby running `#{suggested_command}`."
|
229
|
+
end
|
230
|
+
|
231
|
+
def update_present_via_semver_portions(current_spec, active_spec, options)
|
232
|
+
current_major = current_spec.version.segments.first
|
233
|
+
active_major = active_spec.version.segments.first
|
234
|
+
|
235
|
+
update_present = false
|
236
|
+
update_present = active_major > current_major if options["filter-major"]
|
237
|
+
|
238
|
+
if !update_present && (options["filter-minor"] || options["filter-patch"]) && current_major == active_major
|
239
|
+
current_minor = get_version_semver_portion_value(current_spec, 1)
|
240
|
+
active_minor = get_version_semver_portion_value(active_spec, 1)
|
241
|
+
|
242
|
+
update_present = active_minor > current_minor if options["filter-minor"]
|
243
|
+
|
244
|
+
if !update_present && options["filter-patch"] && current_minor == active_minor
|
245
|
+
current_patch = get_version_semver_portion_value(current_spec, 2)
|
246
|
+
active_patch = get_version_semver_portion_value(active_spec, 2)
|
247
|
+
|
248
|
+
update_present = active_patch > current_patch
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
252
|
+
update_present
|
253
|
+
end
|
254
|
+
|
255
|
+
def get_version_semver_portion_value(spec, version_portion_index)
|
256
|
+
version_section = spec.version.segments[version_portion_index, 1]
|
257
|
+
version_section.nil? ? 0 : (version_section.first || 0)
|
258
|
+
end
|
259
|
+
end
|
260
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class CLI::Package
|
5
|
+
attr_reader :options
|
6
|
+
|
7
|
+
def initialize(options)
|
8
|
+
@options = options
|
9
|
+
end
|
10
|
+
|
11
|
+
def run
|
12
|
+
Bundler.ui.level = "error" if options[:quiet]
|
13
|
+
Bundler.settings.set_command_option_if_given :path, options[:path]
|
14
|
+
Bundler.settings.set_command_option_if_given :cache_all_platforms, options["all-platforms"]
|
15
|
+
Bundler.settings.set_command_option_if_given :cache_path, options["cache-path"]
|
16
|
+
|
17
|
+
setup_cache_all
|
18
|
+
install
|
19
|
+
|
20
|
+
# TODO: move cache contents here now that all bundles are locked
|
21
|
+
custom_path = Bundler.settings[:path] if options[:path]
|
22
|
+
Bundler.load.cache(custom_path)
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def install
|
28
|
+
require "bundler/cli/install"
|
29
|
+
options = self.options.dup
|
30
|
+
if Bundler.settings[:cache_all_platforms]
|
31
|
+
options["local"] = false
|
32
|
+
options["update"] = true
|
33
|
+
end
|
34
|
+
Bundler::CLI::Install.new(options).run
|
35
|
+
end
|
36
|
+
|
37
|
+
def setup_cache_all
|
38
|
+
all = options.fetch(:all, Bundler.feature_flag.cache_command_is_package? || nil)
|
39
|
+
|
40
|
+
Bundler.settings.set_command_option_if_given :cache_all, all
|
41
|
+
|
42
|
+
if Bundler.definition.has_local_dependencies? && !Bundler.feature_flag.cache_all?
|
43
|
+
Bundler.ui.warn "Your Gemfile contains path and git dependencies. If you want " \
|
44
|
+
"to package them as well, please pass the --all flag. This will be the default " \
|
45
|
+
"on Bundler 2.0."
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class CLI::Platform
|
5
|
+
attr_reader :options
|
6
|
+
def initialize(options)
|
7
|
+
@options = options
|
8
|
+
end
|
9
|
+
|
10
|
+
def run
|
11
|
+
platforms, ruby_version = Bundler.ui.silence do
|
12
|
+
locked_ruby_version = Bundler.locked_gems && Bundler.locked_gems.ruby_version
|
13
|
+
gemfile_ruby_version = Bundler.definition.ruby_version && Bundler.definition.ruby_version.single_version_string
|
14
|
+
[Bundler.definition.platforms.map {|p| "* #{p}" },
|
15
|
+
locked_ruby_version || gemfile_ruby_version]
|
16
|
+
end
|
17
|
+
output = []
|
18
|
+
|
19
|
+
if options[:ruby]
|
20
|
+
if ruby_version
|
21
|
+
output << ruby_version
|
22
|
+
else
|
23
|
+
output << "No ruby version specified"
|
24
|
+
end
|
25
|
+
else
|
26
|
+
output << "Your platform is: #{RUBY_PLATFORM}"
|
27
|
+
output << "Your app has gems that work on these platforms:\n#{platforms.join("\n")}"
|
28
|
+
|
29
|
+
if ruby_version
|
30
|
+
output << "Your Gemfile specifies a Ruby version requirement:\n* #{ruby_version}"
|
31
|
+
|
32
|
+
begin
|
33
|
+
Bundler.definition.validate_runtime!
|
34
|
+
output << "Your current platform satisfies the Ruby version requirement."
|
35
|
+
rescue RubyVersionMismatch => e
|
36
|
+
output << e.message
|
37
|
+
end
|
38
|
+
else
|
39
|
+
output << "Your Gemfile does not specify a Ruby version requirement."
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
Bundler.ui.info output.join("\n\n")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/vendored_thor"
|
4
|
+
module Bundler
|
5
|
+
class CLI::Plugin < Thor
|
6
|
+
desc "install PLUGINS", "Install the plugin from the source"
|
7
|
+
long_desc <<-D
|
8
|
+
Install plugins either from the rubygems source provided (with --source option) or from a git source provided with (--git option). If no sources are provided, it uses Gem.sources
|
9
|
+
D
|
10
|
+
method_option "source", :type => :string, :default => nil, :banner =>
|
11
|
+
"URL of the RubyGems source to fetch the plugin from"
|
12
|
+
method_option "version", :type => :string, :default => nil, :banner =>
|
13
|
+
"The version of the plugin to fetch"
|
14
|
+
method_option "git", :type => :string, :default => nil, :banner =>
|
15
|
+
"URL of the git repo to fetch from"
|
16
|
+
method_option "branch", :type => :string, :default => nil, :banner =>
|
17
|
+
"The git branch to checkout"
|
18
|
+
method_option "ref", :type => :string, :default => nil, :banner =>
|
19
|
+
"The git revision to check out"
|
20
|
+
def install(*plugins)
|
21
|
+
Bundler::Plugin.install(plugins, options)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class CLI::Pristine
|
5
|
+
def initialize(gems)
|
6
|
+
@gems = gems
|
7
|
+
end
|
8
|
+
|
9
|
+
def run
|
10
|
+
CLI::Common.ensure_all_gems_in_lockfile!(@gems)
|
11
|
+
definition = Bundler.definition
|
12
|
+
definition.validate_runtime!
|
13
|
+
installer = Bundler::Installer.new(Bundler.root, definition)
|
14
|
+
|
15
|
+
Bundler.load.specs.each do |spec|
|
16
|
+
next if spec.name == "bundler" # Source::Rubygems doesn't install bundler
|
17
|
+
next if !@gems.empty? && !@gems.include?(spec.name)
|
18
|
+
|
19
|
+
gem_name = "#{spec.name} (#{spec.version}#{spec.git_version})"
|
20
|
+
gem_name += " (#{spec.platform})" if !spec.platform.nil? && spec.platform != Gem::Platform::RUBY
|
21
|
+
|
22
|
+
case source = spec.source
|
23
|
+
when Source::Rubygems
|
24
|
+
cached_gem = spec.cache_file
|
25
|
+
unless File.exist?(cached_gem)
|
26
|
+
Bundler.ui.error("Failed to pristine #{gem_name}. Cached gem #{cached_gem} does not exist.")
|
27
|
+
next
|
28
|
+
end
|
29
|
+
|
30
|
+
FileUtils.rm_rf spec.full_gem_path
|
31
|
+
when Source::Git
|
32
|
+
source.remote!
|
33
|
+
FileUtils.rm_rf spec.full_gem_path
|
34
|
+
else
|
35
|
+
Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is sourced from local path.")
|
36
|
+
next
|
37
|
+
end
|
38
|
+
|
39
|
+
Bundler::GemInstaller.new(spec, installer, false, 0, true).install_from_spec
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class CLI::Show
|
5
|
+
attr_reader :options, :gem_name, :latest_specs
|
6
|
+
def initialize(options, gem_name)
|
7
|
+
@options = options
|
8
|
+
@gem_name = gem_name
|
9
|
+
@verbose = options[:verbose] || options[:outdated]
|
10
|
+
@latest_specs = fetch_latest_specs if @verbose
|
11
|
+
end
|
12
|
+
|
13
|
+
def run
|
14
|
+
Bundler.ui.silence do
|
15
|
+
Bundler.definition.validate_runtime!
|
16
|
+
Bundler.load.lock
|
17
|
+
end
|
18
|
+
|
19
|
+
if gem_name
|
20
|
+
if gem_name == "bundler"
|
21
|
+
path = File.expand_path("../../../..", __FILE__)
|
22
|
+
else
|
23
|
+
spec = Bundler::CLI::Common.select_spec(gem_name, :regex_match)
|
24
|
+
return unless spec
|
25
|
+
path = spec.full_gem_path
|
26
|
+
unless File.directory?(path)
|
27
|
+
Bundler.ui.warn "The gem #{gem_name} has been deleted. It was installed at:"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
return Bundler.ui.info(path)
|
31
|
+
end
|
32
|
+
|
33
|
+
if options[:paths]
|
34
|
+
Bundler.load.specs.sort_by(&:name).map do |s|
|
35
|
+
Bundler.ui.info s.full_gem_path
|
36
|
+
end
|
37
|
+
else
|
38
|
+
Bundler.ui.info "Gems included by the bundle:"
|
39
|
+
Bundler.load.specs.sort_by(&:name).each do |s|
|
40
|
+
desc = " * #{s.name} (#{s.version}#{s.git_version})"
|
41
|
+
if @verbose
|
42
|
+
latest = latest_specs.find {|l| l.name == s.name }
|
43
|
+
Bundler.ui.info <<-END.gsub(/^ +/, "")
|
44
|
+
#{desc}
|
45
|
+
\tSummary: #{s.summary || "No description available."}
|
46
|
+
\tHomepage: #{s.homepage || "No website available."}
|
47
|
+
\tStatus: #{outdated?(s, latest) ? "Outdated - #{s.version} < #{latest.version}" : "Up to date"}
|
48
|
+
END
|
49
|
+
else
|
50
|
+
Bundler.ui.info desc
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
def fetch_latest_specs
|
59
|
+
definition = Bundler.definition(true)
|
60
|
+
if options[:outdated]
|
61
|
+
Bundler.ui.info "Fetching remote specs for outdated check...\n\n"
|
62
|
+
Bundler.ui.silence { definition.resolve_remotely! }
|
63
|
+
else
|
64
|
+
definition.resolve_with_cache!
|
65
|
+
end
|
66
|
+
Bundler.reset!
|
67
|
+
definition.specs
|
68
|
+
end
|
69
|
+
|
70
|
+
def outdated?(current, latest)
|
71
|
+
return false unless latest
|
72
|
+
Gem::Version.new(current.version) < Gem::Version.new(latest.version)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,91 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class CLI::Update
|
5
|
+
attr_reader :options, :gems
|
6
|
+
def initialize(options, gems)
|
7
|
+
@options = options
|
8
|
+
@gems = gems
|
9
|
+
end
|
10
|
+
|
11
|
+
def run
|
12
|
+
Bundler.ui.level = "error" if options[:quiet]
|
13
|
+
|
14
|
+
Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
|
15
|
+
|
16
|
+
sources = Array(options[:source])
|
17
|
+
groups = Array(options[:group]).map(&:to_sym)
|
18
|
+
|
19
|
+
full_update = gems.empty? && sources.empty? && groups.empty? && !options[:ruby] && !options[:bundler]
|
20
|
+
|
21
|
+
if full_update && !options[:all]
|
22
|
+
if Bundler.feature_flag.update_requires_all_flag?
|
23
|
+
raise InvalidOption, "To update everything, pass the `--all` flag."
|
24
|
+
end
|
25
|
+
SharedHelpers.major_deprecation 2, "Pass --all to `bundle update` to update everything"
|
26
|
+
elsif !full_update && options[:all]
|
27
|
+
raise InvalidOption, "Cannot specify --all along with specific options."
|
28
|
+
end
|
29
|
+
|
30
|
+
if full_update
|
31
|
+
# We're doing a full update
|
32
|
+
Bundler.definition(true)
|
33
|
+
else
|
34
|
+
unless Bundler.default_lockfile.exist?
|
35
|
+
raise GemfileLockNotFound, "This Bundle hasn't been installed yet. " \
|
36
|
+
"Run `bundle install` to update and install the bundled gems."
|
37
|
+
end
|
38
|
+
Bundler::CLI::Common.ensure_all_gems_in_lockfile!(gems)
|
39
|
+
|
40
|
+
if groups.any?
|
41
|
+
specs = Bundler.definition.specs_for groups
|
42
|
+
gems.concat(specs.map(&:name))
|
43
|
+
end
|
44
|
+
|
45
|
+
Bundler.definition(:gems => gems, :sources => sources, :ruby => options[:ruby],
|
46
|
+
:lock_shared_dependencies => options[:conservative],
|
47
|
+
:bundler => options[:bundler])
|
48
|
+
end
|
49
|
+
|
50
|
+
Bundler::CLI::Common.configure_gem_version_promoter(Bundler.definition, options)
|
51
|
+
|
52
|
+
Bundler::Fetcher.disable_endpoint = options["full-index"]
|
53
|
+
|
54
|
+
opts = options.dup
|
55
|
+
opts["update"] = true
|
56
|
+
opts["local"] = options[:local]
|
57
|
+
|
58
|
+
Bundler.settings.set_command_option_if_given :jobs, opts["jobs"]
|
59
|
+
|
60
|
+
Bundler.definition.validate_runtime!
|
61
|
+
installer = Installer.install Bundler.root, Bundler.definition, opts
|
62
|
+
Bundler.load.cache if Bundler.app_cache.exist?
|
63
|
+
|
64
|
+
if CLI::Common.clean_after_install?
|
65
|
+
require "bundler/cli/clean"
|
66
|
+
Bundler::CLI::Clean.new(options).run
|
67
|
+
end
|
68
|
+
|
69
|
+
if locked_gems = Bundler.definition.locked_gems
|
70
|
+
gems.each do |name|
|
71
|
+
locked_version = locked_gems.specs.find {|s| s.name == name }
|
72
|
+
locked_version &&= locked_version.version
|
73
|
+
next unless locked_version
|
74
|
+
new_version = Bundler.definition.specs[name].first
|
75
|
+
new_version &&= new_version.version
|
76
|
+
if !new_version
|
77
|
+
Bundler.ui.warn "Bundler attempted to update #{name} but it was removed from the bundle"
|
78
|
+
elsif new_version < locked_version
|
79
|
+
Bundler.ui.warn "Bundler attempted to update #{name} but its version regressed from #{locked_version} to #{new_version}"
|
80
|
+
elsif new_version == locked_version
|
81
|
+
Bundler.ui.warn "Bundler attempted to update #{name} but its version stayed the same"
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
Bundler.ui.confirm "Bundle updated!"
|
87
|
+
Bundler::CLI::Common.output_without_groups_message
|
88
|
+
Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class CLI::Viz
|
5
|
+
attr_reader :options, :gem_name
|
6
|
+
def initialize(options)
|
7
|
+
@options = options
|
8
|
+
end
|
9
|
+
|
10
|
+
def run
|
11
|
+
# make sure we get the right `graphviz`. There is also a `graphviz`
|
12
|
+
# gem we're not built to support
|
13
|
+
gem "ruby-graphviz"
|
14
|
+
require "graphviz"
|
15
|
+
|
16
|
+
options[:without] = options[:without].join(":").tr(" ", ":").split(":")
|
17
|
+
output_file = File.expand_path(options[:file])
|
18
|
+
|
19
|
+
graph = Graph.new(Bundler.load, output_file, options[:version], options[:requirements], options[:format], options[:without])
|
20
|
+
graph.viz
|
21
|
+
rescue LoadError => e
|
22
|
+
Bundler.ui.error e.inspect
|
23
|
+
Bundler.ui.warn "Make sure you have the graphviz ruby gem. You can install it with:"
|
24
|
+
Bundler.ui.warn "`gem install ruby-graphviz`"
|
25
|
+
rescue StandardError => e
|
26
|
+
raise unless e.message =~ /GraphViz not installed or dot not in PATH/
|
27
|
+
Bundler.ui.error e.message
|
28
|
+
Bundler.ui.warn "Please install GraphViz. On a Mac with Homebrew, you can run `brew install graphviz`."
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|