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,545 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/compatibility_guard"
|
4
|
+
|
5
|
+
require "bundler/vendored_fileutils"
|
6
|
+
require "pathname"
|
7
|
+
require "rbconfig"
|
8
|
+
require "thread"
|
9
|
+
|
10
|
+
require "bundler/errors"
|
11
|
+
require "bundler/environment_preserver"
|
12
|
+
require "bundler/plugin"
|
13
|
+
require "bundler/rubygems_ext"
|
14
|
+
require "bundler/rubygems_integration"
|
15
|
+
require "bundler/version"
|
16
|
+
require "bundler/constants"
|
17
|
+
require "bundler/current_ruby"
|
18
|
+
require "bundler/build_metadata"
|
19
|
+
|
20
|
+
module Bundler
|
21
|
+
environment_preserver = EnvironmentPreserver.new(ENV, EnvironmentPreserver::BUNDLER_KEYS)
|
22
|
+
ORIGINAL_ENV = environment_preserver.restore
|
23
|
+
ENV.replace(environment_preserver.backup)
|
24
|
+
SUDO_MUTEX = Mutex.new
|
25
|
+
|
26
|
+
autoload :Definition, "bundler/definition"
|
27
|
+
autoload :Dependency, "bundler/dependency"
|
28
|
+
autoload :DepProxy, "bundler/dep_proxy"
|
29
|
+
autoload :Deprecate, "bundler/deprecate"
|
30
|
+
autoload :Dsl, "bundler/dsl"
|
31
|
+
autoload :EndpointSpecification, "bundler/endpoint_specification"
|
32
|
+
autoload :Env, "bundler/env"
|
33
|
+
autoload :Fetcher, "bundler/fetcher"
|
34
|
+
autoload :FeatureFlag, "bundler/feature_flag"
|
35
|
+
autoload :GemHelper, "bundler/gem_helper"
|
36
|
+
autoload :GemHelpers, "bundler/gem_helpers"
|
37
|
+
autoload :GemRemoteFetcher, "bundler/gem_remote_fetcher"
|
38
|
+
autoload :GemVersionPromoter, "bundler/gem_version_promoter"
|
39
|
+
autoload :Graph, "bundler/graph"
|
40
|
+
autoload :Index, "bundler/index"
|
41
|
+
autoload :Injector, "bundler/injector"
|
42
|
+
autoload :Installer, "bundler/installer"
|
43
|
+
autoload :LazySpecification, "bundler/lazy_specification"
|
44
|
+
autoload :LockfileParser, "bundler/lockfile_parser"
|
45
|
+
autoload :MatchPlatform, "bundler/match_platform"
|
46
|
+
autoload :ProcessLock, "bundler/process_lock"
|
47
|
+
autoload :RemoteSpecification, "bundler/remote_specification"
|
48
|
+
autoload :Resolver, "bundler/resolver"
|
49
|
+
autoload :Retry, "bundler/retry"
|
50
|
+
autoload :RubyDsl, "bundler/ruby_dsl"
|
51
|
+
autoload :RubyGemsGemInstaller, "bundler/rubygems_gem_installer"
|
52
|
+
autoload :RubyVersion, "bundler/ruby_version"
|
53
|
+
autoload :Runtime, "bundler/runtime"
|
54
|
+
autoload :Settings, "bundler/settings"
|
55
|
+
autoload :SharedHelpers, "bundler/shared_helpers"
|
56
|
+
autoload :Source, "bundler/source"
|
57
|
+
autoload :SourceList, "bundler/source_list"
|
58
|
+
autoload :SpecSet, "bundler/spec_set"
|
59
|
+
autoload :StubSpecification, "bundler/stub_specification"
|
60
|
+
autoload :UI, "bundler/ui"
|
61
|
+
autoload :URICredentialsFilter, "bundler/uri_credentials_filter"
|
62
|
+
autoload :VersionRanges, "bundler/version_ranges"
|
63
|
+
|
64
|
+
class << self
|
65
|
+
def configure
|
66
|
+
@configured ||= configure_gem_home_and_path
|
67
|
+
end
|
68
|
+
|
69
|
+
def ui
|
70
|
+
(defined?(@ui) && @ui) || (self.ui = UI::Silent.new)
|
71
|
+
end
|
72
|
+
|
73
|
+
def ui=(ui)
|
74
|
+
Bundler.rubygems.ui = ui ? UI::RGProxy.new(ui) : nil
|
75
|
+
@ui = ui
|
76
|
+
end
|
77
|
+
|
78
|
+
# Returns absolute path of where gems are installed on the filesystem.
|
79
|
+
def bundle_path
|
80
|
+
@bundle_path ||= Pathname.new(configured_bundle_path.path).expand_path(root)
|
81
|
+
end
|
82
|
+
|
83
|
+
def configured_bundle_path
|
84
|
+
@configured_bundle_path ||= settings.path.tap(&:validate!)
|
85
|
+
end
|
86
|
+
|
87
|
+
# Returns absolute location of where binstubs are installed to.
|
88
|
+
def bin_path
|
89
|
+
@bin_path ||= begin
|
90
|
+
path = settings[:bin] || "bin"
|
91
|
+
path = Pathname.new(path).expand_path(root).expand_path
|
92
|
+
SharedHelpers.filesystem_access(path) {|p| FileUtils.mkdir_p(p) }
|
93
|
+
path
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def setup(*groups)
|
98
|
+
# Return if all groups are already loaded
|
99
|
+
return @setup if defined?(@setup) && @setup
|
100
|
+
|
101
|
+
definition.validate_runtime!
|
102
|
+
|
103
|
+
SharedHelpers.print_major_deprecations!
|
104
|
+
|
105
|
+
if groups.empty?
|
106
|
+
# Load all groups, but only once
|
107
|
+
@setup = load.setup
|
108
|
+
else
|
109
|
+
load.setup(*groups)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
def require(*groups)
|
114
|
+
setup(*groups).require(*groups)
|
115
|
+
end
|
116
|
+
|
117
|
+
def load
|
118
|
+
@load ||= Runtime.new(root, definition)
|
119
|
+
end
|
120
|
+
|
121
|
+
def environment
|
122
|
+
SharedHelpers.major_deprecation 2, "Bundler.environment has been removed in favor of Bundler.load"
|
123
|
+
load
|
124
|
+
end
|
125
|
+
|
126
|
+
# Returns an instance of Bundler::Definition for given Gemfile and lockfile
|
127
|
+
#
|
128
|
+
# @param unlock [Hash, Boolean, nil] Gems that have been requested
|
129
|
+
# to be updated or true if all gems should be updated
|
130
|
+
# @return [Bundler::Definition]
|
131
|
+
def definition(unlock = nil)
|
132
|
+
@definition = nil if unlock
|
133
|
+
@definition ||= begin
|
134
|
+
configure
|
135
|
+
Definition.build(default_gemfile, default_lockfile, unlock)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
def frozen_bundle?
|
140
|
+
frozen = settings[:deployment]
|
141
|
+
frozen ||= settings[:frozen] unless feature_flag.deployment_means_frozen?
|
142
|
+
frozen
|
143
|
+
end
|
144
|
+
|
145
|
+
def locked_gems
|
146
|
+
@locked_gems ||=
|
147
|
+
if defined?(@definition) && @definition
|
148
|
+
definition.locked_gems
|
149
|
+
elsif Bundler.default_lockfile.file?
|
150
|
+
lock = Bundler.read_file(Bundler.default_lockfile)
|
151
|
+
LockfileParser.new(lock)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
def ruby_scope
|
156
|
+
"#{Bundler.rubygems.ruby_engine}/#{Bundler.rubygems.config_map[:ruby_version]}"
|
157
|
+
end
|
158
|
+
|
159
|
+
def user_home
|
160
|
+
@user_home ||= begin
|
161
|
+
home = Bundler.rubygems.user_home
|
162
|
+
|
163
|
+
warning = if home.nil?
|
164
|
+
"Your home directory is not set."
|
165
|
+
elsif !File.directory?(home)
|
166
|
+
"`#{home}` is not a directory."
|
167
|
+
elsif !File.writable?(home)
|
168
|
+
"`#{home}` is not writable."
|
169
|
+
end
|
170
|
+
|
171
|
+
if warning
|
172
|
+
user_home = tmp_home_path(Etc.getlogin, warning)
|
173
|
+
Bundler.ui.warn "#{warning}\nBundler will use `#{user_home}' as your home directory temporarily.\n"
|
174
|
+
user_home
|
175
|
+
else
|
176
|
+
Pathname.new(home)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
def tmp_home_path(login, warning)
|
182
|
+
login ||= "unknown"
|
183
|
+
Kernel.send(:require, "tmpdir")
|
184
|
+
path = Pathname.new(Dir.tmpdir).join("bundler", "home")
|
185
|
+
SharedHelpers.filesystem_access(path) do |tmp_home_path|
|
186
|
+
unless tmp_home_path.exist?
|
187
|
+
tmp_home_path.mkpath
|
188
|
+
tmp_home_path.chmod(0o777)
|
189
|
+
end
|
190
|
+
tmp_home_path.join(login).tap(&:mkpath)
|
191
|
+
end
|
192
|
+
rescue => e
|
193
|
+
raise e.exception("#{warning}\nBundler also failed to create a temporary home directory at `#{path}':\n#{e}")
|
194
|
+
end
|
195
|
+
|
196
|
+
def user_bundle_path
|
197
|
+
Pathname.new(user_home).join(".bundle")
|
198
|
+
end
|
199
|
+
|
200
|
+
def home
|
201
|
+
bundle_path.join("bundler")
|
202
|
+
end
|
203
|
+
|
204
|
+
def install_path
|
205
|
+
home.join("gems")
|
206
|
+
end
|
207
|
+
|
208
|
+
def specs_path
|
209
|
+
bundle_path.join("specifications")
|
210
|
+
end
|
211
|
+
|
212
|
+
def user_cache
|
213
|
+
user_bundle_path.join("cache")
|
214
|
+
end
|
215
|
+
|
216
|
+
def root
|
217
|
+
@root ||= begin
|
218
|
+
SharedHelpers.root
|
219
|
+
rescue GemfileNotFound
|
220
|
+
bundle_dir = default_bundle_dir
|
221
|
+
raise GemfileNotFound, "Could not locate Gemfile or .bundle/ directory" unless bundle_dir
|
222
|
+
Pathname.new(File.expand_path("..", bundle_dir))
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
def app_config_path
|
227
|
+
if app_config = ENV["BUNDLE_APP_CONFIG"]
|
228
|
+
Pathname.new(app_config).expand_path(root)
|
229
|
+
else
|
230
|
+
root.join(".bundle")
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
def app_cache(custom_path = nil)
|
235
|
+
path = custom_path || root
|
236
|
+
Pathname.new(path).join(settings.app_cache_path)
|
237
|
+
end
|
238
|
+
|
239
|
+
def tmp(name = Process.pid.to_s)
|
240
|
+
Kernel.send(:require, "tmpdir")
|
241
|
+
Pathname.new(Dir.mktmpdir(["bundler", name]))
|
242
|
+
end
|
243
|
+
|
244
|
+
def rm_rf(path)
|
245
|
+
FileUtils.remove_entry_secure(path) if path && File.exist?(path)
|
246
|
+
rescue ArgumentError
|
247
|
+
message = <<EOF
|
248
|
+
It is a security vulnerability to allow your home directory to be world-writable, and bundler can not continue.
|
249
|
+
You should probably consider fixing this issue by running `chmod o-w ~` on *nix.
|
250
|
+
Please refer to http://ruby-doc.org/stdlib-2.1.2/libdoc/fileutils/rdoc/FileUtils.html#method-c-remove_entry_secure for details.
|
251
|
+
EOF
|
252
|
+
File.world_writable?(path) ? Bundler.ui.warn(message) : raise
|
253
|
+
raise PathError, "Please fix the world-writable issue with your #{path} directory"
|
254
|
+
end
|
255
|
+
|
256
|
+
def settings
|
257
|
+
@settings ||= Settings.new(app_config_path)
|
258
|
+
rescue GemfileNotFound
|
259
|
+
@settings = Settings.new(Pathname.new(".bundle").expand_path)
|
260
|
+
end
|
261
|
+
|
262
|
+
# @return [Hash] Environment present before Bundler was activated
|
263
|
+
def original_env
|
264
|
+
ORIGINAL_ENV.clone
|
265
|
+
end
|
266
|
+
|
267
|
+
# @deprecated Use `original_env` instead
|
268
|
+
# @return [Hash] Environment with all bundler-related variables removed
|
269
|
+
def clean_env
|
270
|
+
Bundler::SharedHelpers.major_deprecation(2, "`Bundler.clean_env` has weird edge cases, use `.original_env` instead")
|
271
|
+
env = original_env
|
272
|
+
|
273
|
+
if env.key?("BUNDLER_ORIG_MANPATH")
|
274
|
+
env["MANPATH"] = env["BUNDLER_ORIG_MANPATH"]
|
275
|
+
end
|
276
|
+
|
277
|
+
env.delete_if {|k, _| k[0, 7] == "BUNDLE_" }
|
278
|
+
|
279
|
+
if env.key?("RUBYOPT")
|
280
|
+
env["RUBYOPT"] = env["RUBYOPT"].sub "-rbundler/setup", ""
|
281
|
+
end
|
282
|
+
|
283
|
+
if env.key?("RUBYLIB")
|
284
|
+
rubylib = env["RUBYLIB"].split(File::PATH_SEPARATOR)
|
285
|
+
rubylib.delete(File.expand_path("..", __FILE__))
|
286
|
+
env["RUBYLIB"] = rubylib.join(File::PATH_SEPARATOR)
|
287
|
+
end
|
288
|
+
|
289
|
+
env
|
290
|
+
end
|
291
|
+
|
292
|
+
def with_original_env
|
293
|
+
with_env(original_env) { yield }
|
294
|
+
end
|
295
|
+
|
296
|
+
def with_clean_env
|
297
|
+
with_env(clean_env) { yield }
|
298
|
+
end
|
299
|
+
|
300
|
+
def clean_system(*args)
|
301
|
+
with_clean_env { Kernel.system(*args) }
|
302
|
+
end
|
303
|
+
|
304
|
+
def clean_exec(*args)
|
305
|
+
with_clean_env { Kernel.exec(*args) }
|
306
|
+
end
|
307
|
+
|
308
|
+
def local_platform
|
309
|
+
return Gem::Platform::RUBY if settings[:force_ruby_platform]
|
310
|
+
Gem::Platform.local
|
311
|
+
end
|
312
|
+
|
313
|
+
def default_gemfile
|
314
|
+
SharedHelpers.default_gemfile
|
315
|
+
end
|
316
|
+
|
317
|
+
def default_lockfile
|
318
|
+
SharedHelpers.default_lockfile
|
319
|
+
end
|
320
|
+
|
321
|
+
def default_bundle_dir
|
322
|
+
SharedHelpers.default_bundle_dir
|
323
|
+
end
|
324
|
+
|
325
|
+
def system_bindir
|
326
|
+
# Gem.bindir doesn't always return the location that RubyGems will install
|
327
|
+
# system binaries. If you put '-n foo' in your .gemrc, RubyGems will
|
328
|
+
# install binstubs there instead. Unfortunately, RubyGems doesn't expose
|
329
|
+
# that directory at all, so rather than parse .gemrc ourselves, we allow
|
330
|
+
# the directory to be set as well, via `bundle config bindir foo`.
|
331
|
+
Bundler.settings[:system_bindir] || Bundler.rubygems.gem_bindir
|
332
|
+
end
|
333
|
+
|
334
|
+
def use_system_gems?
|
335
|
+
configured_bundle_path.use_system_gems?
|
336
|
+
end
|
337
|
+
|
338
|
+
def requires_sudo?
|
339
|
+
return @requires_sudo if defined?(@requires_sudo_ran)
|
340
|
+
|
341
|
+
sudo_present = which "sudo" if settings.allow_sudo?
|
342
|
+
|
343
|
+
if sudo_present
|
344
|
+
# the bundle path and subdirectories need to be writable for RubyGems
|
345
|
+
# to be able to unpack and install gems without exploding
|
346
|
+
path = bundle_path
|
347
|
+
path = path.parent until path.exist?
|
348
|
+
|
349
|
+
# bins are written to a different location on OS X
|
350
|
+
bin_dir = Pathname.new(Bundler.system_bindir)
|
351
|
+
bin_dir = bin_dir.parent until bin_dir.exist?
|
352
|
+
|
353
|
+
# if any directory is not writable, we need sudo
|
354
|
+
files = [path, bin_dir] | Dir[path.join("build_info/*").to_s] | Dir[path.join("*").to_s]
|
355
|
+
sudo_needed = files.any? {|f| !File.writable?(f) }
|
356
|
+
end
|
357
|
+
|
358
|
+
@requires_sudo_ran = true
|
359
|
+
@requires_sudo = settings.allow_sudo? && sudo_present && sudo_needed
|
360
|
+
end
|
361
|
+
|
362
|
+
def mkdir_p(path)
|
363
|
+
if requires_sudo?
|
364
|
+
sudo "mkdir -p '#{path}'" unless File.exist?(path)
|
365
|
+
else
|
366
|
+
SharedHelpers.filesystem_access(path, :write) do |p|
|
367
|
+
FileUtils.mkdir_p(p)
|
368
|
+
end
|
369
|
+
end
|
370
|
+
end
|
371
|
+
|
372
|
+
def which(executable)
|
373
|
+
if File.file?(executable) && File.executable?(executable)
|
374
|
+
executable
|
375
|
+
elsif paths = ENV["PATH"]
|
376
|
+
quote = '"'.freeze
|
377
|
+
paths.split(File::PATH_SEPARATOR).find do |path|
|
378
|
+
path = path[1..-2] if path.start_with?(quote) && path.end_with?(quote)
|
379
|
+
executable_path = File.expand_path(executable, path)
|
380
|
+
return executable_path if File.file?(executable_path) && File.executable?(executable_path)
|
381
|
+
end
|
382
|
+
end
|
383
|
+
end
|
384
|
+
|
385
|
+
def sudo(str)
|
386
|
+
SUDO_MUTEX.synchronize do
|
387
|
+
prompt = "\n\n" + <<-PROMPT.gsub(/^ {6}/, "").strip + " "
|
388
|
+
Your user account isn't allowed to install to the system RubyGems.
|
389
|
+
You can cancel this installation and run:
|
390
|
+
|
391
|
+
bundle install --path vendor/bundle
|
392
|
+
|
393
|
+
to install the gems into ./vendor/bundle/, or you can enter your password
|
394
|
+
and install the bundled gems to RubyGems using sudo.
|
395
|
+
|
396
|
+
Password:
|
397
|
+
PROMPT
|
398
|
+
|
399
|
+
unless @prompted_for_sudo ||= system(%(sudo -k -p "#{prompt}" true))
|
400
|
+
raise SudoNotPermittedError,
|
401
|
+
"Bundler requires sudo access to install at the moment. " \
|
402
|
+
"Try installing again, granting Bundler sudo access when prompted, or installing into a different path."
|
403
|
+
end
|
404
|
+
|
405
|
+
`sudo -p "#{prompt}" #{str}`
|
406
|
+
end
|
407
|
+
end
|
408
|
+
|
409
|
+
def read_file(file)
|
410
|
+
File.open(file, "rb", &:read)
|
411
|
+
end
|
412
|
+
|
413
|
+
def load_marshal(data)
|
414
|
+
Marshal.load(data)
|
415
|
+
rescue => e
|
416
|
+
raise MarshalError, "#{e.class}: #{e.message}"
|
417
|
+
end
|
418
|
+
|
419
|
+
def load_gemspec(file, validate = false)
|
420
|
+
@gemspec_cache ||= {}
|
421
|
+
key = File.expand_path(file)
|
422
|
+
@gemspec_cache[key] ||= load_gemspec_uncached(file, validate)
|
423
|
+
# Protect against caching side-effected gemspecs by returning a
|
424
|
+
# new instance each time.
|
425
|
+
@gemspec_cache[key].dup if @gemspec_cache[key]
|
426
|
+
end
|
427
|
+
|
428
|
+
def load_gemspec_uncached(file, validate = false)
|
429
|
+
path = Pathname.new(file)
|
430
|
+
contents = read_file(file)
|
431
|
+
spec = if contents.start_with?("---") # YAML header
|
432
|
+
eval_yaml_gemspec(path, contents)
|
433
|
+
else
|
434
|
+
# Eval the gemspec from its parent directory, because some gemspecs
|
435
|
+
# depend on "./" relative paths.
|
436
|
+
SharedHelpers.chdir(path.dirname.to_s) do
|
437
|
+
eval_gemspec(path, contents)
|
438
|
+
end
|
439
|
+
end
|
440
|
+
return unless spec
|
441
|
+
spec.loaded_from = path.expand_path.to_s
|
442
|
+
Bundler.rubygems.validate(spec) if validate
|
443
|
+
spec
|
444
|
+
end
|
445
|
+
|
446
|
+
def clear_gemspec_cache
|
447
|
+
@gemspec_cache = {}
|
448
|
+
end
|
449
|
+
|
450
|
+
def git_present?
|
451
|
+
return @git_present if defined?(@git_present)
|
452
|
+
@git_present = Bundler.which("git") || Bundler.which("git.exe")
|
453
|
+
end
|
454
|
+
|
455
|
+
def feature_flag
|
456
|
+
@feature_flag ||= FeatureFlag.new(VERSION)
|
457
|
+
end
|
458
|
+
|
459
|
+
def reset!
|
460
|
+
reset_paths!
|
461
|
+
Plugin.reset!
|
462
|
+
reset_rubygems!
|
463
|
+
end
|
464
|
+
|
465
|
+
def reset_paths!
|
466
|
+
@bin_path = nil
|
467
|
+
@bundler_major_version = nil
|
468
|
+
@bundle_path = nil
|
469
|
+
@configured = nil
|
470
|
+
@configured_bundle_path = nil
|
471
|
+
@definition = nil
|
472
|
+
@load = nil
|
473
|
+
@locked_gems = nil
|
474
|
+
@root = nil
|
475
|
+
@settings = nil
|
476
|
+
@setup = nil
|
477
|
+
@user_home = nil
|
478
|
+
end
|
479
|
+
|
480
|
+
def reset_rubygems!
|
481
|
+
return unless defined?(@rubygems) && @rubygems
|
482
|
+
rubygems.undo_replacements
|
483
|
+
rubygems.reset
|
484
|
+
@rubygems = nil
|
485
|
+
end
|
486
|
+
|
487
|
+
private
|
488
|
+
|
489
|
+
def eval_yaml_gemspec(path, contents)
|
490
|
+
Kernel.send(:require, "bundler/psyched_yaml")
|
491
|
+
|
492
|
+
# If the YAML is invalid, Syck raises an ArgumentError, and Psych
|
493
|
+
# raises a Psych::SyntaxError. See psyched_yaml.rb for more info.
|
494
|
+
Gem::Specification.from_yaml(contents)
|
495
|
+
rescue YamlLibrarySyntaxError, ArgumentError, Gem::EndOfYAMLException, Gem::Exception
|
496
|
+
eval_gemspec(path, contents)
|
497
|
+
end
|
498
|
+
|
499
|
+
def eval_gemspec(path, contents)
|
500
|
+
eval(contents, TOPLEVEL_BINDING.dup, path.expand_path.to_s)
|
501
|
+
rescue ScriptError, StandardError => e
|
502
|
+
msg = "There was an error while loading `#{path.basename}`: #{e.message}"
|
503
|
+
|
504
|
+
if e.is_a?(LoadError) && RUBY_VERSION >= "1.9"
|
505
|
+
msg += "\nDoes it try to require a relative path? That's been removed in Ruby 1.9"
|
506
|
+
end
|
507
|
+
|
508
|
+
raise GemspecError, Dsl::DSLError.new(msg, path, e.backtrace, contents)
|
509
|
+
end
|
510
|
+
|
511
|
+
def configure_gem_home_and_path
|
512
|
+
configure_gem_path
|
513
|
+
configure_gem_home
|
514
|
+
bundle_path
|
515
|
+
end
|
516
|
+
|
517
|
+
def configure_gem_path(env = ENV)
|
518
|
+
blank_home = env["GEM_HOME"].nil? || env["GEM_HOME"].empty?
|
519
|
+
if !use_system_gems?
|
520
|
+
# this needs to be empty string to cause
|
521
|
+
# PathSupport.split_gem_path to only load up the
|
522
|
+
# Bundler --path setting as the GEM_PATH.
|
523
|
+
env["GEM_PATH"] = ""
|
524
|
+
elsif blank_home
|
525
|
+
possibles = [Bundler.rubygems.gem_dir, Bundler.rubygems.gem_path]
|
526
|
+
paths = possibles.flatten.compact.uniq.reject(&:empty?)
|
527
|
+
env["GEM_PATH"] = paths.join(File::PATH_SEPARATOR)
|
528
|
+
end
|
529
|
+
end
|
530
|
+
|
531
|
+
def configure_gem_home
|
532
|
+
Bundler::SharedHelpers.set_env "GEM_HOME", File.expand_path(bundle_path, root)
|
533
|
+
Bundler.rubygems.clear_paths
|
534
|
+
end
|
535
|
+
|
536
|
+
# @param env [Hash]
|
537
|
+
def with_env(env)
|
538
|
+
backup = ENV.to_hash
|
539
|
+
ENV.replace(env)
|
540
|
+
yield
|
541
|
+
ensure
|
542
|
+
ENV.replace(backup)
|
543
|
+
end
|
544
|
+
end
|
545
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
bundle-add(1) -- Add gem to the Gemfile and run bundle install
|
2
|
+
================================================================
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
|
6
|
+
`bundle add` <GEM_NAME> [--group=GROUP] [--version=VERSION] [--source=SOURCE]
|
7
|
+
|
8
|
+
## DESCRIPTION
|
9
|
+
Adds the named gem to the Gemfile and run `bundle install`.
|
10
|
+
|
11
|
+
Example:
|
12
|
+
|
13
|
+
bundle add rails
|
14
|
+
|
15
|
+
bundle add rails --version "< 3.0, > 1.1"
|
16
|
+
|
17
|
+
bundle add rails --version "~> 5.0.0" --source "https://gems.example.com" --group "development"
|
18
|
+
|
19
|
+
bundle add rails --group "development, test"
|
20
|
+
|
21
|
+
## OPTIONS
|
22
|
+
* `--version`, `-v`:
|
23
|
+
Specify version requirements(s) for the added gem.
|
24
|
+
|
25
|
+
* `--group`, `-g`:
|
26
|
+
Specify the group(s) for the added gem. Multiple groups should be separated by commas.
|
27
|
+
|
28
|
+
* `--source`, , `-s`:
|
29
|
+
Specify the source for the added gem.
|
@@ -0,0 +1,43 @@
|
|
1
|
+
bundle-binstubs(1) -- Install the binstubs of the listed gems
|
2
|
+
=============================================================
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
|
6
|
+
`bundle binstubs` <GEM_NAME> [--force] [--path PATH] [--standalone]
|
7
|
+
|
8
|
+
## DESCRIPTION
|
9
|
+
|
10
|
+
Binstubs are scripts that wrap around executables. Bundler creates a
|
11
|
+
small Ruby file (a binstub) that loads Bundler, runs the command,
|
12
|
+
and puts it into `bin/`. Binstubs are a shortcut-or alternative-
|
13
|
+
to always using `bundle exec`. This gives you a file that can by run
|
14
|
+
directly, and one that will always run the correct gem version
|
15
|
+
used by the application.
|
16
|
+
|
17
|
+
For example, if you run `bundle binstubs rspec-core`, Bundler will create
|
18
|
+
the file `bin/rspec`. That file will contain enough code to load Bundler,
|
19
|
+
tell it to load the bundled gems, and then run rspec.
|
20
|
+
|
21
|
+
This command generates binstubs for executables in `GEM_NAME`.
|
22
|
+
Binstubs are put into `bin`, or the `--path` directory if one has been set.
|
23
|
+
Calling binstubs with [GEM [GEM]] will create binstubs for all given gems.
|
24
|
+
|
25
|
+
## OPTIONS
|
26
|
+
|
27
|
+
* `--force`:
|
28
|
+
Overwrite existing binstubs if they exist.
|
29
|
+
|
30
|
+
* `--path`:
|
31
|
+
The location to install the specified binstubs to. This defaults to `bin`.
|
32
|
+
|
33
|
+
* `--standalone`:
|
34
|
+
Makes binstubs that can work without depending on Rubygems or Bundler at
|
35
|
+
runtime.
|
36
|
+
|
37
|
+
* `--shebang`:
|
38
|
+
Specify a different shebang executable name than the default (default 'ruby')
|
39
|
+
|
40
|
+
## BUNDLE INSTALL --BINSTUBS
|
41
|
+
|
42
|
+
To create binstubs for all the gems in the bundle you can use the `--binstubs`
|
43
|
+
flag in [bundle install(1)][bundle-install(1)].
|
@@ -0,0 +1,26 @@
|
|
1
|
+
bundle-check(1) -- Verifies if dependencies are satisfied by installed gems
|
2
|
+
===========================================================================
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
|
6
|
+
`bundle check` [--dry-run]
|
7
|
+
[--gemfile=FILE]
|
8
|
+
[--path=PATH]
|
9
|
+
|
10
|
+
## DESCRIPTION
|
11
|
+
|
12
|
+
`check` searches the local machine for each of the gems requested in the
|
13
|
+
Gemfile. If all gems are found, Bundler prints a success message and exits with
|
14
|
+
a status of 0.
|
15
|
+
|
16
|
+
If not, the first missing gem is listed and Bundler exits status 1.
|
17
|
+
|
18
|
+
## OPTIONS
|
19
|
+
|
20
|
+
* `--dry-run`:
|
21
|
+
Locks the [`Gemfile(5)`][Gemfile(5)] before running the command.
|
22
|
+
* `--gemfile`:
|
23
|
+
Use the specified gemfile instead of the [`Gemfile(5)`][Gemfile(5)].
|
24
|
+
* `--path`:
|
25
|
+
Specify a different path than the system default (`$BUNDLE_PATH` or `$GEM_HOME`).
|
26
|
+
Bundler will remember this value for future installs on this machine.
|
@@ -0,0 +1,18 @@
|
|
1
|
+
bundle-clean(1) -- Cleans up unused gems in your bundler directory
|
2
|
+
==================================================================
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
|
6
|
+
`bundle clean` [--dry-run] [--force]
|
7
|
+
|
8
|
+
## DESCRIPTION
|
9
|
+
|
10
|
+
This command will remove all unused gems in your bundler directory. This is
|
11
|
+
useful when you have made many changes to your gem dependencies.
|
12
|
+
|
13
|
+
## OPTIONS
|
14
|
+
|
15
|
+
* `--dry-run`:
|
16
|
+
Print the changes, but do not clean the unused gems.
|
17
|
+
* `--force`:
|
18
|
+
Force a clean even if `--path` is not set.
|