rubygems-update 3.0.6 → 3.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/{History.txt → CHANGELOG.md} +1100 -436
- data/CODE_OF_CONDUCT.md +55 -19
- data/CONTRIBUTING.md +37 -10
- data/MAINTAINERS.txt +1 -6
- data/Manifest.txt +104 -64
- data/POLICIES.md +6 -12
- data/README.md +6 -6
- data/Rakefile +121 -111
- data/bin/gem +0 -6
- data/bin/update_rubygems +2 -2
- data/bundler/CHANGELOG.md +1788 -1251
- data/bundler/LICENSE.md +18 -19
- data/bundler/README.md +9 -10
- data/bundler/UPGRADING.md +215 -0
- data/bundler/bundler.gemspec +9 -26
- data/bundler/exe/bundle +22 -3
- data/bundler/lib/bundler.rb +233 -94
- data/bundler/lib/bundler/build_metadata.rb +5 -13
- data/bundler/lib/bundler/capistrano.rb +4 -4
- data/bundler/lib/bundler/cli.rb +221 -148
- data/bundler/lib/bundler/cli/add.rb +28 -16
- data/bundler/lib/bundler/cli/binstubs.rb +6 -2
- data/bundler/lib/bundler/cli/cache.rb +24 -17
- data/bundler/lib/bundler/cli/clean.rb +1 -1
- data/bundler/lib/bundler/cli/common.rb +25 -12
- data/bundler/lib/bundler/cli/config.rb +161 -86
- data/bundler/lib/bundler/cli/console.rb +1 -1
- data/bundler/lib/bundler/cli/doctor.rb +5 -5
- data/bundler/lib/bundler/cli/exec.rb +8 -20
- data/bundler/lib/bundler/cli/fund.rb +36 -0
- data/bundler/lib/bundler/cli/gem.rb +125 -32
- data/bundler/lib/bundler/cli/info.rb +29 -6
- data/bundler/lib/bundler/cli/init.rb +2 -2
- data/bundler/lib/bundler/cli/inject.rb +1 -1
- data/bundler/lib/bundler/cli/install.rb +27 -23
- data/bundler/lib/bundler/cli/issue.rb +5 -5
- data/bundler/lib/bundler/cli/list.rb +12 -10
- data/bundler/lib/bundler/cli/open.rb +10 -6
- data/bundler/lib/bundler/cli/outdated.rb +134 -109
- data/bundler/lib/bundler/cli/plugin.rb +19 -2
- data/bundler/lib/bundler/cli/pristine.rb +6 -1
- data/bundler/lib/bundler/cli/show.rb +2 -2
- data/bundler/lib/bundler/cli/update.rb +34 -12
- data/bundler/lib/bundler/compact_index_client.rb +26 -10
- data/bundler/lib/bundler/compact_index_client/cache.rb +6 -14
- data/bundler/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/bundler/lib/bundler/compact_index_client/updater.rb +8 -20
- data/bundler/lib/bundler/current_ruby.rb +9 -7
- data/bundler/lib/bundler/definition.rb +133 -132
- data/bundler/lib/bundler/dep_proxy.rb +16 -9
- data/bundler/lib/bundler/dependency.rb +19 -14
- data/bundler/lib/bundler/deployment.rb +1 -1
- data/bundler/lib/bundler/dsl.rb +54 -71
- data/bundler/lib/bundler/endpoint_specification.rb +1 -1
- data/bundler/lib/bundler/env.rb +9 -14
- data/bundler/lib/bundler/environment_preserver.rb +26 -3
- data/bundler/lib/bundler/errors.rb +1 -0
- data/bundler/lib/bundler/feature_flag.rb +19 -34
- data/bundler/lib/bundler/fetcher.rb +19 -16
- data/bundler/lib/bundler/fetcher/base.rb +1 -1
- data/bundler/lib/bundler/fetcher/compact_index.rb +27 -13
- data/bundler/lib/bundler/fetcher/dependency.rb +1 -1
- data/bundler/lib/bundler/fetcher/downloader.rb +6 -3
- data/bundler/lib/bundler/fetcher/index.rb +8 -7
- data/bundler/lib/bundler/friendly_errors.rb +27 -19
- data/bundler/lib/bundler/gem_helper.rb +68 -37
- data/bundler/lib/bundler/gem_helpers.rb +38 -29
- data/bundler/lib/bundler/gem_tasks.rb +1 -1
- data/bundler/lib/bundler/gem_version_promoter.rb +5 -5
- data/bundler/lib/bundler/graph.rb +3 -3
- data/bundler/lib/bundler/index.rb +12 -7
- data/bundler/lib/bundler/injector.rb +32 -12
- data/bundler/lib/bundler/inline.rb +41 -30
- data/bundler/lib/bundler/installer.rb +41 -60
- data/bundler/lib/bundler/installer/gem_installer.rb +8 -4
- data/bundler/lib/bundler/installer/parallel_installer.rb +20 -26
- data/bundler/lib/bundler/installer/standalone.rb +18 -4
- data/bundler/lib/bundler/lazy_specification.rb +41 -27
- data/bundler/lib/bundler/lockfile_generator.rb +1 -1
- data/bundler/lib/bundler/lockfile_parser.rb +16 -33
- data/bundler/lib/bundler/{ssl_certs → man}/.document +0 -0
- data/bundler/lib/bundler/man/bundle-add.1 +66 -0
- data/bundler/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +7 -1
- data/bundler/lib/bundler/man/bundle-binstubs.1 +42 -0
- data/bundler/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +3 -5
- data/bundler/lib/bundler/man/bundle-cache.1 +55 -0
- data/bundler/{man/bundle-package.ronn → lib/bundler/man/bundle-cache.1.ronn} +15 -15
- data/bundler/lib/bundler/man/bundle-check.1 +31 -0
- data/bundler/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
- data/bundler/lib/bundler/man/bundle-clean.1 +24 -0
- data/bundler/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +0 -0
- data/bundler/lib/bundler/man/bundle-config.1 +488 -0
- data/bundler/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +59 -67
- data/bundler/lib/bundler/man/bundle-doctor.1 +44 -0
- data/bundler/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
- data/bundler/lib/bundler/man/bundle-exec.1 +165 -0
- data/bundler/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +1 -1
- data/bundler/lib/bundler/man/bundle-gem.1 +102 -0
- data/bundler/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +30 -7
- data/bundler/lib/bundler/man/bundle-info.1 +20 -0
- data/bundler/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
- data/bundler/lib/bundler/man/bundle-init.1 +25 -0
- data/bundler/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +1 -1
- data/bundler/lib/bundler/man/bundle-inject.1 +33 -0
- data/bundler/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +0 -0
- data/bundler/lib/bundler/man/bundle-install.1 +338 -0
- data/bundler/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +34 -7
- data/bundler/lib/bundler/man/bundle-list.1 +50 -0
- data/bundler/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +6 -6
- data/bundler/lib/bundler/man/bundle-lock.1 +84 -0
- data/bundler/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
- data/bundler/lib/bundler/man/bundle-open.1 +32 -0
- data/bundler/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
- data/bundler/lib/bundler/man/bundle-outdated.1 +155 -0
- data/bundler/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +0 -0
- data/bundler/lib/bundler/man/bundle-platform.1 +61 -0
- data/bundler/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +0 -0
- data/bundler/lib/bundler/man/bundle-pristine.1 +34 -0
- data/bundler/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
- data/bundler/lib/bundler/man/bundle-remove.1 +31 -0
- data/bundler/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
- data/bundler/lib/bundler/man/bundle-show.1 +23 -0
- data/bundler/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
- data/bundler/lib/bundler/man/bundle-update.1 +394 -0
- data/bundler/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +3 -3
- data/bundler/lib/bundler/man/bundle-viz.1 +39 -0
- data/bundler/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +0 -0
- data/bundler/lib/bundler/man/bundle.1 +136 -0
- data/bundler/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +2 -2
- data/bundler/lib/bundler/man/gemfile.5 +686 -0
- data/bundler/{man → lib/bundler/man}/gemfile.5.ronn +16 -20
- data/bundler/lib/bundler/man/index.txt +25 -0
- data/bundler/lib/bundler/match_platform.rb +1 -1
- data/bundler/lib/bundler/mirror.rb +5 -5
- data/bundler/lib/bundler/plugin.rb +75 -36
- data/bundler/lib/bundler/plugin/api.rb +1 -1
- data/bundler/lib/bundler/plugin/api/source.rb +12 -7
- data/bundler/lib/bundler/plugin/dsl.rb +1 -1
- data/bundler/lib/bundler/plugin/index.rb +24 -4
- data/bundler/lib/bundler/plugin/installer.rb +33 -22
- data/bundler/lib/bundler/plugin/installer/rubygems.rb +1 -1
- data/bundler/lib/bundler/plugin/source_list.rb +5 -1
- data/bundler/lib/bundler/psyched_yaml.rb +0 -15
- data/bundler/lib/bundler/remote_specification.rb +5 -4
- data/bundler/lib/bundler/resolver.rb +191 -87
- data/bundler/lib/bundler/resolver/spec_group.rb +76 -48
- data/bundler/lib/bundler/retry.rb +3 -3
- data/bundler/lib/bundler/ruby_version.rb +5 -20
- data/bundler/lib/bundler/rubygems_ext.rb +76 -72
- data/bundler/lib/bundler/rubygems_gem_installer.rb +47 -13
- data/bundler/lib/bundler/rubygems_integration.rb +159 -444
- data/bundler/lib/bundler/runtime.rb +6 -23
- data/bundler/lib/bundler/settings.rb +67 -93
- data/bundler/lib/bundler/setup.rb +11 -12
- data/bundler/lib/bundler/shared_helpers.rb +54 -80
- data/bundler/lib/bundler/similarity_detector.rb +3 -3
- data/bundler/lib/bundler/source.rb +12 -6
- data/bundler/lib/bundler/source/git.rb +47 -38
- data/bundler/lib/bundler/source/git/git_proxy.rb +101 -102
- data/bundler/lib/bundler/source/metadata.rb +7 -6
- data/bundler/lib/bundler/source/path.rb +20 -11
- data/bundler/lib/bundler/source/path/installer.rb +10 -10
- data/bundler/lib/bundler/source/rubygems.rb +56 -29
- data/bundler/lib/bundler/source/rubygems/remote.rb +3 -4
- data/bundler/lib/bundler/source_list.rb +32 -30
- data/bundler/lib/bundler/spec_set.rb +37 -25
- data/bundler/lib/bundler/stub_specification.rb +40 -34
- data/bundler/lib/bundler/templates/Executable.bundler +23 -14
- data/bundler/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +57 -47
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +16 -2
- data/bundler/lib/bundler/templates/newgem/README.md.tt +7 -5
- data/bundler/lib/bundler/templates/newgem/Rakefile.tt +19 -5
- data/bundler/lib/bundler/templates/newgem/bin/console.tt +1 -0
- data/bundler/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +18 -0
- data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +4 -2
- data/bundler/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +18 -31
- data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
- data/bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -1
- data/bundler/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +2 -0
- data/bundler/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
- data/bundler/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- data/bundler/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- data/bundler/lib/bundler/templates/newgem/travis.yml.tt +0 -1
- data/bundler/lib/bundler/ui.rb +3 -3
- data/bundler/lib/bundler/ui/rg_proxy.rb +1 -1
- data/bundler/lib/bundler/ui/shell.rb +7 -11
- data/bundler/lib/bundler/uri_credentials_filter.rb +10 -4
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +161 -0
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +66 -0
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +176 -0
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +273 -147
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +5 -6
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +36 -4
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +6 -6
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +3 -3
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +39 -11
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +4 -4
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +11 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +53 -51
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +2 -2
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +302 -462
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +40 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +53 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +16 -9
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +28 -13
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +3 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +7 -17
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +20 -9
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +19 -8
- data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +63 -43
- data/bundler/lib/bundler/vendor/thor/lib/thor/command.rb +21 -14
- data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +78 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +3 -3
- data/bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
- data/bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +7 -3
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +20 -7
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +21 -5
- data/bundler/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +15 -14
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell.rb +4 -4
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +65 -8
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +10 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +3 -3
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +18 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/bundler/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/bundler/lib/bundler/vendored_fileutils.rb +1 -6
- data/bundler/lib/bundler/vendored_molinillo.rb +1 -1
- data/bundler/lib/bundler/vendored_persistent.rb +7 -12
- data/bundler/lib/bundler/vendored_thor.rb +2 -2
- data/bundler/lib/bundler/vendored_tmpdir.rb +4 -0
- data/bundler/lib/bundler/vendored_uri.rb +4 -0
- data/bundler/lib/bundler/version.rb +1 -20
- data/bundler/lib/bundler/version_ranges.rb +51 -5
- data/bundler/lib/bundler/vlad.rb +2 -2
- data/bundler/lib/bundler/worker.rb +2 -4
- data/bundler/lib/bundler/yaml_serializer.rb +3 -4
- data/lib/rubygems.rb +198 -222
- data/lib/rubygems/available_set.rb +4 -5
- data/lib/rubygems/basic_specification.rb +32 -19
- data/lib/rubygems/bundler_version_finder.rb +19 -9
- data/lib/rubygems/command.rb +73 -21
- data/lib/rubygems/command_manager.rb +5 -12
- data/lib/rubygems/commands/build_command.rb +51 -18
- data/lib/rubygems/commands/cert_command.rb +2 -11
- data/lib/rubygems/commands/check_command.rb +0 -2
- data/lib/rubygems/commands/cleanup_command.rb +17 -13
- data/lib/rubygems/commands/contents_command.rb +7 -9
- data/lib/rubygems/commands/dependency_command.rb +9 -10
- data/lib/rubygems/commands/environment_command.rb +1 -6
- data/lib/rubygems/commands/fetch_command.rb +2 -4
- data/lib/rubygems/commands/generate_index_command.rb +3 -2
- data/lib/rubygems/commands/help_command.rb +4 -4
- data/lib/rubygems/commands/info_command.rb +9 -4
- data/lib/rubygems/commands/install_command.rb +12 -54
- data/lib/rubygems/commands/list_command.rb +8 -7
- data/lib/rubygems/commands/lock_command.rb +3 -5
- data/lib/rubygems/commands/mirror_command.rb +0 -1
- data/lib/rubygems/commands/open_command.rb +1 -4
- data/lib/rubygems/commands/outdated_command.rb +0 -1
- data/lib/rubygems/commands/owner_command.rb +10 -10
- data/lib/rubygems/commands/pristine_command.rb +13 -9
- data/lib/rubygems/commands/push_command.rb +12 -51
- data/lib/rubygems/commands/query_command.rb +14 -330
- data/lib/rubygems/commands/rdoc_command.rb +0 -1
- data/lib/rubygems/commands/search_command.rb +7 -7
- data/lib/rubygems/commands/server_command.rb +3 -1
- data/lib/rubygems/commands/setup_command.rb +143 -101
- data/lib/rubygems/commands/signin_command.rb +0 -1
- data/lib/rubygems/commands/signout_command.rb +0 -2
- data/lib/rubygems/commands/sources_command.rb +22 -6
- data/lib/rubygems/commands/specification_command.rb +8 -3
- data/lib/rubygems/commands/stale_command.rb +1 -1
- data/lib/rubygems/commands/uninstall_command.rb +2 -3
- data/lib/rubygems/commands/unpack_command.rb +3 -32
- data/lib/rubygems/commands/update_command.rb +73 -28
- data/lib/rubygems/commands/which_command.rb +0 -1
- data/lib/rubygems/commands/yank_command.rb +10 -7
- data/lib/rubygems/compatibility.rb +4 -4
- data/lib/rubygems/config_file.rb +48 -27
- data/lib/rubygems/core_ext/kernel_gem.rb +7 -6
- data/lib/rubygems/core_ext/kernel_require.rb +44 -6
- data/lib/rubygems/core_ext/kernel_warn.rb +22 -13
- data/lib/rubygems/core_ext/tcpsocket_init.rb +52 -0
- data/lib/rubygems/defaults.rb +110 -23
- data/lib/rubygems/dependency.rb +28 -14
- data/lib/rubygems/dependency_installer.rb +11 -166
- data/lib/rubygems/dependency_list.rb +17 -18
- data/lib/rubygems/deprecate.rb +51 -6
- data/lib/rubygems/doctor.rb +4 -4
- data/lib/rubygems/errors.rb +5 -7
- data/lib/rubygems/exceptions.rb +2 -24
- data/lib/rubygems/ext.rb +6 -6
- data/lib/rubygems/ext/build_error.rb +2 -0
- data/lib/rubygems/ext/builder.rb +45 -82
- data/lib/rubygems/ext/cmake_builder.rb +6 -7
- data/lib/rubygems/ext/configure_builder.rb +5 -8
- data/lib/rubygems/ext/ext_conf_builder.rb +27 -23
- data/lib/rubygems/ext/rake_builder.rb +4 -6
- data/lib/rubygems/gem_runner.rb +3 -10
- data/lib/rubygems/gemcutter_utilities.rb +111 -37
- data/lib/rubygems/indexer.rb +9 -26
- data/lib/rubygems/install_update_options.rb +7 -7
- data/lib/rubygems/installer.rb +91 -98
- data/lib/rubygems/installer_test_case.rb +104 -42
- data/lib/rubygems/installer_uninstaller_utils.rb +29 -0
- data/lib/rubygems/local_remote_options.rb +1 -1
- data/lib/rubygems/mock_gem_ui.rb +1 -4
- data/lib/rubygems/name_tuple.rb +4 -7
- data/lib/rubygems/openssl.rb +7 -0
- data/lib/rubygems/package.rb +49 -32
- data/lib/rubygems/package/digest_io.rb +0 -2
- data/lib/rubygems/package/file_source.rb +0 -2
- data/lib/rubygems/package/io_source.rb +0 -2
- data/lib/rubygems/package/old.rb +1 -3
- data/lib/rubygems/package/tar_header.rb +4 -6
- data/lib/rubygems/package/tar_reader.rb +15 -12
- data/lib/rubygems/package/tar_reader/entry.rb +0 -3
- data/lib/rubygems/package/tar_test_case.rb +2 -4
- data/lib/rubygems/package/tar_writer.rb +6 -16
- data/lib/rubygems/package_task.rb +1 -7
- data/lib/rubygems/path_support.rb +2 -2
- data/lib/rubygems/platform.rb +22 -16
- data/lib/rubygems/query_utils.rb +353 -0
- data/lib/rubygems/rdoc.rb +0 -12
- data/lib/rubygems/remote_fetcher.rb +33 -59
- data/lib/rubygems/request.rb +11 -14
- data/lib/rubygems/request/connection_pools.rb +3 -7
- data/lib/rubygems/request/http_pool.rb +0 -1
- data/lib/rubygems/request_set.rb +10 -23
- data/lib/rubygems/request_set/gem_dependency_api.rb +9 -11
- data/lib/rubygems/request_set/lockfile.rb +13 -12
- data/lib/rubygems/request_set/lockfile/parser.rb +2 -2
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +1 -1
- data/lib/rubygems/requirement.rb +36 -35
- data/lib/rubygems/resolver.rb +20 -16
- data/lib/rubygems/resolver/activation_request.rb +27 -51
- data/lib/rubygems/resolver/api_set.rb +31 -24
- data/lib/rubygems/resolver/api_set/gem_parser.rb +20 -0
- data/lib/rubygems/resolver/api_specification.rb +24 -10
- data/lib/rubygems/resolver/best_set.rb +4 -6
- data/lib/rubygems/resolver/composed_set.rb +3 -5
- data/lib/rubygems/resolver/conflict.rb +2 -9
- data/lib/rubygems/resolver/current_set.rb +0 -2
- data/lib/rubygems/resolver/dependency_request.rb +1 -3
- data/lib/rubygems/resolver/git_set.rb +0 -2
- data/lib/rubygems/resolver/git_specification.rb +0 -2
- data/lib/rubygems/resolver/index_set.rb +1 -3
- data/lib/rubygems/resolver/index_specification.rb +32 -2
- data/lib/rubygems/resolver/installed_specification.rb +0 -2
- data/lib/rubygems/resolver/installer_set.rb +63 -16
- data/lib/rubygems/resolver/local_specification.rb +0 -2
- data/lib/rubygems/resolver/lock_set.rb +3 -5
- data/lib/rubygems/resolver/lock_specification.rb +2 -4
- data/lib/rubygems/resolver/molinillo/lib/molinillo.rb +6 -5
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +7 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb +8 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +39 -6
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb +1 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb +7 -6
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb +4 -3
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +51 -12
- data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +76 -8
- data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb +12 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb +3 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +510 -165
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb +3 -2
- data/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb +8 -4
- data/lib/rubygems/resolver/requirement_list.rb +0 -1
- data/lib/rubygems/resolver/set.rb +0 -2
- data/lib/rubygems/resolver/source_set.rb +0 -2
- data/lib/rubygems/resolver/spec_specification.rb +14 -2
- data/lib/rubygems/resolver/specification.rb +13 -2
- data/lib/rubygems/resolver/vendor_set.rb +0 -2
- data/lib/rubygems/resolver/vendor_specification.rb +0 -2
- data/lib/rubygems/s3_uri_signer.rb +15 -13
- data/lib/rubygems/safe_yaml.rb +4 -4
- data/lib/rubygems/security.rb +27 -34
- data/lib/rubygems/security/policy.rb +4 -8
- data/lib/rubygems/security/signer.rb +8 -9
- data/lib/rubygems/security/trust_dir.rb +1 -3
- data/lib/rubygems/server.rb +20 -16
- data/lib/rubygems/source.rb +30 -13
- data/lib/rubygems/source/git.rb +7 -8
- data/lib/rubygems/source/installed.rb +0 -2
- data/lib/rubygems/source/local.rb +2 -4
- data/lib/rubygems/source/lock.rb +0 -2
- data/lib/rubygems/source/specific_file.rb +0 -2
- data/lib/rubygems/source/vendor.rb +0 -2
- data/lib/rubygems/source_list.rb +6 -6
- data/lib/rubygems/spec_fetcher.rb +22 -34
- data/lib/rubygems/specification.rb +207 -278
- data/lib/rubygems/specification_policy.rb +135 -57
- data/{bundler/lib/bundler/ssl_certs/index.rubygems.org → lib/rubygems/ssl_certs/rubygems.org}/GlobalSignRootCA.pem +0 -0
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +21 -0
- data/lib/rubygems/stub_specification.rb +4 -5
- data/lib/rubygems/test_case.rb +221 -341
- data/lib/rubygems/test_utilities.rb +22 -18
- data/lib/rubygems/text.rb +2 -3
- data/lib/rubygems/uninstaller.rb +49 -30
- data/lib/rubygems/uri_formatter.rb +2 -4
- data/lib/rubygems/uri_parser.rb +34 -0
- data/lib/rubygems/uri_parsing.rb +23 -0
- data/lib/rubygems/user_interaction.rb +3 -20
- data/lib/rubygems/util.rb +20 -44
- data/lib/rubygems/util/licenses.rb +400 -400
- data/lib/rubygems/validator.rb +9 -31
- data/lib/rubygems/version.rb +29 -21
- data/lib/rubygems/version_option.rb +6 -0
- data/rubygems-update.gemspec +4 -11
- data/setup.rb +2 -7
- data/test/rubygems/data/null-required-ruby-version.gemspec.rz +0 -0
- data/test/rubygems/data/null-required-rubygems-version.gemspec.rz +0 -0
- data/test/rubygems/rubygems/commands/crash_command.rb +0 -2
- data/test/rubygems/rubygems_plugin.rb +0 -2
- data/test/rubygems/specifications/bar-0.0.2.gemspec +0 -2
- data/test/rubygems/specifications/rubyforge-0.0.1.gemspec +12 -0
- data/test/rubygems/test_bundled_ca.rb +42 -45
- data/test/rubygems/test_config.rb +0 -2
- data/test/rubygems/test_deprecate.rb +41 -5
- data/test/rubygems/test_gem.rb +405 -236
- data/test/rubygems/test_gem_available_set.rb +5 -6
- data/test/rubygems/test_gem_bundler_version_finder.rb +20 -2
- data/test/rubygems/test_gem_command.rb +144 -9
- data/test/rubygems/test_gem_command_manager.rb +40 -17
- data/test/rubygems/test_gem_commands_build_command.rb +386 -13
- data/test/rubygems/test_gem_commands_cert_command.rb +18 -6
- data/test/rubygems/test_gem_commands_check_command.rb +0 -2
- data/test/rubygems/test_gem_commands_cleanup_command.rb +35 -10
- data/test/rubygems/test_gem_commands_contents_command.rb +50 -19
- data/test/rubygems/test_gem_commands_dependency_command.rb +1 -3
- data/test/rubygems/test_gem_commands_environment_command.rb +21 -33
- data/test/rubygems/test_gem_commands_fetch_command.rb +0 -2
- data/test/rubygems/test_gem_commands_generate_index_command.rb +32 -2
- data/test/rubygems/test_gem_commands_help_command.rb +16 -8
- data/test/rubygems/test_gem_commands_info_command.rb +6 -7
- data/test/rubygems/test_gem_commands_install_command.rb +368 -34
- data/test/rubygems/test_gem_commands_list_command.rb +0 -2
- data/test/rubygems/test_gem_commands_lock_command.rb +0 -2
- data/test/rubygems/test_gem_commands_mirror.rb +1 -2
- data/test/rubygems/test_gem_commands_open_command.rb +4 -6
- data/test/rubygems/test_gem_commands_outdated_command.rb +18 -1
- data/test/rubygems/test_gem_commands_owner_command.rb +62 -9
- data/test/rubygems/test_gem_commands_pristine_command.rb +148 -16
- data/test/rubygems/test_gem_commands_push_command.rb +94 -21
- data/test/rubygems/test_gem_commands_query_command.rb +35 -10
- data/test/rubygems/test_gem_commands_search_command.rb +0 -2
- data/test/rubygems/test_gem_commands_server_command.rb +6 -4
- data/test/rubygems/test_gem_commands_setup_command.rb +228 -128
- data/test/rubygems/test_gem_commands_signin_command.rb +36 -11
- data/test/rubygems/test_gem_commands_signout_command.rb +0 -7
- data/test/rubygems/test_gem_commands_sources_command.rb +193 -9
- data/test/rubygems/test_gem_commands_specification_command.rb +46 -20
- data/test/rubygems/test_gem_commands_stale_command.rb +0 -2
- data/test/rubygems/test_gem_commands_uninstall_command.rb +108 -52
- data/test/rubygems/test_gem_commands_unpack_command.rb +0 -2
- data/test/rubygems/test_gem_commands_update_command.rb +201 -29
- data/test/rubygems/test_gem_commands_which_command.rb +3 -5
- data/test/rubygems/test_gem_commands_yank_command.rb +86 -5
- data/test/rubygems/test_gem_config_file.rb +25 -13
- data/test/rubygems/test_gem_dependency.rb +6 -2
- data/test/rubygems/test_gem_dependency_installer.rb +169 -252
- data/test/rubygems/test_gem_dependency_list.rb +31 -26
- data/test/rubygems/test_gem_dependency_resolution_error.rb +1 -3
- data/test/rubygems/test_gem_doctor.rb +28 -2
- data/test/rubygems/test_gem_ext_builder.rb +51 -44
- data/test/rubygems/test_gem_ext_cmake_builder.rb +16 -23
- data/test/rubygems/test_gem_ext_configure_builder.rb +6 -14
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +21 -29
- data/test/rubygems/test_gem_ext_rake_builder.rb +39 -22
- data/test/rubygems/test_gem_gem_runner.rb +47 -2
- data/test/rubygems/test_gem_gemcutter_utilities.rb +16 -13
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +0 -2
- data/test/rubygems/test_gem_indexer.rb +40 -55
- data/test/rubygems/test_gem_install_update_options.rb +45 -21
- data/test/rubygems/test_gem_installer.rb +661 -338
- data/test/rubygems/test_gem_local_remote_options.rb +0 -2
- data/test/rubygems/test_gem_name_tuple.rb +0 -2
- data/test/rubygems/test_gem_package.rb +132 -45
- data/test/rubygems/test_gem_package_old.rb +56 -55
- data/test/rubygems/test_gem_package_tar_header.rb +18 -1
- data/test/rubygems/test_gem_package_tar_reader.rb +0 -2
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +6 -7
- data/test/rubygems/test_gem_package_tar_writer.rb +20 -12
- data/test/rubygems/test_gem_package_task.rb +46 -13
- data/test/rubygems/test_gem_path_support.rb +17 -13
- data/test/rubygems/test_gem_platform.rb +74 -7
- data/test/rubygems/test_gem_rdoc.rb +0 -1
- data/test/rubygems/test_gem_remote_fetcher.rb +223 -209
- data/test/rubygems/test_gem_request.rb +30 -19
- data/test/rubygems/test_gem_request_connection_pools.rb +2 -2
- data/test/rubygems/test_gem_request_set.rb +104 -29
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +4 -6
- data/test/rubygems/test_gem_request_set_lockfile.rb +4 -5
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +9 -10
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +118 -118
- data/test/rubygems/test_gem_requirement.rb +50 -4
- data/test/rubygems/test_gem_resolver.rb +73 -31
- data/test/rubygems/test_gem_resolver_activation_request.rb +3 -34
- data/test/rubygems/test_gem_resolver_api_set.rb +60 -59
- data/test/rubygems/test_gem_resolver_api_specification.rb +3 -5
- data/test/rubygems/test_gem_resolver_best_set.rb +27 -6
- data/test/rubygems/test_gem_resolver_composed_set.rb +0 -2
- data/test/rubygems/test_gem_resolver_conflict.rb +1 -7
- data/test/rubygems/test_gem_resolver_dependency_request.rb +0 -2
- data/test/rubygems/test_gem_resolver_git_set.rb +0 -2
- data/test/rubygems/test_gem_resolver_git_specification.rb +1 -2
- data/test/rubygems/test_gem_resolver_index_set.rb +2 -4
- data/test/rubygems/test_gem_resolver_index_specification.rb +7 -4
- data/test/rubygems/test_gem_resolver_installed_specification.rb +0 -3
- data/test/rubygems/test_gem_resolver_installer_set.rb +10 -10
- data/test/rubygems/test_gem_resolver_local_specification.rb +0 -2
- data/test/rubygems/test_gem_resolver_lock_set.rb +3 -5
- data/test/rubygems/test_gem_resolver_lock_specification.rb +0 -2
- data/test/rubygems/test_gem_resolver_requirement_list.rb +0 -2
- data/test/rubygems/test_gem_resolver_specification.rb +0 -2
- data/test/rubygems/test_gem_resolver_vendor_set.rb +1 -3
- data/test/rubygems/test_gem_resolver_vendor_specification.rb +0 -2
- data/test/rubygems/test_gem_security.rb +27 -25
- data/test/rubygems/test_gem_security_policy.rb +7 -12
- data/test/rubygems/test_gem_security_signer.rb +11 -12
- data/test/rubygems/test_gem_security_trust_dir.rb +4 -6
- data/test/rubygems/test_gem_server.rb +13 -12
- data/test/rubygems/test_gem_silent_ui.rb +0 -1
- data/test/rubygems/test_gem_source.rb +32 -17
- data/test/rubygems/test_gem_source_fetch_problem.rb +0 -1
- data/test/rubygems/test_gem_source_git.rb +12 -18
- data/test/rubygems/test_gem_source_installed.rb +11 -13
- data/test/rubygems/test_gem_source_list.rb +1 -1
- data/test/rubygems/test_gem_source_local.rb +8 -9
- data/test/rubygems/test_gem_source_lock.rb +17 -19
- data/test/rubygems/test_gem_source_specific_file.rb +9 -10
- data/test/rubygems/test_gem_source_subpath_problem.rb +49 -0
- data/test/rubygems/test_gem_source_vendor.rb +7 -9
- data/test/rubygems/test_gem_spec_fetcher.rb +11 -4
- data/test/rubygems/test_gem_specification.rb +363 -245
- data/test/rubygems/test_gem_stream_ui.rb +3 -1
- data/test/rubygems/test_gem_stub_specification.rb +6 -7
- data/test/rubygems/test_gem_text.rb +1 -2
- data/test/rubygems/test_gem_uninstaller.rb +165 -22
- data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +0 -2
- data/test/rubygems/test_gem_uri_formatter.rb +0 -2
- data/test/rubygems/test_gem_util.rb +17 -15
- data/test/rubygems/test_gem_validator.rb +4 -7
- data/test/rubygems/test_gem_version.rb +23 -10
- data/test/rubygems/test_gem_version_option.rb +1 -3
- data/test/rubygems/test_kernel.rb +25 -9
- data/test/rubygems/test_project_sanity.rb +20 -0
- data/test/rubygems/test_remote_fetch_error.rb +1 -2
- data/test/rubygems/test_require.rb +394 -56
- data/test/test_changelog_generator.rb +17 -0
- metadata +109 -155
- data/.rubocop.yml +0 -67
- data/.travis.yml +0 -38
- data/appveyor.yml +0 -43
- data/bundler/CODE_OF_CONDUCT.md +0 -42
- data/bundler/CONTRIBUTING.md +0 -17
- data/bundler/exe/bundle_ruby +0 -60
- data/bundler/lib/bundler/cli/package.rb +0 -49
- data/bundler/lib/bundler/compatibility_guard.rb +0 -14
- data/bundler/lib/bundler/gem_remote_fetcher.rb +0 -43
- data/bundler/lib/bundler/ssl_certs/certificate_manager.rb +0 -66
- data/bundler/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/bundler/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
- data/bundler/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb +0 -27
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb +0 -129
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -12
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -129
- data/lib/rubygems/source_local.rb +0 -7
- data/lib/rubygems/source_specific_file.rb +0 -6
- data/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +0 -21
- data/lib/rubygems/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
- data/lib/ubygems.rb +0 -14
- data/util/CL2notes +0 -55
- data/util/ci +0 -82
- data/util/cops/deprecations.rb +0 -52
- data/util/create_certs.rb +0 -171
- data/util/create_certs.sh +0 -27
- data/util/create_encrypted_key.rb +0 -16
- data/util/generate_spdx_license_list.rb +0 -61
- data/util/patch_with_prs.rb +0 -77
- data/util/rubocop +0 -8
- data/util/update_bundled_ca_certificates.rb +0 -139
- data/util/update_changelog.rb +0 -67
@@ -3,7 +3,6 @@ require 'rubygems/test_case'
|
|
3
3
|
require 'rubygems/source'
|
4
4
|
|
5
5
|
class TestGemSourceVendor < Gem::TestCase
|
6
|
-
|
7
6
|
def test_initialize
|
8
7
|
source = Gem::Source::Vendor.new 'vendor/foo'
|
9
8
|
|
@@ -16,16 +15,15 @@ class TestGemSourceVendor < Gem::TestCase
|
|
16
15
|
git = Gem::Source::Git.new 'a', 'a', 'master'
|
17
16
|
installed = Gem::Source::Installed.new
|
18
17
|
|
19
|
-
assert_equal(
|
18
|
+
assert_equal(0, vendor.<=>(vendor), 'vendor <=> vendor')
|
20
19
|
|
21
|
-
assert_equal(
|
22
|
-
assert_equal(-1, remote
|
20
|
+
assert_equal(1, vendor.<=>(remote), 'vendor <=> remote')
|
21
|
+
assert_equal(-1, remote.<=>(vendor), 'remote <=> vendor')
|
23
22
|
|
24
|
-
assert_equal(
|
25
|
-
assert_equal(-1, git
|
23
|
+
assert_equal(1, vendor.<=>(git), 'vendor <=> git')
|
24
|
+
assert_equal(-1, git.<=>(vendor), 'git <=> vendor')
|
26
25
|
|
27
|
-
assert_equal(
|
28
|
-
assert_equal(-1, installed.<=>(vendor),
|
26
|
+
assert_equal(1, vendor.<=>(installed), 'vendor <=> installed')
|
27
|
+
assert_equal(-1, installed.<=>(vendor), 'installed <=> vendor')
|
29
28
|
end
|
30
|
-
|
31
29
|
end
|
@@ -3,7 +3,6 @@ require 'rubygems/test_case'
|
|
3
3
|
require 'rubygems/spec_fetcher'
|
4
4
|
|
5
5
|
class TestGemSpecFetcher < Gem::TestCase
|
6
|
-
|
7
6
|
def tuple(*args)
|
8
7
|
Gem::NameTuple.new(*args)
|
9
8
|
end
|
@@ -173,10 +172,19 @@ class TestGemSpecFetcher < Gem::TestCase
|
|
173
172
|
spec_fetcher do|fetcher|
|
174
173
|
fetcher.spec 'example', 1
|
175
174
|
fetcher.spec 'other-example', 1
|
175
|
+
fetcher.spec 'examp', 1
|
176
176
|
end
|
177
177
|
|
178
|
-
suggestions = @sf.suggest_gems_from_name('examplw')
|
178
|
+
suggestions = @sf.suggest_gems_from_name('examplw', :latest, 1)
|
179
179
|
assert_equal ['example'], suggestions
|
180
|
+
|
181
|
+
suggestions = @sf.suggest_gems_from_name('other')
|
182
|
+
assert_equal ['other-example'], suggestions
|
183
|
+
|
184
|
+
suggestions = @sf.suggest_gems_from_name('exam')
|
185
|
+
assert suggestions.any? { ['examp'] }
|
186
|
+
assert suggestions.any? { ['example'] }
|
187
|
+
assert suggestions.any? { ['other-example'] }
|
180
188
|
end
|
181
189
|
|
182
190
|
def test_suggest_gems_from_name_prerelease
|
@@ -313,7 +321,7 @@ class TestGemSpecFetcher < Gem::TestCase
|
|
313
321
|
specs, _ = @sf.available_specs(:prerelease)
|
314
322
|
|
315
323
|
expected = Gem::NameTuple.from_list \
|
316
|
-
[['a',
|
324
|
+
[['a', v('2.a'), Gem::Platform::RUBY]]
|
317
325
|
|
318
326
|
assert_equal expected, specs[@source]
|
319
327
|
end
|
@@ -326,5 +334,4 @@ class TestGemSpecFetcher < Gem::TestCase
|
|
326
334
|
assert_equal({}, specs)
|
327
335
|
assert_kind_of Gem::SourceFetchProblem, errors.first
|
328
336
|
end
|
329
|
-
|
330
337
|
end
|
@@ -1,14 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require 'benchmark'
|
3
3
|
require 'rubygems/test_case'
|
4
|
+
require 'date'
|
4
5
|
require 'pathname'
|
5
6
|
require 'stringio'
|
6
7
|
require 'rubygems/ext'
|
7
8
|
require 'rubygems/specification'
|
8
9
|
require 'rubygems/installer'
|
10
|
+
require 'rubygems/platform'
|
9
11
|
|
10
12
|
class TestGemSpecification < Gem::TestCase
|
11
|
-
|
12
13
|
LEGACY_YAML_SPEC = <<-EOF.freeze
|
13
14
|
--- !ruby/object:Gem::Specification
|
14
15
|
rubygems_version: "1.0"
|
@@ -59,12 +60,13 @@ end
|
|
59
60
|
end
|
60
61
|
end
|
61
62
|
|
62
|
-
def ext_spec
|
63
|
+
def ext_spec(platform: Gem::Platform::RUBY)
|
63
64
|
@ext = util_spec 'ext', '1' do |s|
|
64
65
|
s.executable = 'exec'
|
65
66
|
s.test_file = 'test/suite.rb'
|
66
67
|
s.extensions = %w[ext/extconf.rb]
|
67
68
|
s.license = 'MIT'
|
69
|
+
s.platform = platform
|
68
70
|
|
69
71
|
s.mark_version
|
70
72
|
s.files = %w[lib/code.rb]
|
@@ -72,9 +74,20 @@ end
|
|
72
74
|
end
|
73
75
|
end
|
74
76
|
|
77
|
+
def assert_date(date)
|
78
|
+
assert_kind_of Time, date
|
79
|
+
assert_equal [0, 0, 0], [date.hour, date.min, date.sec]
|
80
|
+
assert_operator (Gem::Specification::TODAY..Time.now), :cover?, date
|
81
|
+
end
|
82
|
+
|
75
83
|
def setup
|
76
84
|
super
|
77
85
|
|
86
|
+
# Setting `@default_source_date_epoch` to `nil` effectively resets the
|
87
|
+
# value used for `Gem.source_date_epoch` whenever `$SOURCE_DATE_EPOCH`
|
88
|
+
# is not set.
|
89
|
+
Gem.instance_variable_set(:'@default_source_date_epoch', nil)
|
90
|
+
|
78
91
|
@a1 = util_spec 'a', '1' do |s|
|
79
92
|
s.executable = 'exec'
|
80
93
|
s.test_file = 'test/suite.rb'
|
@@ -118,8 +131,8 @@ end
|
|
118
131
|
def test_self_activate_ambiguous_direct
|
119
132
|
save_loaded_features do
|
120
133
|
a1 = util_spec "a", "1", "b" => "> 0"
|
121
|
-
b1 = util_spec("b", "1", { "c" => ">= 1" }, "lib/d.rb")
|
122
|
-
b2 = util_spec("b", "2", { "c" => ">= 2" }, "lib/d.rb")
|
134
|
+
b1 = util_spec("b", "1", { "c" => ">= 1" }, "lib/d#{$$}.rb")
|
135
|
+
b2 = util_spec("b", "2", { "c" => ">= 2" }, "lib/d#{$$}.rb")
|
123
136
|
c1 = util_spec "c", "1"
|
124
137
|
c2 = util_spec "c", "2"
|
125
138
|
|
@@ -127,12 +140,12 @@ end
|
|
127
140
|
install_specs c1, c2, b1, b2, a1
|
128
141
|
|
129
142
|
a1.activate
|
130
|
-
assert_equal %w
|
143
|
+
assert_equal %w[a-1], loaded_spec_names
|
131
144
|
assert_equal ["b (> 0)"], unresolved_names
|
132
145
|
|
133
|
-
require "d"
|
146
|
+
require "d#{$$}"
|
134
147
|
|
135
|
-
assert_equal %w
|
148
|
+
assert_equal %w[a-1 b-2 c-2], loaded_spec_names
|
136
149
|
assert_equal [], unresolved_names
|
137
150
|
end
|
138
151
|
end
|
@@ -143,9 +156,9 @@ end
|
|
143
156
|
num_of_version_per_pkg = 3
|
144
157
|
packages = (0..num_of_pkg).map do |pkgi|
|
145
158
|
(0..num_of_version_per_pkg).map do |pkg_version|
|
146
|
-
deps = Hash[((pkgi + 1)..num_of_pkg).map
|
159
|
+
deps = Hash[((pkgi + 1)..num_of_pkg).map do |deppkgi|
|
147
160
|
["pkg#{deppkgi}", ">= 0"]
|
148
|
-
|
161
|
+
end]
|
149
162
|
util_spec "pkg#{pkgi}", pkg_version.to_s, deps
|
150
163
|
end
|
151
164
|
end
|
@@ -156,9 +169,9 @@ end
|
|
156
169
|
install_specs base
|
157
170
|
base.activate
|
158
171
|
|
159
|
-
tms = Benchmark.measure
|
172
|
+
tms = Benchmark.measure do
|
160
173
|
assert_raises(LoadError) { require 'no_such_file_foo' }
|
161
|
-
|
174
|
+
end
|
162
175
|
assert_operator tms.total, :<=, 10
|
163
176
|
end
|
164
177
|
end
|
@@ -168,18 +181,18 @@ end
|
|
168
181
|
a1 = util_spec "a", "1", "b" => "> 0"
|
169
182
|
b1 = util_spec "b", "1", "c" => ">= 1"
|
170
183
|
b2 = util_spec "b", "2", "c" => ">= 2"
|
171
|
-
c1 = util_spec "c", "1", nil, "lib/d.rb"
|
172
|
-
c2 = util_spec "c", "2", nil, "lib/d.rb"
|
184
|
+
c1 = util_spec "c", "1", nil, "lib/d#{$$}.rb"
|
185
|
+
c2 = util_spec "c", "2", nil, "lib/d#{$$}.rb"
|
173
186
|
|
174
187
|
install_specs c1, c2, b1, b2, a1
|
175
188
|
|
176
189
|
a1.activate
|
177
|
-
assert_equal %w
|
190
|
+
assert_equal %w[a-1], loaded_spec_names
|
178
191
|
assert_equal ["b (> 0)"], unresolved_names
|
179
192
|
|
180
|
-
require "d"
|
193
|
+
require "d#{$$}"
|
181
194
|
|
182
|
-
assert_equal %w
|
195
|
+
assert_equal %w[a-1 b-2 c-2], loaded_spec_names
|
183
196
|
assert_equal [], unresolved_names
|
184
197
|
end
|
185
198
|
end
|
@@ -190,18 +203,18 @@ end
|
|
190
203
|
a2 = util_spec "a", "2", "b" => "> 0"
|
191
204
|
b1 = util_spec "b", "1", "c" => ">= 1"
|
192
205
|
b2 = util_spec "b", "2", "c" => ">= 2"
|
193
|
-
c1 = util_spec "c", "1", nil, "lib/d.rb"
|
194
|
-
c2 = util_spec("c", "2", { "a" => "1" }, "lib/d.rb") # conflicts with a-2
|
206
|
+
c1 = util_spec "c", "1", nil, "lib/d#{$$}.rb"
|
207
|
+
c2 = util_spec("c", "2", { "a" => "1" }, "lib/d#{$$}.rb") # conflicts with a-2
|
195
208
|
|
196
209
|
install_specs c1, b1, a1, a2, c2, b2
|
197
210
|
|
198
211
|
a2.activate
|
199
|
-
assert_equal %w
|
212
|
+
assert_equal %w[a-2], loaded_spec_names
|
200
213
|
assert_equal ["b (> 0)"], unresolved_names
|
201
214
|
|
202
|
-
require "d"
|
215
|
+
require "d#{$$}"
|
203
216
|
|
204
|
-
assert_equal %w
|
217
|
+
assert_equal %w[a-2 b-1 c-1], loaded_spec_names
|
205
218
|
assert_equal [], unresolved_names
|
206
219
|
end
|
207
220
|
end
|
@@ -213,17 +226,17 @@ end
|
|
213
226
|
b2 = util_spec "b", "2", "c" => ">= 2"
|
214
227
|
c1 = util_spec "c", "1"
|
215
228
|
c2 = util_spec "c", "2"
|
216
|
-
d1 = util_spec "d", "1", nil, "lib/d.rb"
|
229
|
+
d1 = util_spec "d", "1", nil, "lib/d#{$$}.rb"
|
217
230
|
|
218
231
|
install_specs d1, c1, c2, b1, b2, a1
|
219
232
|
|
220
233
|
a1.activate
|
221
|
-
assert_equal %w
|
234
|
+
assert_equal %w[a-1], loaded_spec_names
|
222
235
|
assert_equal ["b (> 0)"], unresolved_names
|
223
236
|
|
224
|
-
require "d"
|
237
|
+
require "d#{$$}"
|
225
238
|
|
226
|
-
assert_equal %w
|
239
|
+
assert_equal %w[a-1 d-1], loaded_spec_names
|
227
240
|
assert_equal ["b (> 0)"], unresolved_names
|
228
241
|
end
|
229
242
|
end
|
@@ -233,16 +246,16 @@ end
|
|
233
246
|
a1 = util_spec "a", "1", "b" => "> 0"
|
234
247
|
b1 = util_spec "b", "1", "c" => ">= 0" # unresolved
|
235
248
|
b2 = util_spec "b", "2", "c" => ">= 0"
|
236
|
-
c1 = util_spec "c", "1", nil, "lib/c.rb"
|
237
|
-
c2 = util_spec "c", "2", nil, "lib/c.rb"
|
249
|
+
c1 = util_spec "c", "1", nil, "lib/c#{$$}.rb" # 1st level
|
250
|
+
c2 = util_spec "c", "2", nil, "lib/c#{$$}.rb"
|
238
251
|
|
239
252
|
install_specs c1, c2, b1, b2, a1
|
240
253
|
|
241
254
|
a1.activate
|
242
255
|
|
243
|
-
require "c"
|
256
|
+
require "c#{$$}"
|
244
257
|
|
245
|
-
assert_equal %w
|
258
|
+
assert_equal %w[a-1 b-2 c-2], loaded_spec_names
|
246
259
|
end
|
247
260
|
end
|
248
261
|
|
@@ -251,18 +264,18 @@ end
|
|
251
264
|
a1 = util_spec "a", "1", "b" => "> 0"
|
252
265
|
b1 = util_spec "b", "1", "c" => ">= 0" # unresolved
|
253
266
|
b2 = util_spec "b", "2", "c" => ">= 0"
|
254
|
-
c1 = util_spec "c", "1", "d" => ">= 0"
|
267
|
+
c1 = util_spec "c", "1", "d" => ">= 0" # 1st level
|
255
268
|
c2 = util_spec "c", "2", "d" => ">= 0"
|
256
|
-
d1 = util_spec "d", "1", nil, "lib/d.rb" # 2nd level
|
257
|
-
d2 = util_spec "d", "2", nil, "lib/d.rb"
|
269
|
+
d1 = util_spec "d", "1", nil, "lib/d#{$$}.rb" # 2nd level
|
270
|
+
d2 = util_spec "d", "2", nil, "lib/d#{$$}.rb"
|
258
271
|
|
259
272
|
install_specs d1, d2, c1, c2, b1, b2, a1
|
260
273
|
|
261
274
|
a1.activate
|
262
275
|
|
263
|
-
require "d"
|
276
|
+
require "d#{$$}"
|
264
277
|
|
265
|
-
assert_equal %w
|
278
|
+
assert_equal %w[a-1 b-2 c-2 d-2], loaded_spec_names
|
266
279
|
end
|
267
280
|
end
|
268
281
|
|
@@ -273,17 +286,17 @@ end
|
|
273
286
|
b2 = util_spec "b", "2", "c" => ">= 0"
|
274
287
|
c1 = util_spec "c", "1", "d" => "<= 2" # 1st level
|
275
288
|
c2 = util_spec "c", "2", "d" => "<= 2"
|
276
|
-
d1 = util_spec "d", "1", nil, "lib/d.rb" # 2nd level
|
277
|
-
d2 = util_spec "d", "2", nil, "lib/d.rb"
|
278
|
-
d3 = util_spec "d", "3", nil, "lib/d.rb"
|
289
|
+
d1 = util_spec "d", "1", nil, "lib/d#{$$}.rb" # 2nd level
|
290
|
+
d2 = util_spec "d", "2", nil, "lib/d#{$$}.rb"
|
291
|
+
d3 = util_spec "d", "3", nil, "lib/d#{$$}.rb"
|
279
292
|
|
280
293
|
install_specs d1, d2, d3, c1, c2, b1, b2, a1
|
281
294
|
|
282
295
|
a1.activate
|
283
296
|
|
284
|
-
require "d"
|
297
|
+
require "d#{$$}"
|
285
298
|
|
286
|
-
assert_equal %w
|
299
|
+
assert_equal %w[a-1 b-2 c-2 d-2], loaded_spec_names
|
287
300
|
end
|
288
301
|
end
|
289
302
|
|
@@ -294,18 +307,18 @@ end
|
|
294
307
|
b2 = util_spec "b", "2", "c" => ">= 0"
|
295
308
|
c1 = util_spec "c", "1", "d" => "<= 2" # 1st level
|
296
309
|
c2 = util_spec "c", "2", "d" => "<= 2"
|
297
|
-
d1 = util_spec "d", "1", nil, "lib/d.rb" # 2nd level
|
298
|
-
d2 = util_spec "d", "2", nil, "lib/d.rb"
|
299
|
-
d3 = util_spec "d", "3", nil, "lib/d.rb"
|
300
|
-
e = util_spec "anti_d", "1", nil, "lib/d.rb"
|
310
|
+
d1 = util_spec "d", "1", nil, "lib/d#{$$}.rb" # 2nd level
|
311
|
+
d2 = util_spec "d", "2", nil, "lib/d#{$$}.rb"
|
312
|
+
d3 = util_spec "d", "3", nil, "lib/d#{$$}.rb"
|
313
|
+
e = util_spec "anti_d", "1", nil, "lib/d#{$$}.rb"
|
301
314
|
|
302
315
|
install_specs d1, d2, d3, e, c1, c2, b1, b2, a1
|
303
316
|
|
304
317
|
a1.activate
|
305
318
|
|
306
|
-
require "d"
|
319
|
+
require "d#{$$}"
|
307
320
|
|
308
|
-
assert_equal %w
|
321
|
+
assert_equal %w[a-1 b-2 c-2 d-2], loaded_spec_names
|
309
322
|
end
|
310
323
|
end
|
311
324
|
|
@@ -314,8 +327,8 @@ end
|
|
314
327
|
base = util_spec "0", "1", "A" => ">= 1"
|
315
328
|
a1 = util_spec "A", "1", {"c" => ">= 2", "b" => "> 0"}, "lib/a.rb"
|
316
329
|
a2 = util_spec "A", "2", {"c" => ">= 2", "b" => "> 0"}, "lib/a.rb"
|
317
|
-
b1 = util_spec "b", "1", {"c" => "= 1"}, "lib/d.rb"
|
318
|
-
b2 = util_spec "b", "2", {"c" => "= 2"}, "lib/d.rb"
|
330
|
+
b1 = util_spec "b", "1", {"c" => "= 1"}, "lib/d#{$$}.rb"
|
331
|
+
b2 = util_spec "b", "2", {"c" => "= 2"}, "lib/d#{$$}.rb"
|
319
332
|
c1 = util_spec "c", "1", {}, "lib/c.rb"
|
320
333
|
c2 = util_spec "c", "2", {}, "lib/c.rb"
|
321
334
|
c3 = util_spec "c", "3", {}, "lib/c.rb"
|
@@ -323,12 +336,12 @@ end
|
|
323
336
|
install_specs c1, c2, c3, b1, b2, a1, a2, base
|
324
337
|
|
325
338
|
base.activate
|
326
|
-
assert_equal %w
|
339
|
+
assert_equal %w[0-1], loaded_spec_names
|
327
340
|
assert_equal ["A (>= 1)"], unresolved_names
|
328
341
|
|
329
|
-
require "d"
|
342
|
+
require "d#{$$}"
|
330
343
|
|
331
|
-
assert_equal %w
|
344
|
+
assert_equal %w[0-1 A-2 b-2 c-2], loaded_spec_names
|
332
345
|
assert_equal [], unresolved_names
|
333
346
|
end
|
334
347
|
end
|
@@ -341,17 +354,17 @@ end
|
|
341
354
|
c1 = util_spec "c", "1", "d" => "<= 2" # 1st level
|
342
355
|
c2 = util_spec "c", "2", "d" => "<= 2"
|
343
356
|
c3 = util_spec "c", "3", "d" => "<= 3"
|
344
|
-
d1 = util_spec "d", "1", nil, "lib/d.rb" # 2nd level
|
345
|
-
d2 = util_spec "d", "2", nil, "lib/d.rb"
|
346
|
-
d3 = util_spec "d", "3", nil, "lib/d.rb"
|
357
|
+
d1 = util_spec "d", "1", nil, "lib/d#{$$}.rb" # 2nd level
|
358
|
+
d2 = util_spec "d", "2", nil, "lib/d#{$$}.rb"
|
359
|
+
d3 = util_spec "d", "3", nil, "lib/d#{$$}.rb"
|
347
360
|
|
348
361
|
install_specs d1, d2, d3, c1, c2, c3, b1, b2, a1
|
349
362
|
|
350
363
|
a1.activate
|
351
364
|
|
352
|
-
require "d"
|
365
|
+
require "d#{$$}"
|
353
366
|
|
354
|
-
assert_includes [%w
|
367
|
+
assert_includes [%w[a-1 b-2 c-3 d-2],%w[a-1 b-2 d-2]], loaded_spec_names
|
355
368
|
end
|
356
369
|
end
|
357
370
|
|
@@ -363,17 +376,17 @@ end
|
|
363
376
|
c1 = util_spec "xc", "1", "d" => "<= 3" # 1st level
|
364
377
|
c2 = util_spec "xc", "2", "d" => "<= 2"
|
365
378
|
c3 = util_spec "xc", "3", "d" => "<= 3"
|
366
|
-
d1 = util_spec "d", "1", nil, "lib/d.rb" # 2nd level
|
367
|
-
d2 = util_spec "d", "2", nil, "lib/d.rb"
|
368
|
-
d3 = util_spec "d", "3", nil, "lib/d.rb"
|
379
|
+
d1 = util_spec "d", "1", nil, "lib/d#{$$}.rb" # 2nd level
|
380
|
+
d2 = util_spec "d", "2", nil, "lib/d#{$$}.rb"
|
381
|
+
d3 = util_spec "d", "3", nil, "lib/d#{$$}.rb"
|
369
382
|
|
370
383
|
install_specs d1, d2, d3, c1, c2, c3, b1, b2, a1
|
371
384
|
|
372
385
|
a1.activate
|
373
386
|
|
374
|
-
require "d"
|
387
|
+
require "d#{$$}"
|
375
388
|
|
376
|
-
assert_includes [%w
|
389
|
+
assert_includes [%w[a-1 b-2 d-2 xc-3], %w[a-1 b-2 d-2]], loaded_spec_names
|
377
390
|
end
|
378
391
|
end
|
379
392
|
|
@@ -384,7 +397,7 @@ end
|
|
384
397
|
# [B] ~> 1.0 (satisfied by 1.0)
|
385
398
|
|
386
399
|
def test_self_activate_checks_dependencies
|
387
|
-
a
|
400
|
+
a = util_spec 'a', '1.0'
|
388
401
|
a.add_dependency 'c', '= 1.0'
|
389
402
|
a.add_dependency 'b', '~> 1.0'
|
390
403
|
|
@@ -502,35 +515,35 @@ end
|
|
502
515
|
require "b/c"
|
503
516
|
end
|
504
517
|
|
505
|
-
assert_equal %w
|
518
|
+
assert_equal %w[a-1 b-1], loaded_spec_names
|
506
519
|
end
|
507
520
|
|
508
521
|
def test_self_activate_via_require_wtf
|
509
522
|
save_loaded_features do
|
510
|
-
a1 = util_spec "a", "1", "b" => "> 0", "d" => "> 0"
|
511
|
-
b1 = util_spec "b", "1", { "c" => ">= 1" }, "lib/b.rb"
|
512
|
-
b2 = util_spec "b", "2", { "c" => ">= 2" }, "lib/b.rb" # this
|
523
|
+
a1 = util_spec "a", "1", "b" => "> 0", "d" => "> 0" # this
|
524
|
+
b1 = util_spec "b", "1", { "c" => ">= 1" }, "lib/b#{$$}.rb"
|
525
|
+
b2 = util_spec "b", "2", { "c" => ">= 2" }, "lib/b#{$$}.rb" # this
|
513
526
|
c1 = util_spec "c", "1"
|
514
|
-
c2 = util_spec "c", "2"
|
515
|
-
d1 = util_spec "d", "1", { "c" => "< 2" }, "lib/d.rb"
|
516
|
-
d2 = util_spec "d", "2", { "c" => "< 2" }, "lib/d.rb" # this
|
527
|
+
c2 = util_spec "c", "2" # this
|
528
|
+
d1 = util_spec "d", "1", { "c" => "< 2" }, "lib/d#{$$}.rb"
|
529
|
+
d2 = util_spec "d", "2", { "c" => "< 2" }, "lib/d#{$$}.rb" # this
|
517
530
|
|
518
531
|
install_specs c1, c2, b1, b2, d1, d2, a1
|
519
532
|
|
520
533
|
a1.activate
|
521
534
|
|
522
|
-
assert_equal %w
|
535
|
+
assert_equal %w[a-1], loaded_spec_names
|
523
536
|
assert_equal ["b (> 0)", "d (> 0)"], unresolved_names
|
524
537
|
|
525
|
-
require "b"
|
538
|
+
require "b#{$$}"
|
526
539
|
|
527
540
|
e = assert_raises Gem::LoadError do
|
528
|
-
require "d"
|
541
|
+
require "d#{$$}"
|
529
542
|
end
|
530
543
|
|
531
544
|
assert_equal "unable to find a version of 'd' to activate", e.message
|
532
545
|
|
533
|
-
assert_equal %w
|
546
|
+
assert_equal %w[a-1 b-2 c-2], loaded_spec_names
|
534
547
|
assert_equal ["d (> 0)"], unresolved_names
|
535
548
|
end
|
536
549
|
end
|
@@ -545,7 +558,7 @@ end
|
|
545
558
|
install_specs c1, c2, b1, b2, a1
|
546
559
|
|
547
560
|
a1.activate
|
548
|
-
assert_equal %w
|
561
|
+
assert_equal %w[a-1 b-1 c-1], loaded_spec_names
|
549
562
|
end
|
550
563
|
|
551
564
|
def test_self_activate_loaded
|
@@ -707,7 +720,7 @@ end
|
|
707
720
|
version
|
708
721
|
]
|
709
722
|
|
710
|
-
actual_value = Gem::Specification.attribute_names.map {
|
723
|
+
actual_value = Gem::Specification.attribute_names.map {|a| a.to_s }.sort
|
711
724
|
|
712
725
|
assert_equal expected_value, actual_value
|
713
726
|
end
|
@@ -782,7 +795,7 @@ bindir:
|
|
782
795
|
op = spec.dependencies.first.requirement.requirements.first.first
|
783
796
|
refute_kind_of YAML::Syck::DefaultKey, op
|
784
797
|
|
785
|
-
refute_match %r
|
798
|
+
refute_match %r{DefaultKey}, spec.to_ruby
|
786
799
|
end
|
787
800
|
|
788
801
|
def test_self_from_yaml_cleans_up_defaultkey
|
@@ -816,7 +829,7 @@ bindir:
|
|
816
829
|
op = spec.dependencies.first.requirement.requirements.first.first
|
817
830
|
refute_kind_of YAML::Syck::DefaultKey, op
|
818
831
|
|
819
|
-
refute_match %r
|
832
|
+
refute_match %r{DefaultKey}, spec.to_ruby
|
820
833
|
end
|
821
834
|
|
822
835
|
def test_self_from_yaml_cleans_up_defaultkey_from_newer_192
|
@@ -850,7 +863,7 @@ bindir:
|
|
850
863
|
op = spec.dependencies.first.requirement.requirements.first.first
|
851
864
|
refute_kind_of YAML::Syck::DefaultKey, op
|
852
865
|
|
853
|
-
refute_match %r
|
866
|
+
refute_match %r{DefaultKey}, spec.to_ruby
|
854
867
|
end
|
855
868
|
|
856
869
|
def test_self_from_yaml_cleans_up_Date_objects
|
@@ -931,22 +944,24 @@ dependencies: []
|
|
931
944
|
assert_equal File.join(@tempdir, 'a-2.gemspec'), spec.loaded_from
|
932
945
|
end
|
933
946
|
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
io
|
938
|
-
|
947
|
+
if RUBY_ENGINE == 'ruby' and RUBY_VERSION < '2.7'
|
948
|
+
def test_self_load_tainted
|
949
|
+
full_path = @a2.spec_file
|
950
|
+
write_file full_path do |io|
|
951
|
+
io.write @a2.to_ruby_for_cache
|
952
|
+
end
|
939
953
|
|
940
|
-
|
941
|
-
|
942
|
-
|
954
|
+
full_path.taint
|
955
|
+
loader = Thread.new { $SAFE = 1; Gem::Specification.load full_path }
|
956
|
+
spec = loader.value
|
943
957
|
|
944
|
-
|
958
|
+
@a2.files.clear
|
945
959
|
|
946
|
-
|
960
|
+
assert_equal @a2, spec
|
947
961
|
|
948
|
-
|
949
|
-
|
962
|
+
ensure
|
963
|
+
$SAFE = 0
|
964
|
+
end
|
950
965
|
end
|
951
966
|
|
952
967
|
def test_self_load_escape_curly
|
@@ -1033,7 +1048,7 @@ dependencies: []
|
|
1033
1048
|
end
|
1034
1049
|
assert_equal 'keyedlist', spec.name
|
1035
1050
|
assert_equal '0.4.0', spec.version.to_s
|
1036
|
-
|
1051
|
+
assert_kind_of Time, spec.date
|
1037
1052
|
assert spec.required_ruby_version.satisfied_by?(Gem::Version.new('1'))
|
1038
1053
|
assert_equal false, spec.has_unit_tests?
|
1039
1054
|
end
|
@@ -1098,13 +1113,13 @@ dependencies: []
|
|
1098
1113
|
install_specs @a1
|
1099
1114
|
|
1100
1115
|
assert_includes Gem::Specification.all_names, 'a-1'
|
1101
|
-
assert_includes Gem::Specification.stubs.map {
|
1116
|
+
assert_includes Gem::Specification.stubs.map {|s| s.full_name }, 'a-1'
|
1102
1117
|
|
1103
1118
|
uninstall_gem @a1
|
1104
1119
|
Gem::Specification.reset
|
1105
1120
|
|
1106
1121
|
refute_includes Gem::Specification.all_names, 'a-1'
|
1107
|
-
refute_includes Gem::Specification.stubs.map {
|
1122
|
+
refute_includes Gem::Specification.stubs.map {|s| s.full_name }, 'a-1'
|
1108
1123
|
end
|
1109
1124
|
|
1110
1125
|
def test_self_remove_spec_removed
|
@@ -1119,50 +1134,39 @@ dependencies: []
|
|
1119
1134
|
Gem::Specification.reset
|
1120
1135
|
|
1121
1136
|
refute_includes Gem::Specification.all_names, 'a-1'
|
1122
|
-
refute_includes Gem::Specification.stubs.map {
|
1137
|
+
refute_includes Gem::Specification.stubs.map {|s| s.full_name }, 'a-1'
|
1123
1138
|
end
|
1124
1139
|
|
1125
|
-
def
|
1140
|
+
def test_self_stubs_for_lazy_loading
|
1126
1141
|
Gem.loaded_specs.clear
|
1127
1142
|
Gem::Specification.class_variable_set(:@@stubs, nil)
|
1128
1143
|
|
1129
1144
|
dir_standard_specs = File.join Gem.dir, 'specifications'
|
1130
|
-
dir_default_specs = Gem::BasicSpecification.default_specifications_dir
|
1131
1145
|
|
1132
|
-
|
1133
|
-
|
1134
|
-
Gem.loaded_specs['a'] = loaded_spec
|
1135
|
-
save_gemspec 'a', '2', dir_default_specs
|
1136
|
-
save_gemspec 'a', '1', dir_standard_specs
|
1146
|
+
save_gemspec('a-1', '1', dir_standard_specs){|s| s.name = 'a' }
|
1147
|
+
save_gemspec('b-1', '1', dir_standard_specs){|s| s.name = 'b' }
|
1137
1148
|
|
1138
|
-
|
1139
|
-
assert_equal
|
1149
|
+
assert_equal ['a-1'], Gem::Specification.stubs_for('a').map {|s| s.full_name }
|
1150
|
+
assert_equal 1, Gem::Specification.class_variable_get(:@@stubs_by_name).length
|
1151
|
+
assert_equal ['b-1'], Gem::Specification.stubs_for('b').map {|s| s.full_name }
|
1152
|
+
assert_equal 2, Gem::Specification.class_variable_get(:@@stubs_by_name).length
|
1153
|
+
|
1154
|
+
assert_equal(
|
1155
|
+
Gem::Specification.stubs_for('a').map {|s| s.object_id },
|
1156
|
+
Gem::Specification.stubs_for('a').map {|s| s.object_id }
|
1157
|
+
)
|
1140
1158
|
|
1141
1159
|
Gem.loaded_specs.delete 'a'
|
1160
|
+
Gem.loaded_specs.delete 'b'
|
1142
1161
|
Gem::Specification.class_variable_set(:@@stubs, nil)
|
1143
1162
|
end
|
1144
1163
|
|
1145
|
-
def
|
1146
|
-
Gem.
|
1147
|
-
Gem::Specification.class_variable_set(:@@stubs, nil)
|
1164
|
+
def test_self_stubs_for_no_lazy_loading_after_all_specs_setup
|
1165
|
+
Gem::Specification.all = [util_spec('a', '1')]
|
1148
1166
|
|
1149
|
-
|
1150
|
-
dir_default_specs = Gem::BasicSpecification.default_specifications_dir
|
1151
|
-
|
1152
|
-
# Create gemspecs in three locations used in stubs
|
1153
|
-
loaded_spec = Gem::Specification.new 'a', '3'
|
1154
|
-
Gem.loaded_specs['a'] = loaded_spec
|
1155
|
-
save_gemspec 'a', '2', dir_default_specs
|
1156
|
-
save_gemspec 'a', '1', dir_standard_specs
|
1157
|
-
|
1158
|
-
full_names = ['a-3', 'a-2', 'a-1']
|
1159
|
-
|
1160
|
-
full_names = Gem::Specification.stubs_for('a').map { |s| s.full_name }
|
1161
|
-
assert_equal full_names, Gem::Specification.stubs_for('a').map { |s| s.full_name }
|
1162
|
-
assert_equal 1, Gem::Specification.class_variable_get(:@@stubs_by_name).length
|
1167
|
+
save_gemspec('b-1', '1', File.join(Gem.dir, 'specifications')){|s| s.name = 'b' }
|
1163
1168
|
|
1164
|
-
Gem.
|
1165
|
-
Gem::Specification.class_variable_set(:@@stubs, nil)
|
1169
|
+
assert_equal [], Gem::Specification.stubs_for('b').map {|s| s.full_name }
|
1166
1170
|
end
|
1167
1171
|
|
1168
1172
|
def test_self_stubs_for_mult_platforms
|
@@ -1173,7 +1177,7 @@ dependencies: []
|
|
1173
1177
|
|
1174
1178
|
# create user spec
|
1175
1179
|
user_spec_dir = File.join Gem.user_dir, 'specifications'
|
1176
|
-
FileUtils.mkdir_p(user_spec_dir)
|
1180
|
+
FileUtils.mkdir_p(user_spec_dir) unless Dir.exist? user_spec_dir
|
1177
1181
|
# dirs doesn't include user ?
|
1178
1182
|
Gem::Specification.dirs << user_spec_dir
|
1179
1183
|
|
@@ -1183,7 +1187,7 @@ dependencies: []
|
|
1183
1187
|
|
1184
1188
|
#create specs
|
1185
1189
|
platforms.each do |plat|
|
1186
|
-
spec = Gem::Specification.new(gem, v) {
|
1190
|
+
spec = Gem::Specification.new(gem, v) {|s| s.platform = plat }
|
1187
1191
|
File.open File.join(user_spec_dir, "#{gem}-#{v}-#{plat}.gemspec"), 'w' do |io|
|
1188
1192
|
io.write spec.to_ruby
|
1189
1193
|
end
|
@@ -1204,10 +1208,18 @@ dependencies: []
|
|
1204
1208
|
Gem.platforms = orig_platform
|
1205
1209
|
end
|
1206
1210
|
|
1207
|
-
|
1211
|
+
def test_self_stubs_returns_only_specified_named_specs
|
1212
|
+
dir_standard_specs = File.join Gem.dir, 'specifications'
|
1213
|
+
|
1214
|
+
save_gemspec('a-1', '1', dir_standard_specs){|s| s.name = 'a' }
|
1215
|
+
save_gemspec('a-2', '2', dir_standard_specs){|s| s.name = 'a' }
|
1216
|
+
save_gemspec('a-a', '3', dir_standard_specs){|s| s.name = 'a-a' }
|
1217
|
+
|
1218
|
+
assert_equal ['a-1', 'a-2'], Gem::Specification.stubs_for('a').map(&:full_name).sort
|
1219
|
+
end
|
1208
1220
|
|
1209
1221
|
def test_handles_private_null_type
|
1210
|
-
path = File.
|
1222
|
+
path = File.expand_path "../data/null-type.gemspec.rz", __FILE__
|
1211
1223
|
|
1212
1224
|
data = Marshal.load Gem::Util.inflate(Gem.read_binary(path))
|
1213
1225
|
|
@@ -1374,12 +1386,12 @@ dependencies: []
|
|
1374
1386
|
awesome.add_dependency :gem_name
|
1375
1387
|
end
|
1376
1388
|
|
1377
|
-
assert_equal %w[true gem_name], gem.dependencies.map {
|
1389
|
+
assert_equal %w[true gem_name], gem.dependencies.map {|dep| dep.name }
|
1378
1390
|
end
|
1379
1391
|
|
1380
1392
|
def test_add_dependency_from_existing_dependency
|
1381
1393
|
dep = Gem::Dependency.new("existing_dep", Gem::Requirement.new('> 1'), :runtime)
|
1382
|
-
spec = Gem::Specification.new {
|
1394
|
+
spec = Gem::Specification.new {|s| s.add_dependency dep }
|
1383
1395
|
assert_equal dep, spec.dependencies.first
|
1384
1396
|
end
|
1385
1397
|
|
@@ -1388,7 +1400,7 @@ dependencies: []
|
|
1388
1400
|
awesome.add_development_dependency "monkey"
|
1389
1401
|
end
|
1390
1402
|
|
1391
|
-
monkey = gem.dependencies.detect {
|
1403
|
+
monkey = gem.dependencies.detect {|d| d.name == "monkey" }
|
1392
1404
|
assert_equal(:development, monkey.type)
|
1393
1405
|
end
|
1394
1406
|
|
@@ -1439,6 +1451,7 @@ dependencies: []
|
|
1439
1451
|
end
|
1440
1452
|
|
1441
1453
|
def test_build_args
|
1454
|
+
skip "extensions don't quite work on jruby" if Gem.java_platform?
|
1442
1455
|
ext_spec
|
1443
1456
|
|
1444
1457
|
assert_empty @ext.build_args
|
@@ -1457,6 +1470,7 @@ dependencies: []
|
|
1457
1470
|
end
|
1458
1471
|
|
1459
1472
|
def test_build_extensions
|
1473
|
+
skip "extensions don't quite work on jruby" if Gem.java_platform?
|
1460
1474
|
ext_spec
|
1461
1475
|
|
1462
1476
|
refute_path_exists @ext.extension_dir, 'sanity check'
|
@@ -1484,7 +1498,7 @@ dependencies: []
|
|
1484
1498
|
default = new_default_spec 'default', 2
|
1485
1499
|
install_default_gems default
|
1486
1500
|
|
1487
|
-
stub = Gem::Specification.stubs.find {
|
1501
|
+
stub = Gem::Specification.stubs.find {|s| s.name == 'default' }
|
1488
1502
|
assert_predicate stub, :default_gem?
|
1489
1503
|
|
1490
1504
|
stub = Gem::Specification.find_all_by_name('default').first
|
@@ -1492,6 +1506,7 @@ dependencies: []
|
|
1492
1506
|
end
|
1493
1507
|
|
1494
1508
|
def test_build_extensions_built
|
1509
|
+
skip "extensions don't quite work on jruby" if Gem.java_platform?
|
1495
1510
|
ext_spec
|
1496
1511
|
|
1497
1512
|
refute_empty @ext.extensions, 'sanity check'
|
@@ -1530,6 +1545,7 @@ dependencies: []
|
|
1530
1545
|
end
|
1531
1546
|
|
1532
1547
|
def test_build_extensions_error
|
1548
|
+
skip "extensions don't quite work on jruby" if Gem.java_platform?
|
1533
1549
|
ext_spec
|
1534
1550
|
|
1535
1551
|
refute_empty @ext.extensions, 'sanity check'
|
@@ -1543,6 +1559,7 @@ dependencies: []
|
|
1543
1559
|
skip 'chmod not supported' if Gem.win_platform?
|
1544
1560
|
skip 'skipped in root privilege' if Process.uid.zero?
|
1545
1561
|
|
1562
|
+
skip "extensions don't quite work on jruby" if Gem.java_platform?
|
1546
1563
|
ext_spec
|
1547
1564
|
|
1548
1565
|
refute_empty @ext.extensions, 'sanity check'
|
@@ -1567,7 +1584,7 @@ dependencies: []
|
|
1567
1584
|
@ext.build_extensions
|
1568
1585
|
refute_path_exists @ext.extension_dir
|
1569
1586
|
ensure
|
1570
|
-
unless ($DEBUG or win_platform? or Process.uid.zero?)
|
1587
|
+
unless ($DEBUG or win_platform? or Process.uid.zero? or Gem.java_platform?)
|
1571
1588
|
FileUtils.chmod 0755, File.join(@ext.base_dir, 'extensions')
|
1572
1589
|
FileUtils.chmod 0755, @ext.base_dir
|
1573
1590
|
end
|
@@ -1575,7 +1592,7 @@ dependencies: []
|
|
1575
1592
|
|
1576
1593
|
def test_build_extensions_no_extensions_dir_unwritable
|
1577
1594
|
skip 'chmod not supported' if Gem.win_platform?
|
1578
|
-
|
1595
|
+
skip "extensions don't quite work on jruby" if Gem.java_platform?
|
1579
1596
|
ext_spec
|
1580
1597
|
|
1581
1598
|
refute_empty @ext.extensions, 'sanity check'
|
@@ -1614,6 +1631,7 @@ dependencies: []
|
|
1614
1631
|
end
|
1615
1632
|
|
1616
1633
|
def test_build_extensions_old
|
1634
|
+
skip "extensions don't quite work on jruby" if Gem.java_platform?
|
1617
1635
|
ext_spec
|
1618
1636
|
|
1619
1637
|
refute_empty @ext.extensions, 'sanity check'
|
@@ -1627,6 +1645,7 @@ dependencies: []
|
|
1627
1645
|
end
|
1628
1646
|
|
1629
1647
|
def test_build_extensions_preview
|
1648
|
+
skip "extensions don't quite work on jruby" if Gem.java_platform?
|
1630
1649
|
ext_spec
|
1631
1650
|
|
1632
1651
|
extconf_rb = File.join @ext.gem_dir, @ext.extensions.first
|
@@ -1661,6 +1680,7 @@ dependencies: []
|
|
1661
1680
|
end
|
1662
1681
|
|
1663
1682
|
def test_contains_requirable_file_eh_extension
|
1683
|
+
skip "extensions don't quite work on jruby" if Gem.java_platform?
|
1664
1684
|
ext_spec
|
1665
1685
|
|
1666
1686
|
_, err = capture_io do
|
@@ -1673,8 +1693,18 @@ dependencies: []
|
|
1673
1693
|
assert_equal expected, err
|
1674
1694
|
end
|
1675
1695
|
|
1696
|
+
def test_contains_requirable_file_eh_extension_java_platform
|
1697
|
+
ext_spec(platform: Gem::Platform.new("java"))
|
1698
|
+
|
1699
|
+
_, err = capture_io do
|
1700
|
+
refute @ext.contains_requirable_file? 'nonexistent'
|
1701
|
+
end
|
1702
|
+
|
1703
|
+
assert_empty err
|
1704
|
+
end
|
1705
|
+
|
1676
1706
|
def test_date
|
1677
|
-
|
1707
|
+
assert_date @a1.date
|
1678
1708
|
end
|
1679
1709
|
|
1680
1710
|
def test_date_equals_date
|
@@ -1850,11 +1880,11 @@ dependencies: []
|
|
1850
1880
|
end
|
1851
1881
|
|
1852
1882
|
def test_files
|
1853
|
-
@a1.files = %w
|
1854
|
-
@a1.test_files = %w
|
1855
|
-
@a1.executables = %w
|
1856
|
-
@a1.extra_rdoc_files = %w
|
1857
|
-
@a1.extensions = %w
|
1883
|
+
@a1.files = %w[files bin/common]
|
1884
|
+
@a1.test_files = %w[test_files bin/common]
|
1885
|
+
@a1.executables = %w[executables common]
|
1886
|
+
@a1.extra_rdoc_files = %w[extra_rdoc_files bin/common]
|
1887
|
+
@a1.extensions = %w[extensions bin/common]
|
1858
1888
|
|
1859
1889
|
expected = %w[
|
1860
1890
|
bin/common
|
@@ -1868,11 +1898,11 @@ dependencies: []
|
|
1868
1898
|
end
|
1869
1899
|
|
1870
1900
|
def test_files_append
|
1871
|
-
@a1.files = %w
|
1872
|
-
@a1.test_files = %w
|
1873
|
-
@a1.executables = %w
|
1874
|
-
@a1.extra_rdoc_files = %w
|
1875
|
-
@a1.extensions = %w
|
1901
|
+
@a1.files = %w[files bin/common]
|
1902
|
+
@a1.test_files = %w[test_files bin/common]
|
1903
|
+
@a1.executables = %w[executables common]
|
1904
|
+
@a1.extra_rdoc_files = %w[extra_rdoc_files bin/common]
|
1905
|
+
@a1.extensions = %w[extensions bin/common]
|
1876
1906
|
|
1877
1907
|
expected = %w[
|
1878
1908
|
bin/common
|
@@ -1986,7 +2016,7 @@ dependencies: []
|
|
1986
2016
|
test_cases = {
|
1987
2017
|
'i386-mswin32' => 'a-1-x86-mswin32-60',
|
1988
2018
|
'i386-mswin32_80' => 'a-1-x86-mswin32-80',
|
1989
|
-
'i386-mingw32' => 'a-1-x86-mingw32'
|
2019
|
+
'i386-mingw32' => 'a-1-x86-mingw32',
|
1990
2020
|
}
|
1991
2021
|
|
1992
2022
|
test_cases.each do |arch, expected|
|
@@ -2028,7 +2058,7 @@ dependencies: []
|
|
2028
2058
|
|
2029
2059
|
def test_base_dir_default
|
2030
2060
|
default_dir =
|
2031
|
-
File.join Gem
|
2061
|
+
File.join Gem.default_specifications_dir, @a1.spec_name
|
2032
2062
|
|
2033
2063
|
@a1.instance_variable_set :@loaded_from, default_dir
|
2034
2064
|
|
@@ -2252,17 +2282,17 @@ dependencies: []
|
|
2252
2282
|
|
2253
2283
|
def test_require_already_activated
|
2254
2284
|
save_loaded_features do
|
2255
|
-
a1 = util_spec "a", "1", nil, "lib/d.rb"
|
2285
|
+
a1 = util_spec "a", "1", nil, "lib/d#{$$}.rb"
|
2256
2286
|
|
2257
2287
|
install_specs a1 # , a2, b1, b2, c1, c2
|
2258
2288
|
|
2259
2289
|
a1.activate
|
2260
|
-
assert_equal %w
|
2290
|
+
assert_equal %w[a-1], loaded_spec_names
|
2261
2291
|
assert_equal [], unresolved_names
|
2262
2292
|
|
2263
|
-
assert require "d"
|
2293
|
+
assert require "d#{$$}"
|
2264
2294
|
|
2265
|
-
assert_equal %w
|
2295
|
+
assert_equal %w[a-1], loaded_spec_names
|
2266
2296
|
assert_equal [], unresolved_names
|
2267
2297
|
end
|
2268
2298
|
end
|
@@ -2273,19 +2303,19 @@ dependencies: []
|
|
2273
2303
|
a2 = util_spec "a", "2", "b" => "> 0"
|
2274
2304
|
b1 = util_spec "b", "1", "c" => ">= 1"
|
2275
2305
|
b2 = util_spec "b", "2", "c" => ">= 2"
|
2276
|
-
c1 = util_spec "c", "1", nil, "lib/d.rb"
|
2277
|
-
c2 = util_spec("c", "2", { "a" => "1" }, "lib/d.rb") # conflicts with a-2
|
2306
|
+
c1 = util_spec "c", "1", nil, "lib/d#{$$}.rb"
|
2307
|
+
c2 = util_spec("c", "2", { "a" => "1" }, "lib/d#{$$}.rb") # conflicts with a-2
|
2278
2308
|
|
2279
2309
|
install_specs c1, b1, a1, a2, c2, b2
|
2280
2310
|
|
2281
2311
|
a1.activate
|
2282
2312
|
c1.activate
|
2283
|
-
assert_equal %w
|
2313
|
+
assert_equal %w[a-1 c-1], loaded_spec_names
|
2284
2314
|
assert_equal ["b (> 0)"], unresolved_names
|
2285
2315
|
|
2286
|
-
assert require "d"
|
2316
|
+
assert require "d#{$$}"
|
2287
2317
|
|
2288
|
-
assert_equal %w
|
2318
|
+
assert_equal %w[a-1 c-1], loaded_spec_names
|
2289
2319
|
assert_equal ["b (> 0)"], unresolved_names
|
2290
2320
|
end
|
2291
2321
|
end
|
@@ -2308,7 +2338,7 @@ dependencies: []
|
|
2308
2338
|
|
2309
2339
|
expected = %w[rake jabber4r pqa]
|
2310
2340
|
|
2311
|
-
assert_equal expected, @c1.runtime_dependencies.map {
|
2341
|
+
assert_equal expected, @c1.runtime_dependencies.map {|d| d.name }
|
2312
2342
|
end
|
2313
2343
|
|
2314
2344
|
def test_spaceship_name
|
@@ -2316,8 +2346,8 @@ dependencies: []
|
|
2316
2346
|
s2 = util_spec 'b', '1'
|
2317
2347
|
|
2318
2348
|
assert_equal(-1, (s1 <=> s2))
|
2319
|
-
assert_equal(
|
2320
|
-
assert_equal(
|
2349
|
+
assert_equal(0, (s1 <=> s1))
|
2350
|
+
assert_equal(1, (s2 <=> s1))
|
2321
2351
|
end
|
2322
2352
|
|
2323
2353
|
def test_spaceship_platform
|
@@ -2326,18 +2356,18 @@ dependencies: []
|
|
2326
2356
|
s.platform = Gem::Platform.new 'x86-my_platform1'
|
2327
2357
|
end
|
2328
2358
|
|
2329
|
-
assert_equal(
|
2330
|
-
assert_equal(
|
2331
|
-
assert_equal(
|
2359
|
+
assert_equal(-1, (s1 <=> s2))
|
2360
|
+
assert_equal(0, (s1 <=> s1))
|
2361
|
+
assert_equal(1, (s2 <=> s1))
|
2332
2362
|
end
|
2333
2363
|
|
2334
2364
|
def test_spaceship_version
|
2335
2365
|
s1 = util_spec 'a', '1'
|
2336
2366
|
s2 = util_spec 'a', '2'
|
2337
2367
|
|
2338
|
-
assert_equal(
|
2339
|
-
assert_equal(
|
2340
|
-
assert_equal(
|
2368
|
+
assert_equal(-1, (s1 <=> s2))
|
2369
|
+
assert_equal(0, (s1 <=> s1))
|
2370
|
+
assert_equal(1, (s2 <=> s1))
|
2341
2371
|
end
|
2342
2372
|
|
2343
2373
|
def test_spec_file
|
@@ -2390,7 +2420,7 @@ Gem::Specification.new do |s|
|
|
2390
2420
|
s.required_rubygems_version = Gem::Requirement.new(\"> 0\".freeze) if s.respond_to? :required_rubygems_version=
|
2391
2421
|
s.require_paths = ["lib".freeze, "other".freeze]
|
2392
2422
|
s.authors = ["A User".freeze]
|
2393
|
-
s.date = "#{
|
2423
|
+
s.date = "#{@a2.date.strftime("%Y-%m-%d")}"
|
2394
2424
|
s.description = "This is a test description".freeze
|
2395
2425
|
s.email = "example@example.com".freeze
|
2396
2426
|
s.files = ["lib/code.rb".freeze]
|
@@ -2400,12 +2430,10 @@ Gem::Specification.new do |s|
|
|
2400
2430
|
|
2401
2431
|
if s.respond_to? :specification_version then
|
2402
2432
|
s.specification_version = #{Gem::Specification::CURRENT_SPECIFICATION_VERSION}
|
2433
|
+
end
|
2403
2434
|
|
2404
|
-
|
2405
|
-
|
2406
|
-
else
|
2407
|
-
s.add_dependency(%q<b>.freeze, [\"= 1\"])
|
2408
|
-
end
|
2435
|
+
if s.respond_to? :add_runtime_dependency then
|
2436
|
+
s.add_runtime_dependency(%q<b>.freeze, [\"= 1\"])
|
2409
2437
|
else
|
2410
2438
|
s.add_dependency(%q<b>.freeze, [\"= 1\"])
|
2411
2439
|
end
|
@@ -2419,6 +2447,38 @@ end
|
|
2419
2447
|
assert_equal @a2, same_spec
|
2420
2448
|
end
|
2421
2449
|
|
2450
|
+
def test_to_ruby_with_rsa_key
|
2451
|
+
require 'rubygems/openssl'
|
2452
|
+
skip 'openssl is missing' unless defined?(OpenSSL::PKey::RSA)
|
2453
|
+
|
2454
|
+
rsa_key = OpenSSL::PKey::RSA.new(2048)
|
2455
|
+
@a2.signing_key = rsa_key
|
2456
|
+
ruby_code = @a2.to_ruby
|
2457
|
+
|
2458
|
+
expected = <<-SPEC
|
2459
|
+
# -*- encoding: utf-8 -*-
|
2460
|
+
# stub: a 2 ruby lib
|
2461
|
+
|
2462
|
+
Gem::Specification.new do |s|
|
2463
|
+
s.name = "a".freeze
|
2464
|
+
s.version = "2"
|
2465
|
+
|
2466
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
2467
|
+
s.require_paths = ["lib".freeze]
|
2468
|
+
s.authors = ["A User".freeze]
|
2469
|
+
s.date = "#{@a2.date.strftime("%Y-%m-%d")}"
|
2470
|
+
s.description = "This is a test description".freeze
|
2471
|
+
s.email = "example@example.com".freeze
|
2472
|
+
s.files = ["lib/code.rb".freeze]
|
2473
|
+
s.homepage = "http://example.com".freeze
|
2474
|
+
s.rubygems_version = "#{Gem::VERSION}".freeze
|
2475
|
+
s.summary = "this is a summary".freeze
|
2476
|
+
end
|
2477
|
+
SPEC
|
2478
|
+
|
2479
|
+
assert_equal expected, ruby_code
|
2480
|
+
end
|
2481
|
+
|
2422
2482
|
def test_to_ruby_for_cache
|
2423
2483
|
@a2.add_runtime_dependency 'b', '1'
|
2424
2484
|
@a2.dependencies.first.instance_variable_set :@type, nil
|
@@ -2439,7 +2499,7 @@ Gem::Specification.new do |s|
|
|
2439
2499
|
s.required_rubygems_version = Gem::Requirement.new(\"> 0\".freeze) if s.respond_to? :required_rubygems_version=
|
2440
2500
|
s.require_paths = ["lib".freeze]
|
2441
2501
|
s.authors = ["A User".freeze]
|
2442
|
-
s.date = "#{
|
2502
|
+
s.date = "#{@a2.date.strftime("%Y-%m-%d")}"
|
2443
2503
|
s.description = "This is a test description".freeze
|
2444
2504
|
s.email = "example@example.com".freeze
|
2445
2505
|
s.homepage = "http://example.com".freeze
|
@@ -2450,12 +2510,10 @@ Gem::Specification.new do |s|
|
|
2450
2510
|
|
2451
2511
|
if s.respond_to? :specification_version then
|
2452
2512
|
s.specification_version = #{Gem::Specification::CURRENT_SPECIFICATION_VERSION}
|
2513
|
+
end
|
2453
2514
|
|
2454
|
-
|
2455
|
-
|
2456
|
-
else
|
2457
|
-
s.add_dependency(%q<b>.freeze, [\"= 1\"])
|
2458
|
-
end
|
2515
|
+
if s.respond_to? :add_runtime_dependency then
|
2516
|
+
s.add_runtime_dependency(%q<b>.freeze, [\"= 1\"])
|
2459
2517
|
else
|
2460
2518
|
s.add_dependency(%q<b>.freeze, [\"= 1\"])
|
2461
2519
|
end
|
@@ -2496,7 +2554,7 @@ Gem::Specification.new do |s|
|
|
2496
2554
|
s.required_rubygems_version = Gem::Requirement.new(\">= 0\".freeze) if s.respond_to? :required_rubygems_version=
|
2497
2555
|
s.require_paths = ["lib".freeze]
|
2498
2556
|
s.authors = ["A User".freeze]
|
2499
|
-
s.date = "#{
|
2557
|
+
s.date = "#{@c1.date.strftime("%Y-%m-%d")}"
|
2500
2558
|
s.description = "This is a test description".freeze
|
2501
2559
|
s.email = "example@example.com".freeze
|
2502
2560
|
s.executables = ["exec".freeze]
|
@@ -2511,16 +2569,12 @@ Gem::Specification.new do |s|
|
|
2511
2569
|
|
2512
2570
|
if s.respond_to? :specification_version then
|
2513
2571
|
s.specification_version = 4
|
2572
|
+
end
|
2514
2573
|
|
2515
|
-
|
2516
|
-
|
2517
|
-
|
2518
|
-
|
2519
|
-
else
|
2520
|
-
s.add_dependency(%q<rake>.freeze, [\"> 0.4\"])
|
2521
|
-
s.add_dependency(%q<jabber4r>.freeze, [\"> 0.0.0\"])
|
2522
|
-
s.add_dependency(%q<pqa>.freeze, [\"> 0.4\", \"<= 0.6\"])
|
2523
|
-
end
|
2574
|
+
if s.respond_to? :add_runtime_dependency then
|
2575
|
+
s.add_runtime_dependency(%q<rake>.freeze, [\"> 0.4\"])
|
2576
|
+
s.add_runtime_dependency(%q<jabber4r>.freeze, [\"> 0.0.0\"])
|
2577
|
+
s.add_runtime_dependency(%q<pqa>.freeze, [\"> 0.4\", \"<= 0.6\"])
|
2524
2578
|
else
|
2525
2579
|
s.add_dependency(%q<rake>.freeze, [\"> 0.4\"])
|
2526
2580
|
s.add_dependency(%q<jabber4r>.freeze, [\"> 0.0.0\"])
|
@@ -2536,6 +2590,14 @@ end
|
|
2536
2590
|
assert_equal @c1, same_spec
|
2537
2591
|
end
|
2538
2592
|
|
2593
|
+
def test_to_ruby_keeps_requirements_as_originally_specified
|
2594
|
+
spec = util_spec 'a', '1' do |s|
|
2595
|
+
s.add_dependency 'b', ['~> 1.0', '>= 1.0.0']
|
2596
|
+
end
|
2597
|
+
|
2598
|
+
assert_includes spec.to_ruby, '"~> 1.0", ">= 1.0.0"'
|
2599
|
+
end
|
2600
|
+
|
2539
2601
|
def test_to_ruby_legacy
|
2540
2602
|
gemspec1 = Gem::Deprecate.skip_during do
|
2541
2603
|
eval LEGACY_RUBY_SPEC
|
@@ -2592,7 +2654,7 @@ end
|
|
2592
2654
|
def test_to_yaml_platform_empty_string
|
2593
2655
|
@a1.instance_variable_set :@original_platform, ''
|
2594
2656
|
|
2595
|
-
assert_match %r
|
2657
|
+
assert_match %r{^platform: ruby$}, @a1.to_yaml
|
2596
2658
|
end
|
2597
2659
|
|
2598
2660
|
def test_to_yaml_platform_legacy
|
@@ -2610,7 +2672,7 @@ end
|
|
2610
2672
|
def test_to_yaml_platform_nil
|
2611
2673
|
@a1.instance_variable_set :@original_platform, nil
|
2612
2674
|
|
2613
|
-
assert_match %r
|
2675
|
+
assert_match %r{^platform: ruby$}, @a1.to_yaml
|
2614
2676
|
end
|
2615
2677
|
|
2616
2678
|
def test_validate
|
@@ -2654,7 +2716,7 @@ end
|
|
2654
2716
|
@a1.validate
|
2655
2717
|
end
|
2656
2718
|
|
2657
|
-
assert_equal %
|
2719
|
+
assert_equal %("#{f}" or "#{t}" is not an author), e.message
|
2658
2720
|
|
2659
2721
|
@a1.authors = ["#{t} (who is writing this software)"]
|
2660
2722
|
|
@@ -2662,7 +2724,7 @@ end
|
|
2662
2724
|
@a1.validate
|
2663
2725
|
end
|
2664
2726
|
|
2665
|
-
assert_equal %
|
2727
|
+
assert_equal %("#{f}" or "#{t}" is not an author), e.message
|
2666
2728
|
end
|
2667
2729
|
end
|
2668
2730
|
|
@@ -2720,7 +2782,7 @@ end
|
|
2720
2782
|
add_runtime_dependency 'l', '~> 1.2', '> 1.2.3'
|
2721
2783
|
#{w}: open-ended dependency on o (>= 0) is not recommended
|
2722
2784
|
use a bounded requirement, such as '~> x.y'
|
2723
|
-
#{w}: See
|
2785
|
+
#{w}: See https://guides.rubygems.org/specification-reference/ for help
|
2724
2786
|
EXPECTED
|
2725
2787
|
|
2726
2788
|
assert_equal expected, @ui.error, 'warning'
|
@@ -2752,7 +2814,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|
2752
2814
|
end
|
2753
2815
|
|
2754
2816
|
assert_equal <<-EXPECTED, @ui.error
|
2755
|
-
#{w}: See
|
2817
|
+
#{w}: See https://guides.rubygems.org/specification-reference/ for help
|
2756
2818
|
EXPECTED
|
2757
2819
|
end
|
2758
2820
|
end
|
@@ -2787,6 +2849,37 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|
2787
2849
|
end
|
2788
2850
|
end
|
2789
2851
|
|
2852
|
+
def test_validate_rake_extension_have_rake_dependency_warning
|
2853
|
+
util_setup_validate
|
2854
|
+
|
2855
|
+
Dir.chdir @tempdir do
|
2856
|
+
@a1.extensions = ['Rakefile']
|
2857
|
+
File.write File.join(@tempdir, 'Rakefile'), ''
|
2858
|
+
|
2859
|
+
use_ui @ui do
|
2860
|
+
@a1.validate
|
2861
|
+
end
|
2862
|
+
|
2863
|
+
assert_match(/add rake as a dependency/, @ui.error)
|
2864
|
+
end
|
2865
|
+
end
|
2866
|
+
|
2867
|
+
def test_validate_rake_extension_have_rake_dependency_no_warning
|
2868
|
+
util_setup_validate
|
2869
|
+
|
2870
|
+
Dir.chdir @tempdir do
|
2871
|
+
@a1.extensions = ['Rakefile']
|
2872
|
+
@a1.add_runtime_dependency 'rake'
|
2873
|
+
File.write File.join(@tempdir, 'Rakefile'), ''
|
2874
|
+
|
2875
|
+
use_ui @ui do
|
2876
|
+
@a1.validate
|
2877
|
+
end
|
2878
|
+
|
2879
|
+
refute_match(/add rake as a dependency/, @ui.error)
|
2880
|
+
end
|
2881
|
+
end
|
2882
|
+
|
2790
2883
|
def test_validate_description
|
2791
2884
|
util_setup_validate
|
2792
2885
|
|
@@ -2814,7 +2907,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|
2814
2907
|
@a1.validate
|
2815
2908
|
end
|
2816
2909
|
|
2817
|
-
assert_equal %
|
2910
|
+
assert_equal %("#{f}" or "#{t}" is not a description), e.message
|
2818
2911
|
|
2819
2912
|
@a1.description = "#{t} (describe your package)"
|
2820
2913
|
|
@@ -2822,7 +2915,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|
2822
2915
|
@a1.validate
|
2823
2916
|
end
|
2824
2917
|
|
2825
|
-
assert_equal %
|
2918
|
+
assert_equal %("#{f}" or "#{t}" is not a description), e.message
|
2826
2919
|
end
|
2827
2920
|
end
|
2828
2921
|
|
@@ -2836,7 +2929,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|
2836
2929
|
@a1.validate
|
2837
2930
|
end
|
2838
2931
|
|
2839
|
-
assert_equal %
|
2932
|
+
assert_equal %("#{f}" or "#{t}" is not an email), e.message
|
2840
2933
|
|
2841
2934
|
@a1.email = "#{t} (your e-mail)"
|
2842
2935
|
|
@@ -2844,7 +2937,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|
2844
2937
|
@a1.validate
|
2845
2938
|
end
|
2846
2939
|
|
2847
|
-
assert_equal %
|
2940
|
+
assert_equal %("#{f}" or "#{t}" is not an email), e.message
|
2848
2941
|
end
|
2849
2942
|
end
|
2850
2943
|
|
@@ -2863,14 +2956,14 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|
2863
2956
|
end
|
2864
2957
|
end
|
2865
2958
|
|
2866
|
-
assert_match 'See
|
2959
|
+
assert_match 'See https://guides.rubygems.org/specification-reference/ for help', @ui.error
|
2867
2960
|
end
|
2868
2961
|
|
2869
2962
|
def test_validate_executables
|
2870
2963
|
util_setup_validate
|
2871
2964
|
|
2872
2965
|
FileUtils.mkdir_p File.join(@tempdir, 'bin')
|
2873
|
-
File.
|
2966
|
+
File.write File.join(@tempdir, 'bin', 'exec'), ''
|
2874
2967
|
FileUtils.mkdir_p File.join(@tempdir, 'exec')
|
2875
2968
|
|
2876
2969
|
use_ui @ui do
|
@@ -2936,7 +3029,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|
2936
3029
|
end
|
2937
3030
|
|
2938
3031
|
expected = <<-EXPECTED
|
2939
|
-
WARN: Unresolved or
|
3032
|
+
WARN: Unresolved or ambiguous specs during Gem::Specification.reset:
|
2940
3033
|
x (= 1)
|
2941
3034
|
WARN: Clearing out unresolved specs. Try 'gem cleanup <gem>'
|
2942
3035
|
Please report a bug if this causes problems.
|
@@ -2958,13 +3051,13 @@ Please report a bug if this causes problems.
|
|
2958
3051
|
|
2959
3052
|
specification.define_singleton_method(:find_all_by_name) do |dep_name|
|
2960
3053
|
[
|
2961
|
-
specification.new {
|
2962
|
-
specification.new {
|
3054
|
+
specification.new {|s| s.name = "z", s.version = Gem::Version.new("1") },
|
3055
|
+
specification.new {|s| s.name = "z", s.version = Gem::Version.new("2") },
|
2963
3056
|
]
|
2964
3057
|
end
|
2965
3058
|
|
2966
3059
|
expected = <<-EXPECTED
|
2967
|
-
WARN: Unresolved or
|
3060
|
+
WARN: Unresolved or ambiguous specs during Gem::Specification.reset:
|
2968
3061
|
x (= 1)
|
2969
3062
|
Available/installed versions of this gem:
|
2970
3063
|
- 1
|
@@ -2978,6 +3071,13 @@ Please report a bug if this causes problems.
|
|
2978
3071
|
end
|
2979
3072
|
end
|
2980
3073
|
|
3074
|
+
def test_duplicate_runtime_dependency
|
3075
|
+
expected = "WARNING: duplicated b dependency [\"~> 3.0\", \"~> 3.0\"]\n"
|
3076
|
+
assert_output nil, expected do
|
3077
|
+
@a1.add_runtime_dependency "b", "~> 3.0", "~> 3.0"
|
3078
|
+
end
|
3079
|
+
end
|
3080
|
+
|
2981
3081
|
def set_orig(cls)
|
2982
3082
|
s_cls = cls.singleton_class
|
2983
3083
|
s_cls.send :alias_method, :orig_unresolved_deps , :unresolved_deps
|
@@ -3036,7 +3136,7 @@ Please report a bug if this causes problems.
|
|
3036
3136
|
|
3037
3137
|
assert_equal '"ftp://rubygems.org" is not a valid HTTP URI', e.message
|
3038
3138
|
|
3039
|
-
@a1.homepage = '
|
3139
|
+
@a1.homepage = 'https://rubygems.org/'
|
3040
3140
|
assert_equal true, @a1.validate
|
3041
3141
|
|
3042
3142
|
@a1.homepage = 'https://rubygems.org'
|
@@ -3053,10 +3153,36 @@ Please report a bug if this causes problems.
|
|
3053
3153
|
@a1.validate
|
3054
3154
|
end
|
3055
3155
|
|
3056
|
-
assert_match <<-
|
3156
|
+
assert_match <<-WARNING, @ui.error
|
3057
3157
|
WARNING: licenses is empty, but is recommended. Use a license identifier from
|
3058
3158
|
http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
|
3059
|
-
|
3159
|
+
WARNING
|
3160
|
+
end
|
3161
|
+
|
3162
|
+
def test_validate_license_in_a_non_packaging_context
|
3163
|
+
util_setup_validate
|
3164
|
+
|
3165
|
+
use_ui @ui do
|
3166
|
+
@a1.licenses.clear
|
3167
|
+
@a1.validate(false)
|
3168
|
+
end
|
3169
|
+
|
3170
|
+
assert_empty @ui.error
|
3171
|
+
end
|
3172
|
+
|
3173
|
+
def test_removed_methods
|
3174
|
+
assert_equal Gem::Specification::REMOVED_METHODS, [:rubyforge_project=]
|
3175
|
+
end
|
3176
|
+
|
3177
|
+
def test_validate_removed_rubyforge_project
|
3178
|
+
util_setup_validate
|
3179
|
+
|
3180
|
+
use_ui @ui do
|
3181
|
+
@a1.rubyforge_project = 'invalid-attribute'
|
3182
|
+
@a1.validate
|
3183
|
+
end
|
3184
|
+
|
3185
|
+
assert_match "rubyforge_project= is deprecated", @ui.error
|
3060
3186
|
end
|
3061
3187
|
|
3062
3188
|
def test_validate_license_values
|
@@ -3067,10 +3193,10 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
|
|
3067
3193
|
@a1.validate
|
3068
3194
|
end
|
3069
3195
|
|
3070
|
-
assert_match <<-
|
3196
|
+
assert_match <<-WARNING, @ui.error
|
3071
3197
|
WARNING: license value 'BSD' is invalid. Use a license identifier from
|
3072
3198
|
http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
|
3073
|
-
|
3199
|
+
WARNING
|
3074
3200
|
end
|
3075
3201
|
|
3076
3202
|
def test_validate_license_values_plus
|
@@ -3114,14 +3240,14 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
|
|
3114
3240
|
@a1.validate
|
3115
3241
|
end
|
3116
3242
|
|
3117
|
-
assert_match <<-
|
3243
|
+
assert_match <<-WARNING, @ui.error
|
3118
3244
|
WARNING: license value 'GPL-2.0+ FOO' is invalid. Use a license identifier from
|
3119
3245
|
http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
|
3120
|
-
|
3121
|
-
assert_match <<-
|
3246
|
+
WARNING
|
3247
|
+
assert_match <<-WARNING, @ui.error
|
3122
3248
|
WARNING: license value 'GPL-2.0 FOO' is invalid. Use a license identifier from
|
3123
3249
|
http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
|
3124
|
-
|
3250
|
+
WARNING
|
3125
3251
|
end
|
3126
3252
|
|
3127
3253
|
def test_validate_license_with_invalid_exception
|
@@ -3132,10 +3258,10 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
|
|
3132
3258
|
@a1.validate
|
3133
3259
|
end
|
3134
3260
|
|
3135
|
-
assert_match <<-
|
3261
|
+
assert_match <<-WARNING, @ui.error
|
3136
3262
|
WARNING: license value 'GPL-2.0+ WITH Autocofn-exception-2.0' is invalid. Use a license identifier from
|
3137
3263
|
http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
|
3138
|
-
|
3264
|
+
WARNING
|
3139
3265
|
end
|
3140
3266
|
|
3141
3267
|
def test_validate_license_gives_suggestions
|
@@ -3146,11 +3272,11 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
|
|
3146
3272
|
@a1.validate
|
3147
3273
|
end
|
3148
3274
|
|
3149
|
-
assert_match <<-
|
3275
|
+
assert_match <<-WARNING, @ui.error
|
3150
3276
|
WARNING: license value 'ruby' is invalid. Use a license identifier from
|
3151
3277
|
http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
|
3152
3278
|
Did you mean 'Ruby'?
|
3153
|
-
|
3279
|
+
WARNING
|
3154
3280
|
end
|
3155
3281
|
|
3156
3282
|
def test_validate_empty_files
|
@@ -3246,7 +3372,7 @@ Did you mean 'Ruby'?
|
|
3246
3372
|
spec.validate
|
3247
3373
|
end
|
3248
3374
|
|
3249
|
-
assert_match %r
|
3375
|
+
assert_match %r{^#{name}}, e.message
|
3250
3376
|
end
|
3251
3377
|
end
|
3252
3378
|
end
|
@@ -3346,7 +3472,7 @@ Did you mean 'Ruby'?
|
|
3346
3472
|
@a1.validate
|
3347
3473
|
end
|
3348
3474
|
|
3349
|
-
assert_equal %
|
3475
|
+
assert_equal %("#{f}" or "#{t}" is not a summary), e.message
|
3350
3476
|
|
3351
3477
|
@a1.summary = "#{t} (describe your package)"
|
3352
3478
|
|
@@ -3354,7 +3480,7 @@ Did you mean 'Ruby'?
|
|
3354
3480
|
@a1.validate
|
3355
3481
|
end
|
3356
3482
|
|
3357
|
-
assert_equal %
|
3483
|
+
assert_equal %("#{f}" or "#{t}" is not a summary), e.message
|
3358
3484
|
end
|
3359
3485
|
end
|
3360
3486
|
|
@@ -3366,7 +3492,7 @@ Did you mean 'Ruby'?
|
|
3366
3492
|
@a1.validate
|
3367
3493
|
end
|
3368
3494
|
|
3369
|
-
assert_match 'See
|
3495
|
+
assert_match 'See https://guides.rubygems.org/specification-reference/ for help', @ui.error
|
3370
3496
|
end
|
3371
3497
|
|
3372
3498
|
def test_version
|
@@ -3414,19 +3540,6 @@ Did you mean 'Ruby'?
|
|
3414
3540
|
specfile.delete
|
3415
3541
|
end
|
3416
3542
|
|
3417
|
-
##
|
3418
|
-
# KEEP p-1-x86-darwin-8
|
3419
|
-
# KEEP p-1
|
3420
|
-
# KEEP c-1.2
|
3421
|
-
# KEEP a_evil-9
|
3422
|
-
# a-1
|
3423
|
-
# a-1-x86-my_platform-1
|
3424
|
-
# KEEP a-2
|
3425
|
-
# a-2-x86-other_platform-1
|
3426
|
-
# KEEP a-2-x86-my_platform-1
|
3427
|
-
# a-3.a
|
3428
|
-
# KEEP a-3-x86-other_platform-1
|
3429
|
-
|
3430
3543
|
def test_latest_specs
|
3431
3544
|
spec_fetcher do |fetcher|
|
3432
3545
|
fetcher.spec 'a', 1 do |s|
|
@@ -3449,8 +3562,6 @@ Did you mean 'Ruby'?
|
|
3449
3562
|
end
|
3450
3563
|
|
3451
3564
|
expected = %W[
|
3452
|
-
a-2
|
3453
|
-
a-2-x86-my_platform-1
|
3454
3565
|
a-3-x86-other_platform-1
|
3455
3566
|
]
|
3456
3567
|
|
@@ -3468,7 +3579,8 @@ Did you mean 'Ruby'?
|
|
3468
3579
|
s.metadata = {
|
3469
3580
|
"one" => "two",
|
3470
3581
|
"home" => "three",
|
3471
|
-
"homepage_uri" => "https://example.com/user/repo"
|
3582
|
+
"homepage_uri" => "https://example.com/user/repo",
|
3583
|
+
"funding_uri" => "https://example.com/donate",
|
3472
3584
|
}
|
3473
3585
|
end
|
3474
3586
|
|
@@ -3564,6 +3676,11 @@ Did you mean 'Ruby'?
|
|
3564
3676
|
end
|
3565
3677
|
|
3566
3678
|
def test_metadata_specs
|
3679
|
+
@m1 = quick_gem 'm', '1' do |s|
|
3680
|
+
s.files = %w[lib/code.rb]
|
3681
|
+
s.metadata = { 'one' => "two", 'two' => "three" }
|
3682
|
+
end
|
3683
|
+
|
3567
3684
|
valid_ruby_spec = <<-EOF
|
3568
3685
|
# -*- encoding: utf-8 -*-
|
3569
3686
|
# stub: m 1 ruby lib
|
@@ -3576,7 +3693,7 @@ Gem::Specification.new do |s|
|
|
3576
3693
|
s.metadata = { "one" => "two", "two" => "three" } if s.respond_to? :metadata=
|
3577
3694
|
s.require_paths = ["lib".freeze]
|
3578
3695
|
s.authors = ["A User".freeze]
|
3579
|
-
s.date = "#{
|
3696
|
+
s.date = "#{@m1.date.strftime("%Y-%m-%d")}"
|
3580
3697
|
s.description = "This is a test description".freeze
|
3581
3698
|
s.email = "example@example.com".freeze
|
3582
3699
|
s.files = ["lib/code.rb".freeze]
|
@@ -3586,15 +3703,11 @@ Gem::Specification.new do |s|
|
|
3586
3703
|
end
|
3587
3704
|
EOF
|
3588
3705
|
|
3589
|
-
@m1 = quick_gem 'm', '1' do |s|
|
3590
|
-
s.files = %w[lib/code.rb]
|
3591
|
-
s.metadata = { 'one' => "two", 'two' => "three" }
|
3592
|
-
end
|
3593
|
-
|
3594
3706
|
assert_equal @m1.to_ruby, valid_ruby_spec
|
3595
3707
|
end
|
3596
3708
|
|
3597
3709
|
def test_missing_extensions_eh
|
3710
|
+
skip "extensions don't quite work on jruby" if Gem.java_platform?
|
3598
3711
|
ext_spec
|
3599
3712
|
|
3600
3713
|
assert @ext.missing_extensions?
|
@@ -3727,7 +3840,7 @@ end
|
|
3727
3840
|
|
3728
3841
|
default_gem_spec = new_default_spec("default", "2.0.0.0",
|
3729
3842
|
nil, "default/gem.rb")
|
3730
|
-
spec_path = File.join(@
|
3843
|
+
spec_path = File.join(@gemhome, "specifications", "default", default_gem_spec.spec_name)
|
3731
3844
|
write_file(spec_path) do |file|
|
3732
3845
|
file.print(default_gem_spec.to_ruby)
|
3733
3846
|
end
|
@@ -3752,12 +3865,17 @@ end
|
|
3752
3865
|
FileUtils.mkdir_p "test"
|
3753
3866
|
FileUtils.mkdir_p "bin"
|
3754
3867
|
|
3755
|
-
|
3756
|
-
|
3757
|
-
|
3868
|
+
begin
|
3869
|
+
umask_orig = File.umask(2)
|
3870
|
+
FileUtils.touch File.join("ext", "a", "extconf.rb")
|
3871
|
+
FileUtils.touch File.join("lib", "code.rb")
|
3872
|
+
FileUtils.touch File.join("test", "suite.rb")
|
3758
3873
|
|
3759
|
-
|
3760
|
-
|
3874
|
+
File.open "bin/exec", "w", 0755 do |fp|
|
3875
|
+
fp.puts "#!#{Gem.ruby}"
|
3876
|
+
end
|
3877
|
+
ensure
|
3878
|
+
File.umask(umask_orig)
|
3761
3879
|
end
|
3762
3880
|
end
|
3763
3881
|
end
|