rubygems-update 3.0.3 → 3.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5556 -0
- data/CODE_OF_CONDUCT.md +62 -24
- data/CONTRIBUTING.md +111 -21
- data/MAINTAINERS.txt +1 -6
- data/Manifest.txt +209 -101
- data/POLICIES.md +65 -22
- data/README.md +23 -15
- data/UPGRADING.md +5 -81
- data/bin/gem +2 -16
- data/bin/update_rubygems +5 -5
- data/bundler/CHANGELOG.md +2619 -1256
- data/bundler/LICENSE.md +18 -19
- data/bundler/README.md +11 -12
- data/bundler/UPGRADING.md +222 -0
- data/bundler/bundler.gemspec +13 -33
- data/bundler/exe/bundle +26 -11
- data/bundler/exe/bundler +1 -1
- data/bundler/lib/bundler/.document +1 -0
- data/bundler/lib/bundler/build_metadata.rb +5 -13
- data/bundler/lib/bundler/capistrano.rb +4 -4
- data/bundler/lib/bundler/cli/add.rb +28 -16
- data/bundler/lib/bundler/cli/binstubs.rb +11 -3
- data/bundler/lib/bundler/cli/cache.rb +24 -17
- data/bundler/lib/bundler/cli/check.rb +5 -3
- data/bundler/lib/bundler/cli/clean.rb +1 -1
- data/bundler/lib/bundler/cli/common.rb +41 -13
- data/bundler/lib/bundler/cli/config.rb +170 -86
- data/bundler/lib/bundler/cli/console.rb +3 -3
- data/bundler/lib/bundler/cli/doctor.rb +27 -10
- data/bundler/lib/bundler/cli/exec.rb +8 -25
- data/bundler/lib/bundler/cli/fund.rb +36 -0
- data/bundler/lib/bundler/cli/gem.rb +261 -48
- data/bundler/lib/bundler/cli/info.rb +52 -8
- data/bundler/lib/bundler/cli/init.rb +7 -3
- data/bundler/lib/bundler/cli/inject.rb +1 -1
- data/bundler/lib/bundler/cli/install.rb +38 -66
- data/bundler/lib/bundler/cli/issue.rb +8 -7
- data/bundler/lib/bundler/cli/list.rb +19 -11
- data/bundler/lib/bundler/cli/lock.rb +11 -4
- data/bundler/lib/bundler/cli/open.rb +14 -9
- data/bundler/lib/bundler/cli/outdated.rb +152 -121
- data/bundler/lib/bundler/cli/platform.rb +2 -2
- data/bundler/lib/bundler/cli/plugin.rb +19 -2
- data/bundler/lib/bundler/cli/pristine.rb +6 -1
- data/bundler/lib/bundler/cli/remove.rb +1 -2
- data/bundler/lib/bundler/cli/show.rb +3 -3
- data/bundler/lib/bundler/cli/update.rb +49 -18
- data/bundler/lib/bundler/cli/viz.rb +1 -1
- data/bundler/lib/bundler/cli.rb +269 -165
- data/bundler/lib/bundler/compact_index_client/cache.rb +7 -24
- data/bundler/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/bundler/lib/bundler/compact_index_client/updater.rb +58 -57
- data/bundler/lib/bundler/compact_index_client.rb +28 -18
- data/bundler/lib/bundler/constants.rb +1 -1
- data/bundler/lib/bundler/current_ruby.rb +26 -11
- data/bundler/lib/bundler/definition.rb +359 -441
- data/bundler/lib/bundler/dependency.rb +29 -71
- data/bundler/lib/bundler/deployment.rb +1 -1
- data/bundler/lib/bundler/digest.rb +71 -0
- data/bundler/lib/bundler/dsl.rb +84 -116
- data/bundler/lib/bundler/endpoint_specification.rb +20 -14
- data/bundler/lib/bundler/env.rb +10 -15
- data/bundler/lib/bundler/environment_preserver.rb +30 -3
- data/bundler/lib/bundler/errors.rb +31 -14
- data/bundler/lib/bundler/feature_flag.rb +13 -33
- data/bundler/lib/bundler/fetcher/base.rb +7 -9
- data/bundler/lib/bundler/fetcher/compact_index.rb +46 -39
- data/bundler/lib/bundler/fetcher/dependency.rb +2 -2
- data/bundler/lib/bundler/fetcher/downloader.rb +15 -12
- data/bundler/lib/bundler/fetcher/index.rb +4 -30
- data/bundler/lib/bundler/fetcher.rb +39 -41
- data/bundler/lib/bundler/force_platform.rb +18 -0
- data/bundler/lib/bundler/friendly_errors.rb +49 -54
- data/bundler/lib/bundler/gem_helper.rb +79 -43
- data/bundler/lib/bundler/gem_helpers.rb +44 -28
- data/bundler/lib/bundler/gem_tasks.rb +1 -1
- data/bundler/lib/bundler/gem_version_promoter.rb +54 -99
- data/bundler/lib/bundler/graph.rb +5 -5
- data/bundler/lib/bundler/index.rb +14 -52
- data/bundler/lib/bundler/injector.rb +50 -16
- data/bundler/lib/bundler/inline.rb +28 -29
- data/bundler/lib/bundler/installer/gem_installer.rb +22 -23
- data/bundler/lib/bundler/installer/parallel_installer.rb +51 -51
- data/bundler/lib/bundler/installer/standalone.rb +62 -12
- data/bundler/lib/bundler/installer.rb +46 -97
- data/bundler/lib/bundler/lazy_specification.rb +88 -48
- data/bundler/lib/bundler/lockfile_generator.rb +3 -3
- data/bundler/lib/bundler/lockfile_parser.rb +30 -62
- data/bundler/{man → lib/bundler/man}/bundle-add.1 +29 -5
- data/bundler/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +22 -4
- data/bundler/{man → lib/bundler/man}/bundle-binstubs.1 +6 -4
- data/bundler/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +3 -5
- data/bundler/lib/bundler/man/bundle-cache.1 +61 -0
- data/bundler/{man/bundle-package.ronn → lib/bundler/man/bundle-cache.1.ronn} +22 -15
- data/bundler/{man → lib/bundler/man}/bundle-check.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-clean.1 +2 -2
- data/bundler/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-config.1 +78 -60
- data/bundler/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +96 -85
- data/bundler/lib/bundler/man/bundle-console.1 +53 -0
- data/bundler/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/bundler/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-exec.1 +6 -6
- data/bundler/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +6 -6
- data/bundler/lib/bundler/man/bundle-gem.1 +105 -0
- data/bundler/lib/bundler/man/bundle-gem.1.ronn +117 -0
- data/bundler/lib/bundler/man/bundle-help.1 +13 -0
- data/bundler/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/bundler/{man → lib/bundler/man}/bundle-info.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-init.1 +6 -2
- data/bundler/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +3 -1
- data/bundler/{man → lib/bundler/man}/bundle-inject.1 +5 -2
- data/bundler/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +3 -1
- data/bundler/{man → lib/bundler/man}/bundle-install.1 +42 -37
- data/bundler/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +42 -38
- data/bundler/{man → lib/bundler/man}/bundle-list.1 +7 -7
- data/bundler/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +6 -6
- data/bundler/{man → lib/bundler/man}/bundle-lock.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-open.1 +22 -2
- data/bundler/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +9 -1
- data/bundler/{man → lib/bundler/man}/bundle-outdated.1 +3 -10
- data/bundler/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +1 -10
- data/bundler/{man → lib/bundler/man}/bundle-platform.1 +16 -6
- data/bundler/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +14 -7
- data/bundler/lib/bundler/man/bundle-plugin.1 +81 -0
- data/bundler/lib/bundler/man/bundle-plugin.1.ronn +59 -0
- data/bundler/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-remove.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-show.1 +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-update.1 +8 -8
- data/bundler/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +8 -7
- data/bundler/lib/bundler/man/bundle-version.1 +35 -0
- data/bundler/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/bundler/{man → lib/bundler/man}/bundle-viz.1 +4 -1
- data/bundler/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +2 -0
- data/bundler/{man → lib/bundler/man}/bundle.1 +17 -12
- data/bundler/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +14 -9
- data/bundler/lib/bundler/man/gemfile.5 +723 -0
- data/bundler/{man → lib/bundler/man}/gemfile.5.ronn +112 -95
- data/bundler/lib/bundler/man/index.txt +29 -0
- data/bundler/lib/bundler/match_metadata.rb +13 -0
- data/bundler/lib/bundler/match_platform.rb +1 -2
- data/bundler/lib/bundler/match_remote_metadata.rb +29 -0
- data/bundler/lib/bundler/mirror.rb +10 -12
- data/bundler/lib/bundler/plugin/api/source.rb +29 -15
- data/bundler/lib/bundler/plugin/api.rb +1 -1
- data/bundler/lib/bundler/plugin/dsl.rb +1 -1
- data/bundler/lib/bundler/plugin/index.rb +31 -8
- data/bundler/lib/bundler/plugin/installer/git.rb +0 -4
- data/bundler/lib/bundler/plugin/installer/rubygems.rb +1 -9
- data/bundler/lib/bundler/plugin/installer.rb +35 -22
- data/bundler/lib/bundler/plugin/source_list.rb +5 -1
- data/bundler/lib/bundler/plugin.rb +102 -42
- data/bundler/lib/bundler/process_lock.rb +1 -1
- data/bundler/lib/bundler/remote_specification.rb +15 -8
- data/bundler/lib/bundler/resolver/base.rb +77 -0
- data/bundler/lib/bundler/resolver/candidate.rb +94 -0
- data/bundler/lib/bundler/resolver/incompatibility.rb +15 -0
- data/bundler/lib/bundler/resolver/package.rb +72 -0
- data/bundler/lib/bundler/resolver/root.rb +25 -0
- data/bundler/lib/bundler/resolver/spec_group.rb +49 -73
- data/bundler/lib/bundler/resolver.rb +343 -300
- data/bundler/lib/bundler/retry.rb +4 -4
- data/bundler/lib/bundler/ruby_dsl.rb +1 -1
- data/bundler/lib/bundler/ruby_version.rb +9 -37
- data/bundler/lib/bundler/rubygems_ext.rb +235 -92
- data/bundler/lib/bundler/rubygems_gem_installer.rb +87 -21
- data/bundler/lib/bundler/rubygems_integration.rb +179 -515
- data/bundler/lib/bundler/runtime.rb +25 -40
- data/bundler/lib/bundler/self_manager.rb +168 -0
- data/bundler/lib/bundler/settings.rb +162 -118
- data/bundler/lib/bundler/setup.rb +11 -12
- data/bundler/lib/bundler/shared_helpers.rb +61 -102
- data/bundler/lib/bundler/similarity_detector.rb +3 -3
- data/bundler/lib/bundler/source/git/git_proxy.rb +257 -128
- data/bundler/lib/bundler/source/git.rb +84 -61
- data/bundler/lib/bundler/source/metadata.rb +9 -9
- data/bundler/lib/bundler/source/path/installer.rb +11 -32
- data/bundler/lib/bundler/source/path.rb +28 -17
- data/bundler/lib/bundler/source/rubygems/remote.rb +3 -4
- data/bundler/lib/bundler/source/rubygems.rb +171 -197
- data/bundler/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/bundler/lib/bundler/source.rb +30 -10
- data/bundler/lib/bundler/source_list.rb +112 -67
- data/bundler/lib/bundler/source_map.rb +71 -0
- data/bundler/lib/bundler/spec_set.rb +86 -72
- data/bundler/lib/bundler/stub_specification.rb +45 -37
- data/bundler/lib/bundler/templates/Executable +3 -5
- data/bundler/lib/bundler/templates/Executable.bundler +21 -17
- data/bundler/lib/bundler/templates/Executable.standalone +4 -4
- data/bundler/lib/bundler/templates/Gemfile +0 -2
- 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/Cargo.toml.tt +7 -0
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +22 -2
- data/bundler/lib/bundler/templates/newgem/README.md.tt +13 -15
- data/bundler/lib/bundler/templates/newgem/Rakefile.tt +33 -5
- data/bundler/lib/bundler/templates/newgem/bin/console.tt +1 -0
- data/bundler/lib/bundler/templates/newgem/circleci/config.yml.tt +25 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/{extconf.rb.tt → extconf-c.rb.tt} +2 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +37 -0
- data/bundler/lib/bundler/templates/newgem/gitignore.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +18 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +4 -2
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +36 -41
- data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
- data/bundler/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -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/standard.yml.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
- data/bundler/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/test_newgem.rb.tt} +3 -1
- 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/ui/rg_proxy.rb +1 -1
- data/bundler/lib/bundler/ui/shell.rb +39 -20
- data/bundler/lib/bundler/ui/silent.rb +21 -5
- data/bundler/lib/bundler/ui.rb +3 -3
- data/bundler/lib/bundler/uri_credentials_filter.rb +10 -4
- data/bundler/lib/bundler/vendor/.document +1 -0
- data/bundler/lib/bundler/vendor/connection_pool/LICENSE +20 -0
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +174 -0
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +56 -0
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +128 -0
- data/bundler/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +1493 -425
- data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- 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/net-http-persistent/lib/net/http/persistent.rb +302 -462
- data/bundler/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +189 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +155 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +60 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +129 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +411 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +243 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
- data/bundler/lib/bundler/vendor/thor/LICENSE.md +20 -0
- 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 +25 -14
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +20 -10
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +34 -15
- 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/core_ext/hash_with_indifferent_access.rb +6 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +83 -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/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/line_editor.rb +2 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- 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 +40 -6
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- 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/basic.rb +88 -13
- 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/shell.rb +5 -5
- 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/thor/lib/thor.rb +16 -9
- data/bundler/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/bundler/lib/bundler/vendor/tsort/lib/tsort.rb +452 -0
- data/bundler/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +729 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +100 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +1587 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +125 -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 +22 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb +293 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +539 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +119 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/ws.rb +83 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/wss.rb +23 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/bundler/lib/bundler/vendored_fileutils.rb +1 -6
- data/bundler/lib/bundler/vendored_persistent.rb +2 -39
- data/bundler/lib/bundler/{vendored_molinillo.rb → vendored_pub_grub.rb} +1 -1
- data/bundler/lib/bundler/vendored_thor.rb +2 -2
- data/bundler/lib/bundler/vendored_tsort.rb +4 -0
- data/bundler/lib/bundler/vendored_uri.rb +4 -0
- data/bundler/lib/bundler/version.rb +5 -20
- data/bundler/lib/bundler/vlad.rb +2 -2
- data/bundler/lib/bundler/worker.rb +26 -15
- data/bundler/lib/bundler/yaml_serializer.rb +3 -4
- data/bundler/lib/bundler.rb +285 -183
- data/hide_lib_for_update/note.txt +0 -4
- data/lib/rubygems/available_set.rb +7 -8
- data/lib/rubygems/basic_specification.rb +44 -31
- data/lib/rubygems/bundler_version_finder.rb +28 -50
- data/lib/rubygems/command.rb +104 -46
- data/lib/rubygems/command_manager.rb +35 -16
- data/lib/rubygems/commands/build_command.rb +77 -26
- data/lib/rubygems/commands/cert_command.rb +78 -76
- data/lib/rubygems/commands/check_command.rb +20 -22
- data/lib/rubygems/commands/cleanup_command.rb +36 -32
- data/lib/rubygems/commands/contents_command.rb +16 -18
- data/lib/rubygems/commands/dependency_command.rb +39 -50
- data/lib/rubygems/commands/environment_command.rb +11 -13
- data/lib/rubygems/commands/fetch_command.rb +33 -16
- data/lib/rubygems/commands/generate_index_command.rb +18 -17
- data/lib/rubygems/commands/help_command.rb +7 -7
- data/lib/rubygems/commands/info_command.rb +11 -6
- data/lib/rubygems/commands/install_command.rb +45 -79
- data/lib/rubygems/commands/list_command.rb +9 -8
- data/lib/rubygems/commands/lock_command.rb +7 -9
- data/lib/rubygems/commands/mirror_command.rb +3 -4
- data/lib/rubygems/commands/open_command.rb +11 -14
- data/lib/rubygems/commands/outdated_command.rb +5 -6
- data/lib/rubygems/commands/owner_command.rb +29 -22
- data/lib/rubygems/commands/pristine_command.rb +61 -51
- data/lib/rubygems/commands/push_command.rb +26 -63
- data/lib/rubygems/commands/query_command.rb +21 -337
- data/lib/rubygems/commands/rdoc_command.rb +26 -26
- data/lib/rubygems/commands/search_command.rb +8 -8
- data/lib/rubygems/commands/server_command.rb +16 -77
- data/lib/rubygems/commands/setup_command.rb +282 -241
- data/lib/rubygems/commands/signin_command.rb +9 -10
- data/lib/rubygems/commands/signout_command.rb +7 -9
- data/lib/rubygems/commands/sources_command.rb +42 -26
- data/lib/rubygems/commands/specification_command.rb +25 -20
- data/lib/rubygems/commands/stale_command.rb +3 -3
- data/lib/rubygems/commands/uninstall_command.rb +58 -49
- data/lib/rubygems/commands/unpack_command.rb +15 -44
- data/lib/rubygems/commands/update_command.rb +133 -81
- data/lib/rubygems/commands/which_command.rb +8 -11
- data/lib/rubygems/commands/yank_command.rb +22 -19
- data/lib/rubygems/compatibility.rb +7 -5
- data/lib/rubygems/config_file.rb +101 -47
- data/lib/rubygems/core_ext/kernel_gem.rb +8 -12
- data/lib/rubygems/core_ext/kernel_require.rb +124 -83
- data/lib/rubygems/core_ext/kernel_warn.rb +35 -30
- data/lib/rubygems/core_ext/tcpsocket_init.rb +52 -0
- data/lib/rubygems/defaults.rb +131 -55
- data/lib/rubygems/dependency.rb +44 -27
- data/lib/rubygems/dependency_installer.rb +49 -205
- data/lib/rubygems/dependency_list.rb +24 -25
- data/lib/rubygems/deprecate.rb +106 -12
- data/lib/rubygems/doctor.rb +22 -22
- data/lib/rubygems/errors.rb +8 -14
- data/lib/rubygems/exceptions.rb +35 -33
- data/lib/rubygems/ext/build_error.rb +2 -0
- data/lib/rubygems/ext/builder.rb +71 -95
- data/lib/rubygems/ext/cargo_builder/link_flag_converter.rb +27 -0
- data/lib/rubygems/ext/cargo_builder.rb +360 -0
- 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 +45 -65
- data/lib/rubygems/ext/rake_builder.rb +7 -10
- data/lib/rubygems/ext.rb +7 -6
- data/lib/rubygems/gem_runner.rb +15 -26
- data/lib/rubygems/gemcutter_utilities.rb +179 -54
- data/lib/rubygems/indexer.rb +38 -53
- data/lib/rubygems/install_default_message.rb +2 -2
- data/lib/rubygems/install_message.rb +2 -2
- data/lib/rubygems/install_update_options.rb +73 -64
- data/lib/rubygems/installer.rb +230 -173
- data/lib/rubygems/installer_uninstaller_utils.rb +29 -0
- data/lib/rubygems/local_remote_options.rb +22 -24
- data/lib/rubygems/mock_gem_ui.rb +2 -5
- data/lib/rubygems/name_tuple.rb +10 -14
- data/lib/rubygems/openssl.rb +7 -0
- data/lib/rubygems/optparse/.document +1 -0
- data/lib/rubygems/optparse/COPYING +56 -0
- data/lib/rubygems/optparse/lib/optionparser.rb +2 -0
- data/lib/rubygems/optparse/lib/optparse/ac.rb +54 -0
- data/lib/rubygems/optparse/lib/optparse/date.rb +18 -0
- data/lib/rubygems/optparse/lib/optparse/kwargs.rb +22 -0
- data/lib/rubygems/optparse/lib/optparse/shellwords.rb +7 -0
- data/lib/rubygems/optparse/lib/optparse/time.rb +11 -0
- data/lib/rubygems/optparse/lib/optparse/uri.rb +7 -0
- data/lib/rubygems/optparse/lib/optparse/version.rb +71 -0
- data/lib/rubygems/optparse/lib/optparse.rb +2308 -0
- data/lib/rubygems/optparse.rb +3 -0
- data/lib/rubygems/package/digest_io.rb +0 -2
- data/lib/rubygems/package/file_source.rb +2 -4
- data/lib/rubygems/package/io_source.rb +4 -2
- data/lib/rubygems/package/old.rb +9 -11
- data/lib/rubygems/package/tar_header.rb +73 -66
- data/lib/rubygems/package/tar_reader/entry.rb +8 -9
- data/lib/rubygems/package/tar_reader.rb +16 -13
- data/lib/rubygems/package/tar_writer.rb +12 -22
- data/lib/rubygems/package.rb +142 -125
- data/lib/rubygems/package_task.rb +5 -11
- data/lib/rubygems/path_support.rb +3 -8
- data/lib/rubygems/platform.rb +113 -73
- data/lib/rubygems/psych_tree.rb +1 -1
- data/lib/rubygems/query_utils.rb +351 -0
- data/lib/rubygems/rdoc.rb +4 -16
- data/lib/rubygems/remote_fetcher.rb +64 -136
- data/lib/rubygems/request/connection_pools.rb +7 -11
- data/lib/rubygems/request/http_pool.rb +2 -3
- data/lib/rubygems/request.rb +31 -32
- data/lib/rubygems/request_set/gem_dependency_api.rb +135 -136
- data/lib/rubygems/request_set/lockfile/parser.rb +28 -28
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +5 -5
- data/lib/rubygems/request_set/lockfile.rb +21 -20
- data/lib/rubygems/request_set.rb +30 -43
- data/lib/rubygems/requirement.rb +42 -64
- data/lib/rubygems/resolver/activation_request.rb +29 -53
- data/lib/rubygems/resolver/api_set/gem_parser.rb +20 -0
- data/lib/rubygems/resolver/api_set.rb +33 -26
- data/lib/rubygems/resolver/api_specification.rb +30 -16
- data/lib/rubygems/resolver/best_set.rb +9 -11
- data/lib/rubygems/resolver/composed_set.rb +3 -5
- data/lib/rubygems/resolver/conflict.rb +12 -19
- data/lib/rubygems/resolver/current_set.rb +0 -2
- data/lib/rubygems/resolver/dependency_request.rb +3 -5
- data/lib/rubygems/resolver/git_set.rb +2 -4
- data/lib/rubygems/resolver/git_specification.rb +6 -8
- data/lib/rubygems/resolver/index_set.rb +4 -6
- data/lib/rubygems/resolver/index_specification.rb +38 -7
- data/lib/rubygems/resolver/installed_specification.rb +4 -6
- data/lib/rubygems/resolver/installer_set.rb +69 -27
- data/lib/rubygems/resolver/local_specification.rb +2 -4
- data/lib/rubygems/resolver/lock_set.rb +7 -9
- data/lib/rubygems/resolver/lock_specification.rb +6 -8
- data/lib/rubygems/resolver/molinillo/LICENSE +9 -0
- 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/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/dependency_graph.rb +42 -9
- data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +82 -8
- data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb +13 -1
- 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/molinillo/lib/molinillo.rb +6 -5
- data/lib/rubygems/resolver/molinillo.rb +1 -1
- data/lib/rubygems/resolver/requirement_list.rb +0 -1
- data/lib/rubygems/resolver/set.rb +0 -3
- data/lib/rubygems/resolver/source_set.rb +0 -2
- data/lib/rubygems/resolver/spec_specification.rb +14 -2
- data/lib/rubygems/resolver/specification.rb +14 -3
- data/lib/rubygems/resolver/vendor_set.rb +1 -3
- data/lib/rubygems/resolver/vendor_specification.rb +3 -5
- data/lib/rubygems/resolver.rb +58 -54
- data/lib/rubygems/s3_uri_signer.rb +175 -0
- data/lib/rubygems/safe_yaml.rb +14 -16
- data/lib/rubygems/security/policies.rb +47 -47
- data/lib/rubygems/security/policy.rb +25 -29
- data/lib/rubygems/security/signer.rb +16 -18
- data/lib/rubygems/security/trust_dir.rb +5 -6
- data/lib/rubygems/security.rb +90 -69
- data/lib/rubygems/security_option.rb +7 -8
- data/lib/rubygems/source/git.rb +30 -30
- data/lib/rubygems/source/installed.rb +1 -3
- data/lib/rubygems/source/local.rb +4 -6
- data/lib/rubygems/source/lock.rb +0 -2
- data/lib/rubygems/source/specific_file.rb +1 -3
- data/lib/rubygems/source/vendor.rb +0 -2
- data/lib/rubygems/source.rb +50 -38
- data/lib/rubygems/source_list.rb +9 -13
- data/lib/rubygems/spec_fetcher.rb +52 -64
- data/lib/rubygems/specification.rb +432 -463
- data/lib/rubygems/specification_policy.rb +185 -87
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +21 -0
- data/lib/rubygems/stub_specification.rb +24 -29
- data/lib/rubygems/text.rb +21 -21
- data/lib/rubygems/tsort/.document +1 -0
- data/lib/rubygems/tsort/LICENSE.txt +22 -0
- data/lib/rubygems/tsort/lib/tsort.rb +452 -0
- data/lib/rubygems/tsort.rb +3 -0
- data/lib/rubygems/uninstaller.rb +110 -57
- data/lib/rubygems/unknown_command_spell_checker.rb +21 -0
- data/lib/rubygems/update_suggestion.rb +69 -0
- data/lib/rubygems/uri.rb +126 -0
- data/lib/rubygems/uri_formatter.rb +2 -4
- data/lib/rubygems/user_interaction.rb +46 -49
- data/lib/rubygems/util/licenses.rb +511 -404
- data/lib/rubygems/util.rb +40 -56
- data/lib/rubygems/validator.rb +15 -37
- data/lib/rubygems/version.rb +48 -29
- data/lib/rubygems/version_option.rb +11 -5
- data/lib/rubygems.rb +305 -332
- data/rubygems-update.gemspec +6 -13
- data/setup.rb +11 -22
- data/test/rubygems/alternate_cert.pem +14 -14
- data/test/rubygems/alternate_cert_32.pem +15 -15
- data/test/rubygems/alternate_key.pem +25 -25
- data/test/rubygems/bundler_test_gem.rb +419 -0
- data/test/rubygems/ca_cert.pem +74 -65
- data/test/rubygems/child_cert.pem +15 -16
- data/test/rubygems/child_cert_32.pem +15 -16
- data/test/rubygems/child_key.pem +25 -25
- data/test/rubygems/client.pem +103 -45
- data/test/rubygems/data/excon-0.7.7.gemspec.rz +0 -0
- 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/data/pry-0.4.7.gemspec.rz +0 -0
- data/test/rubygems/encrypted_private_key.pem +26 -26
- data/test/rubygems/expired_cert.pem +15 -15
- data/test/rubygems/future_cert.pem +15 -15
- data/test/rubygems/future_cert_32.pem +15 -15
- data/test/rubygems/grandchild_cert.pem +15 -16
- data/test/rubygems/grandchild_cert_32.pem +15 -16
- data/test/rubygems/grandchild_key.pem +25 -25
- data/{lib/rubygems/test_case.rb → test/rubygems/helper.rb} +505 -507
- data/{lib → test}/rubygems/installer_test_case.rb +115 -53
- data/test/rubygems/invalid_issuer_cert.pem +16 -16
- data/test/rubygems/invalid_issuer_cert_32.pem +16 -16
- data/test/rubygems/invalid_key.pem +25 -25
- data/test/rubygems/invalid_signer_cert.pem +15 -15
- data/test/rubygems/invalid_signer_cert_32.pem +15 -15
- data/test/rubygems/invalidchild_cert.pem +15 -16
- data/test/rubygems/invalidchild_cert_32.pem +15 -16
- data/test/rubygems/invalidchild_key.pem +25 -25
- data/{lib → test}/rubygems/package/tar_test_case.rb +4 -6
- data/test/rubygems/packages/Bluebie-legs-0.6.2.gem +0 -0
- data/test/rubygems/packages/ascii_binder-0.1.10.1.gem +0 -0
- data/test/rubygems/packages/ill-formatted-platform-1.0.0.10.gem +0 -0
- data/test/rubygems/plugin/exception/rubygems_plugin.rb +1 -1
- data/test/rubygems/plugin/standarderror/rubygems_plugin.rb +1 -1
- data/test/rubygems/private_ec_key.pem +9 -0
- data/test/rubygems/private_key.pem +25 -25
- data/test/rubygems/public_cert.pem +16 -16
- data/test/rubygems/public_cert_32.pem +15 -15
- data/test/rubygems/public_key.pem +7 -7
- data/test/rubygems/rubygems/commands/crash_command.rb +0 -2
- data/test/rubygems/rubygems_plugin.rb +2 -4
- 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/ssl_cert.pem +78 -17
- data/test/rubygems/ssl_key.pem +25 -13
- data/test/rubygems/test_bundled_ca.rb +44 -47
- data/test/rubygems/test_config.rb +5 -7
- data/test/rubygems/test_deprecate.rb +90 -10
- data/test/rubygems/test_exit.rb +17 -0
- data/test/rubygems/test_gem.rb +679 -885
- data/test/rubygems/test_gem_available_set.rb +24 -25
- data/test/rubygems/test_gem_bundler_version_finder.rb +42 -42
- data/test/rubygems/test_gem_command.rb +186 -39
- data/test/rubygems/test_gem_command_manager.rb +166 -36
- data/test/rubygems/test_gem_commands_build_command.rb +436 -52
- data/test/rubygems/test_gem_commands_cert_command.rb +193 -124
- data/test/rubygems/test_gem_commands_check_command.rb +9 -11
- data/test/rubygems/test_gem_commands_cleanup_command.rb +87 -62
- data/test/rubygems/test_gem_commands_contents_command.rb +73 -42
- data/test/rubygems/test_gem_commands_dependency_command.rb +39 -41
- data/test/rubygems/test_gem_commands_environment_command.rb +60 -48
- data/test/rubygems/test_gem_commands_fetch_command.rb +163 -32
- data/test/rubygems/test_gem_commands_generate_index_command.rb +39 -9
- data/test/rubygems/test_gem_commands_help_command.rb +34 -19
- data/test/rubygems/test_gem_commands_info_command.rb +34 -9
- data/test/rubygems/test_gem_commands_install_command.rb +600 -173
- data/test/rubygems/test_gem_commands_list_command.rb +5 -7
- data/test/rubygems/test_gem_commands_lock_command.rb +11 -13
- data/test/rubygems/test_gem_commands_mirror.rb +3 -4
- data/test/rubygems/test_gem_commands_open_command.rb +16 -19
- data/test/rubygems/test_gem_commands_outdated_command.rb +24 -7
- data/test/rubygems/test_gem_commands_owner_command.rb +183 -49
- data/test/rubygems/test_gem_commands_pristine_command.rb +222 -89
- data/test/rubygems/test_gem_commands_push_command.rb +178 -69
- data/test/rubygems/test_gem_commands_query_command.rb +114 -89
- data/test/rubygems/test_gem_commands_search_command.rb +2 -4
- data/test/rubygems/test_gem_commands_server_command.rb +6 -46
- data/test/rubygems/test_gem_commands_setup_command.rb +334 -157
- data/test/rubygems/test_gem_commands_signin_command.rb +187 -27
- data/test/rubygems/test_gem_commands_signout_command.rb +3 -10
- data/test/rubygems/test_gem_commands_sources_command.rb +266 -33
- data/test/rubygems/test_gem_commands_specification_command.rb +81 -55
- data/test/rubygems/test_gem_commands_stale_command.rb +4 -6
- data/test/rubygems/test_gem_commands_uninstall_command.rb +230 -95
- data/test/rubygems/test_gem_commands_unpack_command.rb +32 -34
- data/test/rubygems/test_gem_commands_update_command.rb +412 -102
- data/test/rubygems/test_gem_commands_which_command.rb +12 -14
- data/test/rubygems/test_gem_commands_yank_command.rb +107 -26
- data/test/rubygems/test_gem_config_file.rb +120 -96
- data/test/rubygems/test_gem_dependency.rb +94 -86
- data/test/rubygems/test_gem_dependency_installer.rb +305 -388
- data/test/rubygems/test_gem_dependency_list.rb +66 -61
- data/test/rubygems/test_gem_dependency_resolution_error.rb +5 -7
- data/test/rubygems/test_gem_doctor.rb +73 -47
- data/test/rubygems/test_gem_ext_builder.rb +116 -106
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/.gitignore +1 -0
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/custom_name.gemspec +8 -0
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib/Cargo.lock +233 -0
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib/Cargo.toml +10 -0
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib/src/lib.rs +27 -0
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/lib/custom_name.rb +1 -0
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/.gitignore +1 -0
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +233 -0
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +10 -0
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/rust_ruby_example.gemspec +8 -0
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/src/lib.rs +51 -0
- data/test/rubygems/test_gem_ext_cargo_builder.rb +166 -0
- data/test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb +33 -0
- data/test/rubygems/test_gem_ext_cargo_builder_unit.rb +60 -0
- data/test/rubygems/test_gem_ext_cmake_builder.rb +32 -37
- data/test/rubygems/test_gem_ext_configure_builder.rb +23 -31
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +75 -79
- data/test/rubygems/test_gem_ext_rake_builder.rb +49 -30
- data/test/rubygems/test_gem_gem_runner.rb +52 -7
- data/test/rubygems/test_gem_gemcutter_utilities.rb +91 -76
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +4 -6
- data/test/rubygems/test_gem_indexer.rb +120 -105
- data/test/rubygems/test_gem_install_update_options.rb +57 -33
- data/test/rubygems/test_gem_installer.rb +1230 -644
- data/test/rubygems/test_gem_local_remote_options.rb +11 -13
- data/test/rubygems/test_gem_name_tuple.rb +4 -6
- data/test/rubygems/test_gem_package.rb +396 -266
- data/test/rubygems/test_gem_package_old.rb +57 -56
- data/test/rubygems/test_gem_package_tar_header.rb +108 -50
- data/test/rubygems/test_gem_package_tar_reader.rb +8 -10
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +77 -20
- data/test/rubygems/test_gem_package_tar_writer.rb +107 -101
- data/test/rubygems/test_gem_package_task.rb +58 -25
- data/test/rubygems/test_gem_path_support.rb +29 -29
- data/test/rubygems/test_gem_platform.rb +388 -199
- data/test/rubygems/test_gem_rdoc.rb +20 -155
- data/test/rubygems/test_gem_remote_fetcher.rb +474 -303
- data/test/rubygems/test_gem_request.rb +128 -85
- data/test/rubygems/test_gem_request_connection_pools.rb +32 -32
- data/test/rubygems/test_gem_request_set.rb +186 -110
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +280 -261
- data/test/rubygems/test_gem_request_set_lockfile.rb +93 -94
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +68 -69
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +136 -136
- data/test/rubygems/test_gem_requirement.rb +140 -55
- data/test/rubygems/test_gem_resolver.rb +224 -115
- data/test/rubygems/test_gem_resolver_activation_request.rb +9 -40
- data/test/rubygems/test_gem_resolver_api_set.rb +79 -78
- data/test/rubygems/test_gem_resolver_api_specification.rb +47 -49
- data/test/rubygems/test_gem_resolver_best_set.rb +43 -22
- data/test/rubygems/test_gem_resolver_composed_set.rb +1 -3
- data/test/rubygems/test_gem_resolver_conflict.rb +12 -18
- data/test/rubygems/test_gem_resolver_dependency_request.rb +15 -17
- data/test/rubygems/test_gem_resolver_git_set.rb +22 -24
- data/test/rubygems/test_gem_resolver_git_specification.rb +22 -22
- data/test/rubygems/test_gem_resolver_index_set.rb +14 -16
- data/test/rubygems/test_gem_resolver_index_specification.rb +21 -18
- data/test/rubygems/test_gem_resolver_installed_specification.rb +5 -8
- data/test/rubygems/test_gem_resolver_installer_set.rb +106 -44
- data/test/rubygems/test_gem_resolver_local_specification.rb +7 -9
- data/test/rubygems/test_gem_resolver_lock_set.rb +15 -17
- data/test/rubygems/test_gem_resolver_lock_specification.rb +17 -19
- data/test/rubygems/test_gem_resolver_requirement_list.rb +1 -3
- data/test/rubygems/test_gem_resolver_specification.rb +8 -10
- data/test/rubygems/test_gem_resolver_vendor_set.rb +9 -11
- data/test/rubygems/test_gem_resolver_vendor_specification.rb +10 -12
- data/test/rubygems/test_gem_security.rb +109 -79
- data/test/rubygems/test_gem_security_policy.rb +102 -107
- data/test/rubygems/test_gem_security_signer.rb +51 -52
- data/test/rubygems/test_gem_security_trust_dir.rb +14 -16
- data/test/rubygems/test_gem_silent_ui.rb +47 -42
- data/test/rubygems/test_gem_source.rb +66 -51
- data/test/rubygems/test_gem_source_fetch_problem.rb +17 -8
- data/test/rubygems/test_gem_source_git.rb +74 -74
- data/test/rubygems/test_gem_source_installed.rb +16 -18
- data/test/rubygems/test_gem_source_list.rb +5 -5
- data/test/rubygems/test_gem_source_local.rb +15 -16
- data/test/rubygems/test_gem_source_lock.rb +31 -33
- data/test/rubygems/test_gem_source_specific_file.rb +18 -19
- data/test/rubygems/test_gem_source_subpath_problem.rb +49 -0
- data/test/rubygems/test_gem_source_vendor.rb +13 -15
- data/test/rubygems/test_gem_spec_fetcher.rb +74 -67
- data/test/rubygems/test_gem_specification.rb +1051 -1071
- data/test/rubygems/test_gem_stream_ui.rb +25 -23
- data/test/rubygems/test_gem_stub_specification.rb +39 -56
- data/test/rubygems/test_gem_text.rb +8 -3
- data/test/rubygems/test_gem_uninstaller.rb +269 -100
- data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +3 -5
- data/test/rubygems/test_gem_update_suggestion.rb +208 -0
- data/test/rubygems/test_gem_uri.rb +39 -0
- data/test/rubygems/test_gem_uri_formatter.rb +14 -16
- data/test/rubygems/test_gem_util.rb +46 -34
- data/test/rubygems/test_gem_validator.rb +12 -15
- data/test/rubygems/test_gem_version.rb +49 -34
- data/test/rubygems/test_gem_version_option.rb +16 -18
- data/test/rubygems/test_kernel.rb +61 -53
- data/test/rubygems/test_project_sanity.rb +20 -0
- data/test/rubygems/test_remote_fetch_error.rb +7 -8
- data/test/rubygems/test_require.rb +415 -121
- data/test/rubygems/test_rubygems.rb +74 -0
- data/{lib/rubygems/test_utilities.rb → test/rubygems/utilities.rb} +74 -50
- data/test/rubygems/wrong_key_cert.pem +15 -15
- data/test/rubygems/wrong_key_cert_32.pem +15 -15
- data/test/test_changelog_generator.rb +17 -0
- metadata +218 -244
- data/.rubocop.yml +0 -66
- data/.travis.yml +0 -38
- data/History.txt +0 -3965
- data/Rakefile +0 -372
- 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/dep_proxy.rb +0 -48
- data/bundler/lib/bundler/gem_remote_fetcher.rb +0 -43
- data/bundler/lib/bundler/gemdeps.rb +0 -29
- data/bundler/lib/bundler/psyched_yaml.rb +0 -37
- 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/gems.rb +0 -8
- data/bundler/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
- data/bundler/lib/bundler/templates/newgem/travis.yml.tt +0 -7
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -81
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +0 -36
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -66
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -62
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -63
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -61
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +0 -126
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -46
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -36
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -136
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -223
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +0 -143
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -6
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +0 -101
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -67
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +0 -837
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +0 -46
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +0 -58
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -12
- 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/bundler/lib/bundler/version_ranges.rb +0 -76
- data/bundler/man/bundle-gem.1 +0 -80
- data/bundler/man/bundle-gem.ronn +0 -78
- data/bundler/man/bundle-package.1 +0 -55
- data/lib/rubygems/psych_additions.rb +0 -10
- data/lib/rubygems/server.rb +0 -878
- 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/rubygems/syck_hack.rb +0 -77
- data/lib/ubygems.rb +0 -14
- data/test/rubygems/bogussources.rb +0 -9
- data/test/rubygems/data/null-type.gemspec.rz +0 -0
- data/test/rubygems/test_gem_server.rb +0 -607
- data/util/CL2notes +0 -55
- data/util/ci +0 -77
- data/util/create_certs.rb +0 -171
- 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
- /data/bundler/lib/bundler/{ssl_certs → man}/.document +0 -0
- /data/bundler/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
- /data/bundler/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
- /data/bundler/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
- /data/bundler/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
- /data/bundler/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
- /data/bundler/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
- /data/bundler/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
- /data/{bundler/lib/bundler/ssl_certs/index.rubygems.org → lib/rubygems/ssl_certs/rubygems.org}/GlobalSignRootCA.pem +0 -0
@@ -1,24 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
#
|
2
|
+
#
|
3
3
|
#--
|
4
4
|
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
5
5
|
# All rights reserved.
|
6
6
|
# See LICENSE.txt for permissions.
|
7
7
|
#++
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
require 'rubygems/basic_specification'
|
15
|
-
require 'rubygems/stub_specification'
|
16
|
-
require 'rubygems/specification_policy'
|
17
|
-
require 'rubygems/util/list'
|
18
|
-
require 'stringio'
|
9
|
+
require_relative "deprecate"
|
10
|
+
require_relative "basic_specification"
|
11
|
+
require_relative "stub_specification"
|
12
|
+
require_relative "platform"
|
13
|
+
require_relative "util/list"
|
19
14
|
|
20
15
|
##
|
21
|
-
# The Specification class contains the information for a
|
16
|
+
# The Specification class contains the information for a gem. Typically
|
22
17
|
# defined in a .gemspec file or a Rakefile, and looks like this:
|
23
18
|
#
|
24
19
|
# Gem::Specification.new do |s|
|
@@ -39,7 +34,6 @@ require 'stringio'
|
|
39
34
|
# items you may add to a specification.
|
40
35
|
|
41
36
|
class Gem::Specification < Gem::BasicSpecification
|
42
|
-
|
43
37
|
extend Gem::Deprecate
|
44
38
|
|
45
39
|
# REFACTOR: Consider breaking out this version stuff into a separate
|
@@ -80,39 +74,36 @@ class Gem::Specification < Gem::BasicSpecification
|
|
80
74
|
# key should be equal to the CURRENT_SPECIFICATION_VERSION.
|
81
75
|
|
82
76
|
SPECIFICATION_VERSION_HISTORY = { # :nodoc:
|
83
|
-
-1 => [
|
84
|
-
1
|
77
|
+
-1 => ["(RubyGems versions up to and including 0.7 did not have versioned specifications)"],
|
78
|
+
1 => [
|
85
79
|
'Deprecated "test_suite_file" in favor of the new, but equivalent, "test_files"',
|
86
|
-
'"test_file=x" is a shortcut for "test_files=[x]"'
|
80
|
+
'"test_file=x" is a shortcut for "test_files=[x]"',
|
87
81
|
],
|
88
|
-
2
|
82
|
+
2 => [
|
89
83
|
'Added "required_rubygems_version"',
|
90
|
-
|
84
|
+
"Now forward-compatible with future versions",
|
91
85
|
],
|
92
|
-
3
|
93
|
-
|
86
|
+
3 => [
|
87
|
+
"Added Fixnum validation to the specification_version",
|
88
|
+
],
|
89
|
+
4 => [
|
90
|
+
"Added sandboxed freeform metadata to the specification version.",
|
94
91
|
],
|
95
|
-
4 => [
|
96
|
-
'Added sandboxed freeform metadata to the specification version.'
|
97
|
-
]
|
98
92
|
}.freeze
|
99
93
|
|
100
94
|
MARSHAL_FIELDS = { # :nodoc:
|
101
95
|
-1 => 16,
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
96
|
+
1 => 16,
|
97
|
+
2 => 16,
|
98
|
+
3 => 17,
|
99
|
+
4 => 18,
|
106
100
|
}.freeze
|
107
101
|
|
108
102
|
today = Time.now.utc
|
109
103
|
TODAY = Time.utc(today.year, today.month, today.day) # :nodoc:
|
110
104
|
|
111
|
-
#
|
112
|
-
|
113
|
-
# rubocop:enable Style/MutableConstant
|
114
|
-
|
115
|
-
private_constant :LOAD_CACHE if defined? private_constant
|
105
|
+
@load_cache = {} # :nodoc:
|
106
|
+
@load_cache_mutex = Thread::Mutex.new
|
116
107
|
|
117
108
|
VALID_NAME_PATTERN = /\A[a-zA-Z0-9\.\-\_]+\z/.freeze # :nodoc:
|
118
109
|
|
@@ -133,66 +124,79 @@ class Gem::Specification < Gem::BasicSpecification
|
|
133
124
|
# Map of attribute names to default values.
|
134
125
|
|
135
126
|
@@default_value = {
|
136
|
-
:authors
|
137
|
-
:autorequire
|
138
|
-
:bindir
|
139
|
-
:cert_chain
|
140
|
-
:date
|
141
|
-
:dependencies
|
142
|
-
:description
|
143
|
-
:email
|
144
|
-
:executables
|
145
|
-
:extensions
|
146
|
-
:extra_rdoc_files
|
147
|
-
:files
|
148
|
-
:homepage
|
149
|
-
:licenses
|
150
|
-
:metadata
|
151
|
-
:name
|
152
|
-
:platform
|
153
|
-
:post_install_message
|
154
|
-
:rdoc_options
|
155
|
-
:require_paths
|
156
|
-
:required_ruby_version
|
127
|
+
:authors => [],
|
128
|
+
:autorequire => nil,
|
129
|
+
:bindir => "bin",
|
130
|
+
:cert_chain => [],
|
131
|
+
:date => nil,
|
132
|
+
:dependencies => [],
|
133
|
+
:description => nil,
|
134
|
+
:email => nil,
|
135
|
+
:executables => [],
|
136
|
+
:extensions => [],
|
137
|
+
:extra_rdoc_files => [],
|
138
|
+
:files => [],
|
139
|
+
:homepage => nil,
|
140
|
+
:licenses => [],
|
141
|
+
:metadata => {},
|
142
|
+
:name => nil,
|
143
|
+
:platform => Gem::Platform::RUBY,
|
144
|
+
:post_install_message => nil,
|
145
|
+
:rdoc_options => [],
|
146
|
+
:require_paths => ["lib"],
|
147
|
+
:required_ruby_version => Gem::Requirement.default,
|
157
148
|
:required_rubygems_version => Gem::Requirement.default,
|
158
|
-
:requirements
|
159
|
-
:rubygems_version
|
160
|
-
:signing_key
|
161
|
-
:specification_version
|
162
|
-
:summary
|
163
|
-
:test_files
|
164
|
-
:version
|
149
|
+
:requirements => [],
|
150
|
+
:rubygems_version => Gem::VERSION,
|
151
|
+
:signing_key => nil,
|
152
|
+
:specification_version => CURRENT_SPECIFICATION_VERSION,
|
153
|
+
:summary => nil,
|
154
|
+
:test_files => [],
|
155
|
+
:version => nil,
|
165
156
|
}.freeze
|
166
157
|
|
167
158
|
# rubocop:disable Style/MutableConstant
|
168
|
-
INITIALIZE_CODE_FOR_DEFAULTS = {
|
159
|
+
INITIALIZE_CODE_FOR_DEFAULTS = {} # :nodoc:
|
169
160
|
# rubocop:enable Style/MutableConstant
|
170
161
|
|
171
162
|
@@default_value.each do |k,v|
|
172
163
|
INITIALIZE_CODE_FOR_DEFAULTS[k] = case v
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
end
|
183
|
-
|
184
|
-
@@attributes = @@default_value.keys.sort_by {
|
185
|
-
@@array_attributes = @@default_value.reject {
|
186
|
-
@@nil_attributes, @@non_nil_attributes = @@default_value.keys.partition
|
164
|
+
when [], {}, true, false, nil, Numeric, Symbol
|
165
|
+
v.inspect
|
166
|
+
when String
|
167
|
+
v.dump
|
168
|
+
when Numeric
|
169
|
+
"default_value(:#{k})"
|
170
|
+
else
|
171
|
+
"default_value(:#{k}).dup"
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
@@attributes = @@default_value.keys.sort_by {|s| s.to_s }
|
176
|
+
@@array_attributes = @@default_value.reject {|k,v| v != [] }.keys
|
177
|
+
@@nil_attributes, @@non_nil_attributes = @@default_value.keys.partition do |k|
|
187
178
|
@@default_value[k].nil?
|
188
|
-
|
179
|
+
end
|
189
180
|
|
190
|
-
|
181
|
+
def self.clear_specs # :nodoc:
|
182
|
+
@@all = nil
|
183
|
+
@@stubs = nil
|
184
|
+
@@stubs_by_name = {}
|
185
|
+
@@spec_with_requirable_file = {}
|
186
|
+
@@active_stub_with_requirable_file = {}
|
187
|
+
end
|
188
|
+
private_class_method :clear_specs
|
189
|
+
|
190
|
+
clear_specs
|
191
191
|
|
192
192
|
# Sentinel object to represent "not found" stubs
|
193
193
|
NOT_FOUND = Struct.new(:to_spec, :this).new # :nodoc:
|
194
|
-
|
195
|
-
|
194
|
+
|
195
|
+
# Tracking removed method calls to warn users during build time.
|
196
|
+
REMOVED_METHODS = [:rubyforge_project=].freeze # :nodoc:
|
197
|
+
def removed_method_calls
|
198
|
+
@removed_method_calls ||= []
|
199
|
+
end
|
196
200
|
|
197
201
|
######################################################################
|
198
202
|
# :section: Required gemspec attributes
|
@@ -220,7 +224,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
220
224
|
attr_reader :version
|
221
225
|
|
222
226
|
##
|
223
|
-
# A short summary of this gem's description. Displayed in
|
227
|
+
# A short summary of this gem's description. Displayed in <tt>gem list -d</tt>.
|
224
228
|
#
|
225
229
|
# The #description should be more detailed than the summary.
|
226
230
|
#
|
@@ -244,12 +248,11 @@ class Gem::Specification < Gem::BasicSpecification
|
|
244
248
|
# require 'rake'
|
245
249
|
# spec.files = FileList['lib/**/*.rb',
|
246
250
|
# 'bin/*',
|
247
|
-
# '[A-Z]*'
|
248
|
-
# 'test/**/*'].to_a
|
251
|
+
# '[A-Z]*'].to_a
|
249
252
|
#
|
250
253
|
# # or without Rake...
|
251
254
|
# spec.files = Dir['lib/**/*.rb'] + Dir['bin/*']
|
252
|
-
# spec.files += Dir['[A-Z]*']
|
255
|
+
# spec.files += Dir['[A-Z]*']
|
253
256
|
# spec.files.reject! { |fn| fn.include? "CVS" }
|
254
257
|
|
255
258
|
def files
|
@@ -267,7 +270,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
267
270
|
# A list of authors for this gem.
|
268
271
|
#
|
269
272
|
# Alternatively, a single author can be specified by assigning a string to
|
270
|
-
#
|
273
|
+
# +spec.author+
|
271
274
|
#
|
272
275
|
# Usage:
|
273
276
|
#
|
@@ -280,6 +283,15 @@ class Gem::Specification < Gem::BasicSpecification
|
|
280
283
|
######################################################################
|
281
284
|
# :section: Recommended gemspec attributes
|
282
285
|
|
286
|
+
##
|
287
|
+
# The version of Ruby required by this gem
|
288
|
+
#
|
289
|
+
# Usage:
|
290
|
+
#
|
291
|
+
# spec.required_ruby_version = '>= 2.7.0'
|
292
|
+
|
293
|
+
attr_reader :required_ruby_version
|
294
|
+
|
283
295
|
##
|
284
296
|
# A long description of this gem
|
285
297
|
#
|
@@ -323,17 +335,21 @@ class Gem::Specification < Gem::BasicSpecification
|
|
323
335
|
# This should just be the name of your license. The full text of the license
|
324
336
|
# should be inside of the gem (at the top level) when you build it.
|
325
337
|
#
|
326
|
-
# The simplest way
|
338
|
+
# The simplest way is to specify the standard SPDX ID
|
327
339
|
# https://spdx.org/licenses/ for the license.
|
328
|
-
# Ideally you should pick one that is OSI (Open Source Initiative)
|
340
|
+
# Ideally, you should pick one that is OSI (Open Source Initiative)
|
329
341
|
# http://opensource.org/licenses/alphabetical approved.
|
330
342
|
#
|
331
|
-
# The most commonly used OSI
|
343
|
+
# The most commonly used OSI-approved licenses are MIT and Apache-2.0.
|
332
344
|
# GitHub also provides a license picker at http://choosealicense.com/.
|
333
345
|
#
|
346
|
+
# You can also use a custom license file along with your gemspec and specify
|
347
|
+
# a LicenseRef-<idstring>, where idstring is the name of the file containing
|
348
|
+
# the license text.
|
349
|
+
#
|
334
350
|
# You should specify a license for your gem so that people know how they are
|
335
|
-
# permitted to use it
|
336
|
-
# specifying a license means all rights are reserved; others have no
|
351
|
+
# permitted to use it and any restrictions you're placing on it. Not
|
352
|
+
# specifying a license means all rights are reserved; others have no right
|
337
353
|
# to use the code for any purpose.
|
338
354
|
#
|
339
355
|
# You can set multiple licenses with #licenses=
|
@@ -364,8 +380,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
364
380
|
|
365
381
|
##
|
366
382
|
# The metadata holds extra data for this gem that may be useful to other
|
367
|
-
# consumers and is settable by gem authors
|
368
|
-
# the rubygems software.
|
383
|
+
# consumers and is settable by gem authors.
|
369
384
|
#
|
370
385
|
# Metadata items have the following restrictions:
|
371
386
|
#
|
@@ -386,6 +401,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
386
401
|
# "mailing_list_uri" => "https://groups.example.com/bestgemever",
|
387
402
|
# "source_code_uri" => "https://example.com/user/bestgemever",
|
388
403
|
# "wiki_uri" => "https://example.com/user/bestgemever/wiki"
|
404
|
+
# "funding_uri" => "https://example.com/donate"
|
389
405
|
# }
|
390
406
|
#
|
391
407
|
# These links will be used on your gem's page on rubygems.org and must pass
|
@@ -457,7 +473,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
457
473
|
# spec.platform = Gem::Platform.local
|
458
474
|
|
459
475
|
def platform=(platform)
|
460
|
-
if @original_platform.nil?
|
476
|
+
if @original_platform.nil? ||
|
461
477
|
@original_platform == Gem::Platform::RUBY
|
462
478
|
@original_platform = platform
|
463
479
|
end
|
@@ -473,12 +489,12 @@ class Gem::Specification < Gem::BasicSpecification
|
|
473
489
|
# legacy constants
|
474
490
|
when nil, Gem::Platform::RUBY then
|
475
491
|
@new_platform = Gem::Platform::RUBY
|
476
|
-
when
|
477
|
-
@new_platform = Gem::Platform.new
|
478
|
-
when
|
479
|
-
@new_platform = Gem::Platform.new
|
480
|
-
when
|
481
|
-
@new_platform = Gem::Platform.new
|
492
|
+
when "mswin32" then # was Gem::Platform::WIN32
|
493
|
+
@new_platform = Gem::Platform.new "x86-mswin32"
|
494
|
+
when "i586-linux" then # was Gem::Platform::LINUX_586
|
495
|
+
@new_platform = Gem::Platform.new "x86-linux"
|
496
|
+
when "powerpc-darwin" then # was Gem::Platform::DARWIN
|
497
|
+
@new_platform = Gem::Platform.new "ppc-darwin"
|
482
498
|
else
|
483
499
|
@new_platform = Gem::Platform.new platform
|
484
500
|
end
|
@@ -511,11 +527,6 @@ class Gem::Specification < Gem::BasicSpecification
|
|
511
527
|
@require_paths = Array(val)
|
512
528
|
end
|
513
529
|
|
514
|
-
##
|
515
|
-
# The version of Ruby required by this gem
|
516
|
-
|
517
|
-
attr_reader :required_ruby_version
|
518
|
-
|
519
530
|
##
|
520
531
|
# The RubyGems version required by this gem
|
521
532
|
|
@@ -556,6 +567,10 @@ class Gem::Specification < Gem::BasicSpecification
|
|
556
567
|
# spec.add_runtime_dependency 'example', '~> 1.1', '>= 1.1.4'
|
557
568
|
|
558
569
|
def add_runtime_dependency(gem, *requirements)
|
570
|
+
if requirements.uniq.size != requirements.size
|
571
|
+
warn "WARNING: duplicated #{gem} dependency #{requirements}"
|
572
|
+
end
|
573
|
+
|
559
574
|
add_dependency_with_type(gem, :runtime, requirements)
|
560
575
|
end
|
561
576
|
|
@@ -641,6 +656,8 @@ class Gem::Specification < Gem::BasicSpecification
|
|
641
656
|
@rdoc_options ||= []
|
642
657
|
end
|
643
658
|
|
659
|
+
LATEST_RUBY_WITHOUT_PATCH_VERSIONS = Gem::Version.new("2.1")
|
660
|
+
|
644
661
|
##
|
645
662
|
# The version of Ruby required by this gem. The ruby version can be
|
646
663
|
# specified to the patch-level:
|
@@ -656,14 +673,25 @@ class Gem::Specification < Gem::BasicSpecification
|
|
656
673
|
# # This gem will work with 1.8.6 or greater...
|
657
674
|
# spec.required_ruby_version = '>= 1.8.6'
|
658
675
|
#
|
659
|
-
# # Only with
|
660
|
-
# spec.required_ruby_version = '~> 2.
|
676
|
+
# # Only with final releases of major version 2 where minor version is at least 3
|
677
|
+
# spec.required_ruby_version = '~> 2.3'
|
661
678
|
#
|
662
679
|
# # Only prereleases or final releases after 2.6.0.preview2
|
663
680
|
# spec.required_ruby_version = '> 2.6.0.preview2'
|
681
|
+
#
|
682
|
+
# # This gem will work with 2.3.0 or greater, including major version 3, but lesser than 4.0.0
|
683
|
+
# spec.required_ruby_version = '>= 2.3', '< 4'
|
664
684
|
|
665
685
|
def required_ruby_version=(req)
|
666
686
|
@required_ruby_version = Gem::Requirement.create req
|
687
|
+
|
688
|
+
@required_ruby_version.requirements.map! do |op, v|
|
689
|
+
if v >= LATEST_RUBY_WITHOUT_PATCH_VERSIONS && v.release.segments.size == 4
|
690
|
+
[op == "~>" ? "=" : op, Gem::Version.new(v.segments.tap {|s| s.delete_at(3) }.join("."))]
|
691
|
+
else
|
692
|
+
[op, v]
|
693
|
+
end
|
694
|
+
end
|
667
695
|
end
|
668
696
|
|
669
697
|
##
|
@@ -721,20 +749,13 @@ class Gem::Specification < Gem::BasicSpecification
|
|
721
749
|
# Deprecated: You must now specify the executable name to Gem.bin_path.
|
722
750
|
|
723
751
|
attr_writer :default_executable
|
724
|
-
|
752
|
+
rubygems_deprecate :default_executable=
|
725
753
|
|
726
754
|
##
|
727
755
|
# Allows deinstallation of gems with legacy platforms.
|
728
756
|
|
729
757
|
attr_writer :original_platform # :nodoc:
|
730
758
|
|
731
|
-
##
|
732
|
-
# Deprecated and ignored.
|
733
|
-
#
|
734
|
-
# Formerly used to set rubyforge project.
|
735
|
-
|
736
|
-
attr_writer :rubyforge_project
|
737
|
-
|
738
759
|
##
|
739
760
|
# The Gem::Specification version of this gemspec.
|
740
761
|
#
|
@@ -743,47 +764,29 @@ class Gem::Specification < Gem::BasicSpecification
|
|
743
764
|
attr_accessor :specification_version
|
744
765
|
|
745
766
|
def self._all # :nodoc:
|
746
|
-
|
747
|
-
@@all = stubs.map(&:to_spec)
|
748
|
-
if @@all.any?(&:nil?) # TODO: remove once we're happy
|
749
|
-
raise "pid: #{$$} nil spec! included in #{stubs.inspect}"
|
750
|
-
end
|
751
|
-
|
752
|
-
# After a reset, make sure already loaded specs
|
753
|
-
# are still marked as activated.
|
754
|
-
specs = {}
|
755
|
-
Gem.loaded_specs.each_value{|s| specs[s] = true}
|
756
|
-
@@all.each{|s| s.activated = true if specs[s]}
|
757
|
-
end
|
758
|
-
@@all
|
767
|
+
@@all ||= Gem.loaded_specs.values | stubs.map(&:to_spec)
|
759
768
|
end
|
760
769
|
|
761
|
-
def self.
|
762
|
-
|
770
|
+
def self.clear_load_cache # :nodoc:
|
771
|
+
@load_cache_mutex.synchronize do
|
772
|
+
@load_cache.clear
|
773
|
+
end
|
763
774
|
end
|
775
|
+
private_class_method :clear_load_cache
|
764
776
|
|
765
777
|
def self.each_gemspec(dirs) # :nodoc:
|
766
778
|
dirs.each do |dir|
|
767
779
|
Gem::Util.glob_files_in_dir("*.gemspec", dir).each do |path|
|
768
|
-
yield path.
|
780
|
+
yield path.tap(&Gem::UNTAINT)
|
769
781
|
end
|
770
782
|
end
|
771
783
|
end
|
772
784
|
|
773
785
|
def self.gemspec_stubs_in(dir, pattern)
|
774
|
-
Gem::Util.glob_files_in_dir(pattern, dir).map {
|
786
|
+
Gem::Util.glob_files_in_dir(pattern, dir).map {|path| yield path }.select(&:valid?)
|
775
787
|
end
|
776
788
|
private_class_method :gemspec_stubs_in
|
777
789
|
|
778
|
-
def self.default_stubs(pattern)
|
779
|
-
base_dir = Gem.default_dir
|
780
|
-
gems_dir = File.join base_dir, "gems"
|
781
|
-
gemspec_stubs_in(default_specifications_dir, pattern) do |path|
|
782
|
-
Gem::StubSpecification.default_gemspec_stub(path, base_dir, gems_dir)
|
783
|
-
end
|
784
|
-
end
|
785
|
-
private_class_method :default_stubs
|
786
|
-
|
787
790
|
def self.installed_stubs(dirs, pattern)
|
788
791
|
map_stubs(dirs, pattern) do |path, base_dir, gems_dir|
|
789
792
|
Gem::StubSpecification.gemspec_stub(path, base_dir, gems_dir)
|
@@ -792,24 +795,14 @@ class Gem::Specification < Gem::BasicSpecification
|
|
792
795
|
private_class_method :installed_stubs
|
793
796
|
|
794
797
|
def self.map_stubs(dirs, pattern) # :nodoc:
|
795
|
-
dirs.flat_map
|
798
|
+
dirs.flat_map do |dir|
|
796
799
|
base_dir = File.dirname dir
|
797
800
|
gems_dir = File.join base_dir, "gems"
|
798
|
-
gemspec_stubs_in(dir, pattern) {
|
799
|
-
|
801
|
+
gemspec_stubs_in(dir, pattern) {|path| yield path, base_dir, gems_dir }
|
802
|
+
end
|
800
803
|
end
|
801
804
|
private_class_method :map_stubs
|
802
805
|
|
803
|
-
def self.uniq_by(list, &block) # :nodoc:
|
804
|
-
list.uniq(&block)
|
805
|
-
end
|
806
|
-
private_class_method :uniq_by
|
807
|
-
|
808
|
-
def self.sort_by!(list, &block)
|
809
|
-
list.sort_by!(&block)
|
810
|
-
end
|
811
|
-
private_class_method :sort_by!
|
812
|
-
|
813
806
|
def self.each_spec(dirs) # :nodoc:
|
814
807
|
each_gemspec(dirs) do |path|
|
815
808
|
spec = self.load path
|
@@ -823,16 +816,23 @@ class Gem::Specification < Gem::BasicSpecification
|
|
823
816
|
def self.stubs
|
824
817
|
@@stubs ||= begin
|
825
818
|
pattern = "*.gemspec"
|
826
|
-
stubs =
|
827
|
-
stubs = uniq_by(stubs) { |stub| stub.full_name }
|
819
|
+
stubs = stubs_for_pattern(pattern, false)
|
828
820
|
|
829
|
-
|
830
|
-
@@stubs_by_name = stubs.select { |s| Gem::Platform.match s.platform }.group_by(&:name)
|
821
|
+
@@stubs_by_name = stubs.select {|s| Gem::Platform.match_spec? s }.group_by(&:name)
|
831
822
|
stubs
|
832
823
|
end
|
833
824
|
end
|
834
825
|
|
835
|
-
|
826
|
+
##
|
827
|
+
# Returns a Gem::StubSpecification for default gems
|
828
|
+
|
829
|
+
def self.default_stubs(pattern = "*.gemspec")
|
830
|
+
base_dir = Gem.default_dir
|
831
|
+
gems_dir = File.join base_dir, "gems"
|
832
|
+
gemspec_stubs_in(Gem.default_specifications_dir, pattern) do |path|
|
833
|
+
Gem::StubSpecification.default_gemspec_stub(path, base_dir, gems_dir)
|
834
|
+
end
|
835
|
+
end
|
836
836
|
|
837
837
|
##
|
838
838
|
# Returns a Gem::StubSpecification for installed gem named +name+
|
@@ -842,30 +842,40 @@ class Gem::Specification < Gem::BasicSpecification
|
|
842
842
|
if @@stubs
|
843
843
|
@@stubs_by_name[name] || []
|
844
844
|
else
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
stubs = uniq_by(stubs) { |stub| stub.full_name }.group_by(&:name)
|
849
|
-
stubs.each_value { |v| _resort!(v) }
|
850
|
-
|
851
|
-
@@stubs_by_name.merge! stubs
|
852
|
-
@@stubs_by_name[name] ||= EMPTY
|
845
|
+
@@stubs_by_name[name] ||= stubs_for_pattern("#{name}-*.gemspec").select do |s|
|
846
|
+
s.name == name
|
847
|
+
end
|
853
848
|
end
|
854
849
|
end
|
855
850
|
|
851
|
+
##
|
852
|
+
# Finds stub specifications matching a pattern from the standard locations,
|
853
|
+
# optionally filtering out specs not matching the current platform
|
854
|
+
#
|
855
|
+
def self.stubs_for_pattern(pattern, match_platform = true) # :nodoc:
|
856
|
+
installed_stubs = installed_stubs(Gem::Specification.dirs, pattern)
|
857
|
+
installed_stubs.select! {|s| Gem::Platform.match_spec? s } if match_platform
|
858
|
+
stubs = installed_stubs + default_stubs(pattern)
|
859
|
+
stubs = stubs.uniq {|stub| stub.full_name }
|
860
|
+
_resort!(stubs)
|
861
|
+
stubs
|
862
|
+
end
|
863
|
+
|
856
864
|
def self._resort!(specs) # :nodoc:
|
857
|
-
specs.sort!
|
865
|
+
specs.sort! do |a, b|
|
858
866
|
names = a.name <=> b.name
|
859
867
|
next names if names.nonzero?
|
860
|
-
b.version <=> a.version
|
861
|
-
|
868
|
+
versions = b.version <=> a.version
|
869
|
+
next versions if versions.nonzero?
|
870
|
+
Gem::Platform.sort_priority(b.platform)
|
871
|
+
end
|
862
872
|
end
|
863
873
|
|
864
874
|
##
|
865
875
|
# Loads the default specifications. It should be called only once.
|
866
876
|
|
867
877
|
def self.load_defaults
|
868
|
-
each_spec([default_specifications_dir]) do |spec|
|
878
|
+
each_spec([Gem.default_specifications_dir]) do |spec|
|
869
879
|
# #load returns nil if the spec is bad, so we just ignore
|
870
880
|
# it at this stage
|
871
881
|
Gem.register_default_spec(spec)
|
@@ -877,44 +887,23 @@ class Gem::Specification < Gem::BasicSpecification
|
|
877
887
|
# properly sorted.
|
878
888
|
|
879
889
|
def self.add_spec(spec)
|
880
|
-
warn "Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0" unless Gem::Deprecate.skip
|
881
|
-
# TODO: find all extraneous adds
|
882
|
-
# puts
|
883
|
-
# p :add_spec => [spec.full_name, caller.reject { |s| s =~ /minitest/ }]
|
884
|
-
|
885
|
-
# TODO: flush the rest of the crap from the tests
|
886
|
-
# raise "no dupes #{spec.full_name} in #{all_names.inspect}" if
|
887
|
-
# _all.include? spec
|
888
|
-
|
889
|
-
raise "nil spec!" unless spec # TODO: remove once we're happy with tests
|
890
|
-
|
891
890
|
return if _all.include? spec
|
892
891
|
|
893
892
|
_all << spec
|
894
893
|
stubs << spec
|
895
894
|
(@@stubs_by_name[spec.name] ||= []) << spec
|
896
|
-
|
897
|
-
_resort!(
|
895
|
+
|
896
|
+
_resort!(@@stubs_by_name[spec.name])
|
898
897
|
_resort!(stubs)
|
899
898
|
end
|
900
899
|
|
901
900
|
##
|
902
|
-
#
|
903
|
-
|
904
|
-
def self.add_specs(*specs)
|
905
|
-
warn "Gem::Specification.add_specs is deprecated and will be removed in RubyGems 3.0" unless Gem::Deprecate.skip
|
906
|
-
|
907
|
-
raise "nil spec!" if specs.any?(&:nil?) # TODO: remove once we're happy
|
908
|
-
|
909
|
-
# TODO: this is much more efficient, but we need the extra checks for now
|
910
|
-
# _all.concat specs
|
911
|
-
# _resort!
|
901
|
+
# Removes +spec+ from the known specs.
|
912
902
|
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
end
|
903
|
+
def self.remove_spec(spec)
|
904
|
+
_all.delete spec.to_spec
|
905
|
+
stubs.delete spec
|
906
|
+
(@@stubs_by_name[spec.name] || []).delete spec
|
918
907
|
end
|
919
908
|
|
920
909
|
##
|
@@ -940,7 +929,6 @@ class Gem::Specification < Gem::BasicSpecification
|
|
940
929
|
# -- wilsonb
|
941
930
|
|
942
931
|
def self.all=(specs)
|
943
|
-
raise "nil spec!" if specs.any?(&:nil?) # TODO: remove once we're happy
|
944
932
|
@@stubs_by_name = specs.group_by(&:name)
|
945
933
|
@@all = @@stubs = specs
|
946
934
|
end
|
@@ -974,9 +962,9 @@ class Gem::Specification < Gem::BasicSpecification
|
|
974
962
|
# Return the directories that Specification uses to find specs.
|
975
963
|
|
976
964
|
def self.dirs
|
977
|
-
@@dirs ||= Gem.path.collect
|
978
|
-
File.join dir.dup.
|
979
|
-
|
965
|
+
@@dirs ||= Gem.path.collect do |dir|
|
966
|
+
File.join dir.dup.tap(&Gem::UNTAINT), "specifications"
|
967
|
+
end
|
980
968
|
end
|
981
969
|
|
982
970
|
##
|
@@ -986,7 +974,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
986
974
|
def self.dirs=(dirs)
|
987
975
|
self.reset
|
988
976
|
|
989
|
-
@@dirs = Array(dirs).map {
|
977
|
+
@@dirs = Array(dirs).map {|dir| File.join dir, "specifications" }
|
990
978
|
end
|
991
979
|
|
992
980
|
extend Enumerable
|
@@ -1038,10 +1026,9 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1038
1026
|
|
1039
1027
|
def self.find_by_path(path)
|
1040
1028
|
path = path.dup.freeze
|
1041
|
-
spec = @@spec_with_requirable_file[path] ||= (stubs.find
|
1042
|
-
next unless Gem::BundlerVersionFinder.compatible?(s)
|
1029
|
+
spec = @@spec_with_requirable_file[path] ||= (stubs.find do |s|
|
1043
1030
|
s.contains_requirable_file? path
|
1044
|
-
|
1031
|
+
end || NOT_FOUND)
|
1045
1032
|
spec.to_spec
|
1046
1033
|
end
|
1047
1034
|
|
@@ -1050,18 +1037,17 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1050
1037
|
# amongst the specs that are not activated.
|
1051
1038
|
|
1052
1039
|
def self.find_inactive_by_path(path)
|
1053
|
-
stub = stubs.find
|
1040
|
+
stub = stubs.find do |s|
|
1054
1041
|
next if s.activated?
|
1055
|
-
next unless Gem::BundlerVersionFinder.compatible?(s)
|
1056
1042
|
s.contains_requirable_file? path
|
1057
|
-
|
1043
|
+
end
|
1058
1044
|
stub && stub.to_spec
|
1059
1045
|
end
|
1060
1046
|
|
1061
1047
|
def self.find_active_stub_by_path(path)
|
1062
|
-
stub = @@active_stub_with_requirable_file[path] ||= (stubs.find
|
1063
|
-
s.activated?
|
1064
|
-
|
1048
|
+
stub = @@active_stub_with_requirable_file[path] ||= (stubs.find do |s|
|
1049
|
+
s.activated? && s.contains_requirable_file?(path)
|
1050
|
+
end || NOT_FOUND)
|
1065
1051
|
stub.this
|
1066
1052
|
end
|
1067
1053
|
|
@@ -1069,10 +1055,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1069
1055
|
# Return currently unresolved specs that contain the file matching +path+.
|
1070
1056
|
|
1071
1057
|
def self.find_in_unresolved(path)
|
1072
|
-
|
1073
|
-
specs = unresolved_deps.values.map { |dep| dep.to_specs }.flatten
|
1074
|
-
|
1075
|
-
specs.find_all { |spec| spec.contains_requirable_file? path }
|
1058
|
+
unresolved_specs.find_all {|spec| spec.contains_requirable_file? path }
|
1076
1059
|
end
|
1077
1060
|
|
1078
1061
|
##
|
@@ -1080,9 +1063,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1080
1063
|
# specs that contain the file matching +path+.
|
1081
1064
|
|
1082
1065
|
def self.find_in_unresolved_tree(path)
|
1083
|
-
|
1084
|
-
|
1085
|
-
specs.each do |spec|
|
1066
|
+
unresolved_specs.each do |spec|
|
1086
1067
|
spec.traverse do |from_spec, dep, to_spec, trail|
|
1087
1068
|
if to_spec.has_conflicts? || to_spec.conficts_when_loaded_with?(trail)
|
1088
1069
|
:next
|
@@ -1095,6 +1076,11 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1095
1076
|
[]
|
1096
1077
|
end
|
1097
1078
|
|
1079
|
+
def self.unresolved_specs
|
1080
|
+
unresolved_deps.values.map {|dep| dep.to_specs }.flatten
|
1081
|
+
end
|
1082
|
+
private_class_method :unresolved_specs
|
1083
|
+
|
1098
1084
|
##
|
1099
1085
|
# Special loader for YAML files. When a Specification object is loaded
|
1100
1086
|
# from a YAML file, it bypasses the normal Ruby object initialization
|
@@ -1119,6 +1105,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1119
1105
|
|
1120
1106
|
spec.specification_version ||= NONEXISTENT_SPECIFICATION_VERSION
|
1121
1107
|
spec.reset_nil_attributes_to_default
|
1108
|
+
spec.flatten_require_paths
|
1122
1109
|
|
1123
1110
|
spec
|
1124
1111
|
end
|
@@ -1128,24 +1115,26 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1128
1115
|
# +prerelease+ is true.
|
1129
1116
|
|
1130
1117
|
def self.latest_specs(prerelease = false)
|
1131
|
-
_latest_specs Gem::Specification.
|
1118
|
+
_latest_specs Gem::Specification.stubs, prerelease
|
1119
|
+
end
|
1120
|
+
|
1121
|
+
##
|
1122
|
+
# Return the latest installed spec for gem +name+.
|
1123
|
+
|
1124
|
+
def self.latest_spec_for(name)
|
1125
|
+
latest_specs(true).find {|installed_spec| installed_spec.name == name }
|
1132
1126
|
end
|
1133
1127
|
|
1134
1128
|
def self._latest_specs(specs, prerelease = false) # :nodoc:
|
1135
|
-
result =
|
1136
|
-
native = {}
|
1129
|
+
result = {}
|
1137
1130
|
|
1138
1131
|
specs.reverse_each do |spec|
|
1139
1132
|
next if spec.version.prerelease? unless prerelease
|
1140
1133
|
|
1141
|
-
|
1142
|
-
result[spec.name][spec.platform] = spec
|
1134
|
+
result[spec.name] = spec
|
1143
1135
|
end
|
1144
1136
|
|
1145
|
-
result.map(&:last).
|
1146
|
-
minimum = native[spec.name]
|
1147
|
-
minimum && spec.version < minimum
|
1148
|
-
}.sort_by{ |tup| tup.name }
|
1137
|
+
result.map(&:last).flatten.sort_by {|tup| tup.name }
|
1149
1138
|
end
|
1150
1139
|
|
1151
1140
|
##
|
@@ -1154,22 +1143,29 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1154
1143
|
def self.load(file)
|
1155
1144
|
return unless file
|
1156
1145
|
|
1157
|
-
_spec =
|
1146
|
+
_spec = @load_cache_mutex.synchronize { @load_cache[file] }
|
1158
1147
|
return _spec if _spec
|
1159
1148
|
|
1160
|
-
file = file.dup.
|
1149
|
+
file = file.dup.tap(&Gem::UNTAINT)
|
1161
1150
|
return unless File.file?(file)
|
1162
1151
|
|
1163
|
-
code =
|
1152
|
+
code = Gem.open_file(file, "r:UTF-8:-", &:read)
|
1164
1153
|
|
1165
|
-
code.
|
1154
|
+
code.tap(&Gem::UNTAINT)
|
1166
1155
|
|
1167
1156
|
begin
|
1168
1157
|
_spec = eval code, binding, file
|
1169
1158
|
|
1170
1159
|
if Gem::Specification === _spec
|
1171
1160
|
_spec.loaded_from = File.expand_path file.to_s
|
1172
|
-
|
1161
|
+
@load_cache_mutex.synchronize do
|
1162
|
+
prev = @load_cache[file]
|
1163
|
+
if prev
|
1164
|
+
_spec = prev
|
1165
|
+
else
|
1166
|
+
@load_cache[file] = _spec
|
1167
|
+
end
|
1168
|
+
end
|
1173
1169
|
return _spec
|
1174
1170
|
end
|
1175
1171
|
|
@@ -1195,7 +1191,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1195
1191
|
|
1196
1192
|
def self.normalize_yaml_input(input)
|
1197
1193
|
result = input.respond_to?(:read) ? input.read : input
|
1198
|
-
result = "--- " + result unless result
|
1194
|
+
result = "--- " + result unless result.start_with?("--- ")
|
1199
1195
|
result = result.dup
|
1200
1196
|
result.gsub!(/ !!null \n/, " \n")
|
1201
1197
|
# date: 2011-04-26 00:00:00.000000000Z
|
@@ -1212,7 +1208,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1212
1208
|
# version as well.
|
1213
1209
|
|
1214
1210
|
def self.outdated
|
1215
|
-
outdated_and_latest_version.map {
|
1211
|
+
outdated_and_latest_version.map {|local, _| local.name }
|
1216
1212
|
end
|
1217
1213
|
|
1218
1214
|
##
|
@@ -1233,28 +1229,17 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1233
1229
|
Gem::Dependency.new local_spec.name, ">= #{local_spec.version}"
|
1234
1230
|
|
1235
1231
|
remotes, = fetcher.search_for_dependency dependency
|
1236
|
-
remotes = remotes.map {
|
1232
|
+
remotes = remotes.map {|n, _| n.version }
|
1237
1233
|
|
1238
1234
|
latest_remote = remotes.sort.last
|
1239
1235
|
|
1240
1236
|
yield [local_spec, latest_remote] if
|
1241
|
-
latest_remote
|
1237
|
+
latest_remote && local_spec.version < latest_remote
|
1242
1238
|
end
|
1243
1239
|
|
1244
1240
|
nil
|
1245
1241
|
end
|
1246
1242
|
|
1247
|
-
##
|
1248
|
-
# Removes +spec+ from the known specs.
|
1249
|
-
|
1250
|
-
def self.remove_spec(spec)
|
1251
|
-
warn "Gem::Specification.remove_spec is deprecated and will be removed in RubyGems 3.0" unless Gem::Deprecate.skip
|
1252
|
-
_all.delete spec
|
1253
|
-
stubs.delete_if { |s| s.full_name == spec.full_name }
|
1254
|
-
(@@stubs_by_name[spec.name] || []).delete_if { |s| s.full_name == spec.full_name }
|
1255
|
-
reset
|
1256
|
-
end
|
1257
|
-
|
1258
1243
|
##
|
1259
1244
|
# Is +name+ a required attribute?
|
1260
1245
|
|
@@ -1275,43 +1260,63 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1275
1260
|
|
1276
1261
|
def self.reset
|
1277
1262
|
@@dirs = nil
|
1278
|
-
Gem.pre_reset_hooks.each {
|
1279
|
-
|
1280
|
-
|
1281
|
-
@@stubs_by_name = {}
|
1282
|
-
@@spec_with_requirable_file = {}
|
1283
|
-
@@active_stub_with_requirable_file = {}
|
1284
|
-
_clear_load_cache
|
1263
|
+
Gem.pre_reset_hooks.each {|hook| hook.call }
|
1264
|
+
clear_specs
|
1265
|
+
clear_load_cache
|
1285
1266
|
unresolved = unresolved_deps
|
1286
1267
|
unless unresolved.empty?
|
1287
|
-
|
1288
|
-
warn "#{w}: Unresolved or ambigious specs during Gem::Specification.reset:"
|
1268
|
+
warn "WARN: Unresolved or ambiguous specs during Gem::Specification.reset:"
|
1289
1269
|
unresolved.values.each do |dep|
|
1290
1270
|
warn " #{dep}"
|
1291
1271
|
|
1292
1272
|
versions = find_all_by_name(dep.name)
|
1293
1273
|
unless versions.empty?
|
1294
1274
|
warn " Available/installed versions of this gem:"
|
1295
|
-
versions.each {
|
1275
|
+
versions.each {|s| warn " - #{s.version}" }
|
1296
1276
|
end
|
1297
1277
|
end
|
1298
|
-
warn "
|
1278
|
+
warn "WARN: Clearing out unresolved specs. Try 'gem cleanup <gem>'"
|
1299
1279
|
warn "Please report a bug if this causes problems."
|
1300
1280
|
unresolved.clear
|
1301
1281
|
end
|
1302
|
-
Gem.post_reset_hooks.each {
|
1282
|
+
Gem.post_reset_hooks.each {|hook| hook.call }
|
1303
1283
|
end
|
1304
1284
|
|
1305
1285
|
# DOC: This method needs documented or nodoc'd
|
1306
1286
|
def self.unresolved_deps
|
1307
|
-
@unresolved_deps ||= Hash.new {
|
1287
|
+
@unresolved_deps ||= Hash.new {|h, n| h[n] = Gem::Dependency.new n }
|
1308
1288
|
end
|
1309
1289
|
|
1310
1290
|
##
|
1311
1291
|
# Load custom marshal format, re-initializing defaults as needed
|
1312
1292
|
|
1313
1293
|
def self._load(str)
|
1314
|
-
|
1294
|
+
Gem.load_yaml
|
1295
|
+
|
1296
|
+
array = begin
|
1297
|
+
Marshal.load str
|
1298
|
+
rescue ArgumentError => e
|
1299
|
+
#
|
1300
|
+
# Some very old marshaled specs included references to `YAML::PrivateType`
|
1301
|
+
# and `YAML::Syck::DefaultKey` constants due to bugs in the old emitter
|
1302
|
+
# that generated them. Workaround the issue by defining the necessary
|
1303
|
+
# constants and retrying.
|
1304
|
+
#
|
1305
|
+
message = e.message
|
1306
|
+
raise unless message.include?("YAML::")
|
1307
|
+
|
1308
|
+
Object.const_set "YAML", Psych unless Object.const_defined?(:YAML)
|
1309
|
+
|
1310
|
+
if message.include?("YAML::Syck::")
|
1311
|
+
YAML.const_set "Syck", YAML unless YAML.const_defined?(:Syck)
|
1312
|
+
|
1313
|
+
YAML::Syck.const_set "DefaultKey", Class.new if message.include?("YAML::Syck::DefaultKey")
|
1314
|
+
elsif message.include?("YAML::PrivateType")
|
1315
|
+
YAML.const_set "PrivateType", Class.new
|
1316
|
+
end
|
1317
|
+
|
1318
|
+
retry
|
1319
|
+
end
|
1315
1320
|
|
1316
1321
|
spec = Gem::Specification.new
|
1317
1322
|
spec.instance_variable_set :@specification_version, array[1]
|
@@ -1319,22 +1324,17 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1319
1324
|
current_version = CURRENT_SPECIFICATION_VERSION
|
1320
1325
|
|
1321
1326
|
field_count = if spec.specification_version > current_version
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1327
|
+
spec.instance_variable_set :@specification_version,
|
1328
|
+
current_version
|
1329
|
+
MARSHAL_FIELDS[current_version]
|
1330
|
+
else
|
1331
|
+
MARSHAL_FIELDS[spec.specification_version]
|
1332
|
+
end
|
1328
1333
|
|
1329
1334
|
if array.size < field_count
|
1330
1335
|
raise TypeError, "invalid Gem::Specification format #{array.inspect}"
|
1331
1336
|
end
|
1332
1337
|
|
1333
|
-
# Cleanup any YAML::PrivateType. They only show up for an old bug
|
1334
|
-
# where nil => null, so just convert them to nil based on the type.
|
1335
|
-
|
1336
|
-
array.map! { |e| e.kind_of?(YAML::PrivateType) ? nil : e }
|
1337
|
-
|
1338
1338
|
spec.instance_variable_set :@rubygems_version, array[0]
|
1339
1339
|
# spec version
|
1340
1340
|
spec.instance_variable_set :@name, array[2]
|
@@ -1390,7 +1390,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1390
1390
|
@required_rubygems_version,
|
1391
1391
|
@original_platform,
|
1392
1392
|
@dependencies,
|
1393
|
-
|
1393
|
+
"", # rubyforge_project
|
1394
1394
|
@email,
|
1395
1395
|
@authors,
|
1396
1396
|
@description,
|
@@ -1398,7 +1398,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1398
1398
|
true, # has_rdoc
|
1399
1399
|
@new_platform,
|
1400
1400
|
@licenses,
|
1401
|
-
@metadata
|
1401
|
+
@metadata,
|
1402
1402
|
]
|
1403
1403
|
end
|
1404
1404
|
|
@@ -1446,7 +1446,11 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1446
1446
|
raise e
|
1447
1447
|
end
|
1448
1448
|
|
1449
|
-
|
1449
|
+
begin
|
1450
|
+
specs = spec_dep.to_specs
|
1451
|
+
rescue Gem::MissingSpecError => e
|
1452
|
+
raise Gem::MissingSpecError.new(e.name, e.requirement, "at: #{self.spec_file}")
|
1453
|
+
end
|
1450
1454
|
|
1451
1455
|
if specs.size == 1
|
1452
1456
|
specs.first.activate
|
@@ -1482,7 +1486,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1482
1486
|
self.summary = sanitize_string(summary)
|
1483
1487
|
self.description = sanitize_string(description)
|
1484
1488
|
self.post_install_message = sanitize_string(post_install_message)
|
1485
|
-
self.authors = authors.collect {
|
1489
|
+
self.authors = authors.collect {|a| sanitize_string(a) }
|
1486
1490
|
end
|
1487
1491
|
|
1488
1492
|
##
|
@@ -1494,13 +1498,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1494
1498
|
# HACK the #to_s is in here because RSpec has an Array of Arrays of
|
1495
1499
|
# Strings for authors. Need a way to disallow bad values on gemspec
|
1496
1500
|
# generation. (Probably won't happen.)
|
1497
|
-
string
|
1498
|
-
|
1499
|
-
begin
|
1500
|
-
Builder::XChar.encode string
|
1501
|
-
rescue NameError, NoMethodError
|
1502
|
-
string.to_xs
|
1503
|
-
end
|
1501
|
+
string.to_s
|
1504
1502
|
end
|
1505
1503
|
|
1506
1504
|
##
|
@@ -1511,7 +1509,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1511
1509
|
return nil if executables.nil?
|
1512
1510
|
|
1513
1511
|
if @bindir
|
1514
|
-
Array(executables).map {
|
1512
|
+
Array(executables).map {|e| File.join(@bindir, e) }
|
1515
1513
|
else
|
1516
1514
|
executables
|
1517
1515
|
end
|
@@ -1526,10 +1524,10 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1526
1524
|
|
1527
1525
|
def add_dependency_with_type(dependency, type, requirements)
|
1528
1526
|
requirements = if requirements.empty?
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1527
|
+
Gem::Requirement.default
|
1528
|
+
else
|
1529
|
+
requirements.flatten
|
1530
|
+
end
|
1533
1531
|
|
1534
1532
|
unless dependency.respond_to?(:name) &&
|
1535
1533
|
dependency.respond_to?(:requirement)
|
@@ -1551,23 +1549,14 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1551
1549
|
|
1552
1550
|
paths = full_require_paths
|
1553
1551
|
|
1554
|
-
|
1555
|
-
insert_index = Gem.load_path_insert_index
|
1556
|
-
|
1557
|
-
if insert_index
|
1558
|
-
# gem directories must come after -I and ENV['RUBYLIB']
|
1559
|
-
$LOAD_PATH.insert(insert_index, *paths)
|
1560
|
-
else
|
1561
|
-
# we are probably testing in core, -I and RUBYLIB don't apply
|
1562
|
-
$LOAD_PATH.unshift(*paths)
|
1563
|
-
end
|
1552
|
+
Gem.add_to_load_path(*paths)
|
1564
1553
|
end
|
1565
1554
|
|
1566
1555
|
##
|
1567
1556
|
# Singular reader for #authors. Returns the first author in the list
|
1568
1557
|
|
1569
1558
|
def author
|
1570
|
-
val = authors
|
1559
|
+
(val = authors) && val.first
|
1571
1560
|
end
|
1572
1561
|
|
1573
1562
|
##
|
@@ -1586,7 +1575,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1586
1575
|
# a full path.
|
1587
1576
|
|
1588
1577
|
def bin_dir
|
1589
|
-
@bin_dir ||= File.join gem_dir, bindir
|
1578
|
+
@bin_dir ||= File.join gem_dir, bindir
|
1590
1579
|
end
|
1591
1580
|
|
1592
1581
|
##
|
@@ -1602,7 +1591,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1602
1591
|
def build_args
|
1603
1592
|
if File.exist? build_info_file
|
1604
1593
|
build_info = File.readlines build_info_file
|
1605
|
-
build_info = build_info.map {
|
1594
|
+
build_info = build_info.map {|x| x.strip }
|
1606
1595
|
build_info.delete ""
|
1607
1596
|
build_info
|
1608
1597
|
else
|
@@ -1615,12 +1604,11 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1615
1604
|
# the gem.build_complete file is missing.
|
1616
1605
|
|
1617
1606
|
def build_extensions # :nodoc:
|
1618
|
-
return if default_gem?
|
1619
1607
|
return if extensions.empty?
|
1620
|
-
return if
|
1608
|
+
return if default_gem?
|
1621
1609
|
return if File.exist? gem_build_complete_path
|
1622
1610
|
return if !File.writable?(base_dir)
|
1623
|
-
return if !File.exist?(File.join(base_dir,
|
1611
|
+
return if !File.exist?(File.join(base_dir, "extensions"))
|
1624
1612
|
|
1625
1613
|
begin
|
1626
1614
|
# We need to require things in $LOAD_PATH without looking for the
|
@@ -1628,9 +1616,9 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1628
1616
|
unresolved_deps = Gem::Specification.unresolved_deps.dup
|
1629
1617
|
Gem::Specification.unresolved_deps.clear
|
1630
1618
|
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1619
|
+
require_relative "config_file"
|
1620
|
+
require_relative "ext"
|
1621
|
+
require_relative "user_interaction"
|
1634
1622
|
|
1635
1623
|
ui = Gem::SilentUI.new
|
1636
1624
|
Gem::DefaultUserInteraction.use_ui ui do
|
@@ -1678,12 +1666,12 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1678
1666
|
|
1679
1667
|
def conflicts
|
1680
1668
|
conflicts = {}
|
1681
|
-
self.runtime_dependencies.each
|
1669
|
+
self.runtime_dependencies.each do |dep|
|
1682
1670
|
spec = Gem.loaded_specs[dep.name]
|
1683
|
-
if spec
|
1671
|
+
if spec && !spec.satisfies_requirement?(dep)
|
1684
1672
|
(conflicts[spec] ||= []) << dep
|
1685
1673
|
end
|
1686
|
-
|
1674
|
+
end
|
1687
1675
|
env_req = Gem.env_requirement(name)
|
1688
1676
|
(conflicts[self] ||= []) << env_req unless env_req.satisfied_by? version
|
1689
1677
|
conflicts
|
@@ -1693,9 +1681,9 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1693
1681
|
# return true if there will be conflict when spec if loaded together with the list of specs.
|
1694
1682
|
|
1695
1683
|
def conficts_when_loaded_with?(list_of_specs) # :nodoc:
|
1696
|
-
result = list_of_specs.any?
|
1697
|
-
spec.dependencies.any? {
|
1698
|
-
|
1684
|
+
result = list_of_specs.any? do |spec|
|
1685
|
+
spec.dependencies.any? {|dep| dep.runtime? && (dep.name == name) && !satisfies_requirement?(dep) }
|
1686
|
+
end
|
1699
1687
|
result
|
1700
1688
|
end
|
1701
1689
|
|
@@ -1704,14 +1692,14 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1704
1692
|
|
1705
1693
|
def has_conflicts?
|
1706
1694
|
return true unless Gem.env_requirement(name).satisfied_by?(version)
|
1707
|
-
self.dependencies.any?
|
1695
|
+
self.dependencies.any? do |dep|
|
1708
1696
|
if dep.runtime?
|
1709
1697
|
spec = Gem.loaded_specs[dep.name]
|
1710
|
-
spec
|
1698
|
+
spec && !spec.satisfies_requirement?(dep)
|
1711
1699
|
else
|
1712
1700
|
false
|
1713
1701
|
end
|
1714
|
-
|
1702
|
+
end
|
1715
1703
|
end
|
1716
1704
|
|
1717
1705
|
# The date this gem was created.
|
@@ -1723,12 +1711,12 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1723
1711
|
# https://reproducible-builds.org/specs/source-date-epoch/
|
1724
1712
|
|
1725
1713
|
def date
|
1726
|
-
@date ||=
|
1714
|
+
@date ||= Time.utc(*Gem.source_date_epoch.utc.to_a[3..5].reverse)
|
1727
1715
|
end
|
1728
1716
|
|
1729
1717
|
DateLike = Object.new # :nodoc:
|
1730
1718
|
def DateLike.===(obj) # :nodoc:
|
1731
|
-
defined?(::Date)
|
1719
|
+
defined?(::Date) && Date === obj
|
1732
1720
|
end
|
1733
1721
|
|
1734
1722
|
DateTimeFormat = # :nodoc:
|
@@ -1747,24 +1735,18 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1747
1735
|
# This is the cleanest, most-readable, faster-than-using-Date
|
1748
1736
|
# way to do it.
|
1749
1737
|
@date = case date
|
1750
|
-
|
1751
|
-
|
1752
|
-
|
1753
|
-
|
1754
|
-
|
1755
|
-
|
1756
|
-
|
1757
|
-
|
1758
|
-
|
1759
|
-
|
1760
|
-
|
1761
|
-
|
1762
|
-
end
|
1763
|
-
when Time, DateLike then
|
1764
|
-
Time.utc(date.year, date.month, date.day)
|
1765
|
-
else
|
1766
|
-
TODAY
|
1767
|
-
end
|
1738
|
+
when String then
|
1739
|
+
if DateTimeFormat =~ date
|
1740
|
+
Time.utc($1.to_i, $2.to_i, $3.to_i)
|
1741
|
+
else
|
1742
|
+
raise(Gem::InvalidSpecificationException,
|
1743
|
+
"invalid date format in specification: #{date.inspect}")
|
1744
|
+
end
|
1745
|
+
when Time, DateLike then
|
1746
|
+
Time.utc(date.year, date.month, date.day)
|
1747
|
+
else
|
1748
|
+
TODAY
|
1749
|
+
end
|
1768
1750
|
end
|
1769
1751
|
|
1770
1752
|
##
|
@@ -1774,16 +1756,16 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1774
1756
|
# executable now. See Gem.bin_path.
|
1775
1757
|
|
1776
1758
|
def default_executable # :nodoc:
|
1777
|
-
if defined?(@default_executable)
|
1759
|
+
if defined?(@default_executable) && @default_executable
|
1778
1760
|
result = @default_executable
|
1779
|
-
elsif @executables
|
1761
|
+
elsif @executables && @executables.size == 1
|
1780
1762
|
result = Array(@executables).first
|
1781
1763
|
else
|
1782
1764
|
result = nil
|
1783
1765
|
end
|
1784
1766
|
result
|
1785
1767
|
end
|
1786
|
-
|
1768
|
+
rubygems_deprecate :default_executable
|
1787
1769
|
|
1788
1770
|
##
|
1789
1771
|
# The default value for specification attribute +name+
|
@@ -1808,10 +1790,11 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1808
1790
|
#
|
1809
1791
|
# [depending_gem, dependency, [list_of_gems_that_satisfy_dependency]]
|
1810
1792
|
|
1811
|
-
def dependent_gems
|
1793
|
+
def dependent_gems(check_dev=true)
|
1812
1794
|
out = []
|
1813
1795
|
Gem::Specification.each do |spec|
|
1814
|
-
spec.dependencies
|
1796
|
+
deps = check_dev ? spec.dependencies : spec.runtime_dependencies
|
1797
|
+
deps.each do |dep|
|
1815
1798
|
if self.satisfies_requirement?(dep)
|
1816
1799
|
sats = []
|
1817
1800
|
find_all_satisfiers(dep) do |sat|
|
@@ -1828,7 +1811,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1828
1811
|
# Returns all specs that matches this spec's runtime dependencies.
|
1829
1812
|
|
1830
1813
|
def dependent_specs
|
1831
|
-
runtime_dependencies.map {
|
1814
|
+
runtime_dependencies.map {|dep| dep.to_specs }.flatten
|
1832
1815
|
end
|
1833
1816
|
|
1834
1817
|
##
|
@@ -1842,7 +1825,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1842
1825
|
# List of dependencies that are used for development
|
1843
1826
|
|
1844
1827
|
def development_dependencies
|
1845
|
-
dependencies.select {
|
1828
|
+
dependencies.select {|d| d.type == :development }
|
1846
1829
|
end
|
1847
1830
|
|
1848
1831
|
##
|
@@ -1854,7 +1837,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1854
1837
|
# spec.doc_dir 'ri' # => "/path/to/gem_repo/doc/a-1/ri"
|
1855
1838
|
|
1856
1839
|
def doc_dir(type = nil)
|
1857
|
-
@doc_dir ||= File.join base_dir,
|
1840
|
+
@doc_dir ||= File.join base_dir, "doc", full_name
|
1858
1841
|
|
1859
1842
|
if type
|
1860
1843
|
File.join @doc_dir, type
|
@@ -1866,17 +1849,17 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1866
1849
|
def encode_with(coder) # :nodoc:
|
1867
1850
|
mark_version
|
1868
1851
|
|
1869
|
-
coder.add
|
1870
|
-
coder.add
|
1852
|
+
coder.add "name", @name
|
1853
|
+
coder.add "version", @version
|
1871
1854
|
platform = case @original_platform
|
1872
|
-
|
1873
|
-
|
1874
|
-
|
1875
|
-
|
1876
|
-
|
1877
|
-
|
1878
|
-
|
1879
|
-
coder.add
|
1855
|
+
when nil, "" then
|
1856
|
+
"ruby"
|
1857
|
+
when String then
|
1858
|
+
@original_platform
|
1859
|
+
else
|
1860
|
+
@original_platform.to_s
|
1861
|
+
end
|
1862
|
+
coder.add "platform", platform
|
1880
1863
|
|
1881
1864
|
attributes = @@attributes.map(&:to_s) - %w[name version platform]
|
1882
1865
|
attributes.each do |name|
|
@@ -1892,7 +1875,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1892
1875
|
# Singular accessor for #executables
|
1893
1876
|
|
1894
1877
|
def executable
|
1895
|
-
val = executables
|
1878
|
+
(val = executables) && val.first
|
1896
1879
|
end
|
1897
1880
|
|
1898
1881
|
##
|
@@ -1903,29 +1886,23 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1903
1886
|
end
|
1904
1887
|
|
1905
1888
|
##
|
1906
|
-
# Sets executables to +value+, ensuring it is an array.
|
1907
|
-
# use this, push onto the array instead.
|
1889
|
+
# Sets executables to +value+, ensuring it is an array.
|
1908
1890
|
|
1909
1891
|
def executables=(value)
|
1910
|
-
# TODO: warn about setting instead of pushing
|
1911
1892
|
@executables = Array(value)
|
1912
1893
|
end
|
1913
1894
|
|
1914
1895
|
##
|
1915
|
-
# Sets extensions to +extensions+, ensuring it is an array.
|
1916
|
-
# use this, push onto the array instead.
|
1896
|
+
# Sets extensions to +extensions+, ensuring it is an array.
|
1917
1897
|
|
1918
1898
|
def extensions=(extensions)
|
1919
|
-
# TODO: warn about setting instead of pushing
|
1920
1899
|
@extensions = Array extensions
|
1921
1900
|
end
|
1922
1901
|
|
1923
1902
|
##
|
1924
|
-
# Sets extra_rdoc_files to +files+, ensuring it is an array.
|
1925
|
-
# use this, push onto the array instead.
|
1903
|
+
# Sets extra_rdoc_files to +files+, ensuring it is an array.
|
1926
1904
|
|
1927
1905
|
def extra_rdoc_files=(files)
|
1928
|
-
# TODO: warn about setting instead of pushing
|
1929
1906
|
@extra_rdoc_files = Array files
|
1930
1907
|
end
|
1931
1908
|
|
@@ -1980,8 +1957,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1980
1957
|
end
|
1981
1958
|
|
1982
1959
|
def gems_dir
|
1983
|
-
|
1984
|
-
@gems_dir ||= File.join(loaded_from && base_dir || Gem.dir, "gems")
|
1960
|
+
@gems_dir ||= File.join(base_dir, "gems")
|
1985
1961
|
end
|
1986
1962
|
|
1987
1963
|
##
|
@@ -1992,7 +1968,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1992
1968
|
def has_rdoc # :nodoc:
|
1993
1969
|
true
|
1994
1970
|
end
|
1995
|
-
|
1971
|
+
rubygems_deprecate :has_rdoc
|
1996
1972
|
|
1997
1973
|
##
|
1998
1974
|
# Deprecated and ignored.
|
@@ -2002,16 +1978,16 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2002
1978
|
def has_rdoc=(ignored) # :nodoc:
|
2003
1979
|
@has_rdoc = true
|
2004
1980
|
end
|
2005
|
-
|
1981
|
+
rubygems_deprecate :has_rdoc=
|
2006
1982
|
|
2007
1983
|
alias :has_rdoc? :has_rdoc # :nodoc:
|
2008
|
-
|
1984
|
+
rubygems_deprecate :has_rdoc?
|
2009
1985
|
|
2010
1986
|
##
|
2011
1987
|
# True if this gem has files in test_files
|
2012
1988
|
|
2013
1989
|
def has_unit_tests? # :nodoc:
|
2014
|
-
|
1990
|
+
!test_files.empty?
|
2015
1991
|
end
|
2016
1992
|
|
2017
1993
|
# :stopdoc:
|
@@ -2027,9 +2003,9 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2027
2003
|
yaml_initialize coder.tag, coder.map
|
2028
2004
|
end
|
2029
2005
|
|
2006
|
+
eval <<-RUBY, binding, __FILE__, __LINE__ + 1
|
2007
|
+
# frozen_string_literal: true
|
2030
2008
|
|
2031
|
-
|
2032
|
-
eval <<-RB, binding, __FILE__, __LINE__ + 1
|
2033
2009
|
def set_nil_attributes_to_nil
|
2034
2010
|
#{@@nil_attributes.map {|key| "@#{key} = nil" }.join "; "}
|
2035
2011
|
end
|
@@ -2039,7 +2015,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2039
2015
|
#{@@non_nil_attributes.map {|key| "@#{key} = #{INITIALIZE_CODE_FOR_DEFAULTS[key]}" }.join ";"}
|
2040
2016
|
end
|
2041
2017
|
private :set_not_nil_attributes_to_default_values
|
2042
|
-
|
2018
|
+
RUBY
|
2043
2019
|
|
2044
2020
|
##
|
2045
2021
|
# Specification constructor. Assigns the default values to the attributes
|
@@ -2064,6 +2040,10 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2064
2040
|
self.name = name if name
|
2065
2041
|
self.version = version if version
|
2066
2042
|
|
2043
|
+
if (platform = Gem.platforms.last) && platform != Gem::Platform::RUBY && platform != Gem::Platform.local
|
2044
|
+
self.platform = platform
|
2045
|
+
end
|
2046
|
+
|
2067
2047
|
yield self if block_given?
|
2068
2048
|
end
|
2069
2049
|
|
@@ -2095,10 +2075,10 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2095
2075
|
def base_dir
|
2096
2076
|
return Gem.dir unless loaded_from
|
2097
2077
|
@base_dir ||= if default_gem?
|
2098
|
-
|
2099
|
-
|
2100
|
-
|
2101
|
-
|
2078
|
+
File.dirname File.dirname File.dirname loaded_from
|
2079
|
+
else
|
2080
|
+
File.dirname File.dirname loaded_from
|
2081
|
+
end
|
2102
2082
|
end
|
2103
2083
|
|
2104
2084
|
##
|
@@ -2166,11 +2146,17 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2166
2146
|
end
|
2167
2147
|
|
2168
2148
|
##
|
2149
|
+
# Track removed method calls to warn about during build time.
|
2169
2150
|
# Warn about unknown attributes while loading a spec.
|
2170
2151
|
|
2171
2152
|
def method_missing(sym, *a, &b) # :nodoc:
|
2172
|
-
if
|
2173
|
-
|
2153
|
+
if REMOVED_METHODS.include?(sym)
|
2154
|
+
removed_method_calls << sym
|
2155
|
+
return
|
2156
|
+
end
|
2157
|
+
|
2158
|
+
if @specification_version > CURRENT_SPECIFICATION_VERSION &&
|
2159
|
+
sym.to_s.end_with?("=")
|
2174
2160
|
warn "ignoring #{sym} loading #{full_name}" if $DEBUG
|
2175
2161
|
else
|
2176
2162
|
super
|
@@ -2182,9 +2168,8 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2182
2168
|
# probably want to build_extensions
|
2183
2169
|
|
2184
2170
|
def missing_extensions?
|
2185
|
-
return false if default_gem?
|
2186
2171
|
return false if extensions.empty?
|
2187
|
-
return false if
|
2172
|
+
return false if default_gem?
|
2188
2173
|
return false if File.exist? gem_build_complete_path
|
2189
2174
|
|
2190
2175
|
true
|
@@ -2197,7 +2182,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2197
2182
|
# file list.
|
2198
2183
|
|
2199
2184
|
def normalize
|
2200
|
-
if defined?(@extra_rdoc_files)
|
2185
|
+
if defined?(@extra_rdoc_files) && @extra_rdoc_files
|
2201
2186
|
@extra_rdoc_files.uniq!
|
2202
2187
|
@files ||= []
|
2203
2188
|
@files.concat(@extra_rdoc_files)
|
@@ -2222,7 +2207,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2222
2207
|
# platform. For use with legacy gems.
|
2223
2208
|
|
2224
2209
|
def original_name # :nodoc:
|
2225
|
-
if platform == Gem::Platform::RUBY
|
2210
|
+
if platform == Gem::Platform::RUBY || platform.nil?
|
2226
2211
|
"#{@name}-#{@version}"
|
2227
2212
|
else
|
2228
2213
|
"#{@name}-#{@version}-#{@original_platform}"
|
@@ -2244,7 +2229,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2244
2229
|
end
|
2245
2230
|
|
2246
2231
|
def pretty_print(q) # :nodoc:
|
2247
|
-
q.group 2,
|
2232
|
+
q.group 2, "Gem::Specification.new do |s|", "end" do
|
2248
2233
|
q.breakable
|
2249
2234
|
|
2250
2235
|
attributes = @@attributes - [:name, :version]
|
@@ -2254,8 +2239,9 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2254
2239
|
|
2255
2240
|
attributes.each do |attr_name|
|
2256
2241
|
current_value = self.send attr_name
|
2257
|
-
|
2258
|
-
|
2242
|
+
current_value = current_value.sort if %i[files test_files].include? attr_name
|
2243
|
+
if current_value != default_value(attr_name) ||
|
2244
|
+
self.class.required_attribute?(attr_name)
|
2259
2245
|
|
2260
2246
|
q.text "s.#{attr_name} = "
|
2261
2247
|
|
@@ -2287,7 +2273,6 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2287
2273
|
|
2288
2274
|
e = Gem::LoadError.new msg
|
2289
2275
|
e.name = self.name
|
2290
|
-
# TODO: e.requirement = dep.requirement
|
2291
2276
|
|
2292
2277
|
raise e
|
2293
2278
|
end
|
@@ -2304,11 +2289,9 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2304
2289
|
end
|
2305
2290
|
|
2306
2291
|
##
|
2307
|
-
# Sets rdoc_options to +value+, ensuring it is an array.
|
2308
|
-
# use this, push onto the array instead.
|
2292
|
+
# Sets rdoc_options to +value+, ensuring it is an array.
|
2309
2293
|
|
2310
2294
|
def rdoc_options=(options)
|
2311
|
-
# TODO: warn about setting instead of pushing
|
2312
2295
|
@rdoc_options = Array options
|
2313
2296
|
end
|
2314
2297
|
|
@@ -2316,7 +2299,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2316
2299
|
# Singular accessor for #require_paths
|
2317
2300
|
|
2318
2301
|
def require_path
|
2319
|
-
val = require_paths
|
2302
|
+
(val = require_paths) && val.first
|
2320
2303
|
end
|
2321
2304
|
|
2322
2305
|
##
|
@@ -2327,11 +2310,9 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2327
2310
|
end
|
2328
2311
|
|
2329
2312
|
##
|
2330
|
-
# Set requirements to +req+, ensuring it is an array.
|
2331
|
-
# use this, push onto the array instead.
|
2313
|
+
# Set requirements to +req+, ensuring it is an array.
|
2332
2314
|
|
2333
2315
|
def requirements=(req)
|
2334
|
-
# TODO: warn about setting instead of pushing
|
2335
2316
|
@requirements = Array req
|
2336
2317
|
end
|
2337
2318
|
|
@@ -2343,7 +2324,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2343
2324
|
# Returns the full path to this spec's ri directory.
|
2344
2325
|
|
2345
2326
|
def ri_dir
|
2346
|
-
@ri_dir ||= File.join base_dir,
|
2327
|
+
@ri_dir ||= File.join base_dir, "ri", full_name
|
2347
2328
|
end
|
2348
2329
|
|
2349
2330
|
##
|
@@ -2352,18 +2333,18 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2352
2333
|
|
2353
2334
|
def ruby_code(obj)
|
2354
2335
|
case obj
|
2355
|
-
when String
|
2356
|
-
when Array
|
2357
|
-
when Hash
|
2358
|
-
seg = obj.keys.sort.map {
|
2336
|
+
when String then obj.dump + ".freeze"
|
2337
|
+
when Array then "[" + obj.map {|x| ruby_code x }.join(", ") + "]"
|
2338
|
+
when Hash then
|
2339
|
+
seg = obj.keys.sort.map {|k| "#{k.to_s.dump} => #{obj[k].to_s.dump}" }
|
2359
2340
|
"{ #{seg.join(', ')} }"
|
2360
|
-
when Gem::Version
|
2361
|
-
when DateLike
|
2362
|
-
when Time
|
2363
|
-
when Numeric
|
2364
|
-
when true, false, nil
|
2365
|
-
when Gem::Platform
|
2366
|
-
when Gem::Requirement
|
2341
|
+
when Gem::Version then obj.to_s.dump
|
2342
|
+
when DateLike then obj.strftime("%Y-%m-%d").dump
|
2343
|
+
when Time then obj.strftime("%Y-%m-%d").dump
|
2344
|
+
when Numeric then obj.inspect
|
2345
|
+
when true, false, nil then obj.inspect
|
2346
|
+
when Gem::Platform then "Gem::Platform.new(#{obj.to_a.inspect})"
|
2347
|
+
when Gem::Requirement then
|
2367
2348
|
list = obj.as_list
|
2368
2349
|
"Gem::Requirement.new(#{ruby_code(list.size == 1 ? obj.to_s : list)})"
|
2369
2350
|
else raise Gem::Exception, "ruby_code case not handled: #{obj.class}"
|
@@ -2383,7 +2364,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2383
2364
|
# True if this gem has the same attributes as +other+.
|
2384
2365
|
|
2385
2366
|
def same_attributes?(spec)
|
2386
|
-
@@attributes.all? {
|
2367
|
+
@@attributes.all? {|name, default| self.send(name) == spec.send(name) }
|
2387
2368
|
end
|
2388
2369
|
|
2389
2370
|
private :same_attributes?
|
@@ -2393,14 +2374,14 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2393
2374
|
|
2394
2375
|
def satisfies_requirement?(dependency)
|
2395
2376
|
return @name == dependency.name &&
|
2396
|
-
|
2377
|
+
dependency.requirement.satisfied_by?(@version)
|
2397
2378
|
end
|
2398
2379
|
|
2399
2380
|
##
|
2400
2381
|
# Returns an object you can use to sort specifications in #sort_by.
|
2401
2382
|
|
2402
2383
|
def sort_obj
|
2403
|
-
[@name, @version,
|
2384
|
+
[@name, @version, Gem::Platform.sort_priority(@new_platform)]
|
2404
2385
|
end
|
2405
2386
|
|
2406
2387
|
##
|
@@ -2447,7 +2428,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2447
2428
|
# Singular accessor for #test_files
|
2448
2429
|
|
2449
2430
|
def test_file # :nodoc:
|
2450
|
-
val = test_files
|
2431
|
+
(val = test_files) && val.first
|
2451
2432
|
end
|
2452
2433
|
|
2453
2434
|
##
|
@@ -2469,7 +2450,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2469
2450
|
@test_files = [@test_suite_file].flatten
|
2470
2451
|
@test_suite_file = nil
|
2471
2452
|
end
|
2472
|
-
if defined?(@test_files)
|
2453
|
+
if defined?(@test_files) && @test_files
|
2473
2454
|
@test_files
|
2474
2455
|
else
|
2475
2456
|
@test_files = []
|
@@ -2493,13 +2474,13 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2493
2474
|
|
2494
2475
|
result << " s.name = #{ruby_code name}"
|
2495
2476
|
result << " s.version = #{ruby_code version}"
|
2496
|
-
unless platform.nil?
|
2477
|
+
unless platform.nil? || platform == Gem::Platform::RUBY
|
2497
2478
|
result << " s.platform = #{ruby_code original_platform}"
|
2498
2479
|
end
|
2499
2480
|
result << ""
|
2500
2481
|
result << " s.required_rubygems_version = #{ruby_code required_rubygems_version} if s.respond_to? :required_rubygems_version="
|
2501
2482
|
|
2502
|
-
if metadata
|
2483
|
+
if metadata && !metadata.empty?
|
2503
2484
|
result << " s.metadata = #{ruby_code metadata} if s.respond_to? :metadata="
|
2504
2485
|
end
|
2505
2486
|
result << " s.require_paths = #{ruby_code raw_require_paths}"
|
@@ -2514,18 +2495,22 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2514
2495
|
:version,
|
2515
2496
|
:has_rdoc,
|
2516
2497
|
:default_executable,
|
2517
|
-
:metadata
|
2498
|
+
:metadata,
|
2499
|
+
:signing_key,
|
2518
2500
|
]
|
2519
2501
|
|
2520
2502
|
@@attributes.each do |attr_name|
|
2521
2503
|
next if handled.include? attr_name
|
2522
2504
|
current_value = self.send(attr_name)
|
2523
|
-
if current_value != default_value(attr_name)
|
2524
|
-
self.class.required_attribute? attr_name
|
2505
|
+
if current_value != default_value(attr_name) || self.class.required_attribute?(attr_name)
|
2525
2506
|
result << " s.#{attr_name} = #{ruby_code current_value}"
|
2526
2507
|
end
|
2527
2508
|
end
|
2528
2509
|
|
2510
|
+
if String === signing_key
|
2511
|
+
result << " s.signing_key = #{signing_key.dump}.freeze"
|
2512
|
+
end
|
2513
|
+
|
2529
2514
|
if @installed_by_version
|
2530
2515
|
result << nil
|
2531
2516
|
result << " s.installed_by_version = \"#{Gem::VERSION}\" if s.respond_to? :installed_by_version"
|
@@ -2533,33 +2518,14 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2533
2518
|
|
2534
2519
|
unless dependencies.empty?
|
2535
2520
|
result << nil
|
2536
|
-
result << "
|
2537
|
-
result << " s.specification_version = #{specification_version}"
|
2521
|
+
result << " s.specification_version = #{specification_version}"
|
2538
2522
|
result << nil
|
2539
2523
|
|
2540
|
-
result << " if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then"
|
2541
|
-
|
2542
2524
|
dependencies.each do |dep|
|
2543
2525
|
req = dep.requirements_list.inspect
|
2544
2526
|
dep.instance_variable_set :@type, :runtime if dep.type.nil? # HACK
|
2545
|
-
result << "
|
2546
|
-
end
|
2547
|
-
|
2548
|
-
result << " else"
|
2549
|
-
|
2550
|
-
dependencies.each do |dep|
|
2551
|
-
version_reqs_param = dep.requirements_list.inspect
|
2552
|
-
result << " s.add_dependency(%q<#{dep.name}>.freeze, #{version_reqs_param})"
|
2527
|
+
result << " s.add_#{dep.type}_dependency(%q<#{dep.name}>.freeze, #{req})"
|
2553
2528
|
end
|
2554
|
-
|
2555
|
-
result << ' end'
|
2556
|
-
|
2557
|
-
result << " else"
|
2558
|
-
dependencies.each do |dep|
|
2559
|
-
version_reqs_param = dep.requirements_list.inspect
|
2560
|
-
result << " s.add_dependency(%q<#{dep.name}>.freeze, #{version_reqs_param})"
|
2561
|
-
end
|
2562
|
-
result << " end"
|
2563
2529
|
end
|
2564
2530
|
|
2565
2531
|
result << "end"
|
@@ -2590,17 +2556,20 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2590
2556
|
end
|
2591
2557
|
|
2592
2558
|
def to_yaml(opts = {}) # :nodoc:
|
2559
|
+
Gem.load_yaml
|
2560
|
+
|
2593
2561
|
# Because the user can switch the YAML engine behind our
|
2594
2562
|
# back, we have to check again here to make sure that our
|
2595
2563
|
# psych code was properly loaded, and load it if not.
|
2596
2564
|
unless Gem.const_defined?(:NoAliasYAMLTree)
|
2597
|
-
|
2565
|
+
require_relative "psych_tree"
|
2598
2566
|
end
|
2599
2567
|
|
2600
2568
|
builder = Gem::NoAliasYAMLTree.create
|
2601
2569
|
builder << self
|
2602
2570
|
ast = builder.tree
|
2603
2571
|
|
2572
|
+
require "stringio"
|
2604
2573
|
io = StringIO.new
|
2605
2574
|
io.set_encoding Encoding::UTF_8
|
2606
2575
|
|
@@ -2618,7 +2587,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2618
2587
|
begin
|
2619
2588
|
dependencies.each do |dep|
|
2620
2589
|
next unless dep.runtime?
|
2621
|
-
dep.
|
2590
|
+
dep.matching_specs(true).each do |dep_spec|
|
2622
2591
|
next if visited.has_key?(dep_spec)
|
2623
2592
|
visited[dep_spec] = true
|
2624
2593
|
trail.push(dep_spec)
|
@@ -2630,7 +2599,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2630
2599
|
unless result == :next
|
2631
2600
|
spec_name = dep_spec.name
|
2632
2601
|
dep_spec.traverse(trail, visited, &block) unless
|
2633
|
-
trail.any? {
|
2602
|
+
trail.any? {|s| s.name == spec_name }
|
2634
2603
|
end
|
2635
2604
|
end
|
2636
2605
|
end
|
@@ -2647,8 +2616,6 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2647
2616
|
# checks..
|
2648
2617
|
|
2649
2618
|
def validate(packaging = true, strict = false)
|
2650
|
-
require 'rubygems/user_interaction'
|
2651
|
-
extend Gem::UserInteraction
|
2652
2619
|
normalize
|
2653
2620
|
|
2654
2621
|
validation_policy = Gem::SpecificationPolicy.new(self)
|
@@ -2657,30 +2624,27 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2657
2624
|
end
|
2658
2625
|
|
2659
2626
|
def keep_only_files_and_directories
|
2660
|
-
@executables.delete_if {
|
2661
|
-
@extensions.delete_if {
|
2662
|
-
@extra_rdoc_files.delete_if {
|
2663
|
-
@files.delete_if {
|
2664
|
-
@test_files.delete_if {
|
2627
|
+
@executables.delete_if {|x| File.directory?(File.join(@bindir, x)) }
|
2628
|
+
@extensions.delete_if {|x| File.directory?(x) && !File.symlink?(x) }
|
2629
|
+
@extra_rdoc_files.delete_if {|x| File.directory?(x) && !File.symlink?(x) }
|
2630
|
+
@files.delete_if {|x| File.directory?(x) && !File.symlink?(x) }
|
2631
|
+
@test_files.delete_if {|x| File.directory?(x) && !File.symlink?(x) }
|
2665
2632
|
end
|
2666
2633
|
|
2667
2634
|
def validate_metadata
|
2668
2635
|
Gem::SpecificationPolicy.new(self).validate_metadata
|
2669
2636
|
end
|
2637
|
+
rubygems_deprecate :validate_metadata
|
2670
2638
|
|
2671
|
-
##
|
2672
|
-
# Checks that dependencies use requirements as we recommend. Warnings are
|
2673
|
-
# issued when dependencies are open-ended or overly strict for semantic
|
2674
|
-
# versioning.
|
2675
2639
|
def validate_dependencies
|
2676
2640
|
Gem::SpecificationPolicy.new(self).validate_dependencies
|
2677
2641
|
end
|
2642
|
+
rubygems_deprecate :validate_dependencies
|
2678
2643
|
|
2679
|
-
##
|
2680
|
-
# Checks to see if the files to be packaged are world-readable.
|
2681
2644
|
def validate_permissions
|
2682
2645
|
Gem::SpecificationPolicy.new(self).validate_permissions
|
2683
2646
|
end
|
2647
|
+
rubygems_deprecate :validate_permissions
|
2684
2648
|
|
2685
2649
|
##
|
2686
2650
|
# Set the version to +version+, potentially also setting
|
@@ -2689,10 +2653,12 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2689
2653
|
|
2690
2654
|
def version=(version)
|
2691
2655
|
@version = Gem::Version.create(version)
|
2656
|
+
return if @version.nil?
|
2657
|
+
|
2692
2658
|
# skip to set required_ruby_version when pre-released rubygems.
|
2693
2659
|
# It caused to raise CircularDependencyError
|
2694
2660
|
if @version.prerelease? && (@name.nil? || @name.strip != "rubygems")
|
2695
|
-
self.required_rubygems_version =
|
2661
|
+
self.required_rubygems_version = "> 1.3.1"
|
2696
2662
|
end
|
2697
2663
|
invalidate_memoized_attributes
|
2698
2664
|
|
@@ -2708,9 +2674,9 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2708
2674
|
case ivar
|
2709
2675
|
when "date"
|
2710
2676
|
# Force Date to go through the extra coerce logic in date=
|
2711
|
-
self.date = val.
|
2677
|
+
self.date = val.tap(&Gem::UNTAINT)
|
2712
2678
|
else
|
2713
|
-
instance_variable_set "@#{ivar}", val.
|
2679
|
+
instance_variable_set "@#{ivar}", val.tap(&Gem::UNTAINT)
|
2714
2680
|
end
|
2715
2681
|
end
|
2716
2682
|
|
@@ -2730,9 +2696,9 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2730
2696
|
default = self.default_value attribute
|
2731
2697
|
|
2732
2698
|
value = case default
|
2733
|
-
|
2734
|
-
|
2735
|
-
|
2699
|
+
when Time, Numeric, Symbol, true, false, nil then default
|
2700
|
+
else default.dup
|
2701
|
+
end
|
2736
2702
|
|
2737
2703
|
instance_variable_set "@#{attribute}", value
|
2738
2704
|
end
|
@@ -2740,11 +2706,14 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2740
2706
|
@installed_by_version ||= nil
|
2741
2707
|
end
|
2742
2708
|
|
2709
|
+
def flatten_require_paths # :nodoc:
|
2710
|
+
return unless raw_require_paths.first.is_a?(Array)
|
2711
|
+
|
2712
|
+
warn "#{name} #{version} includes a gemspec with `require_paths` set to an array of arrays. Newer versions of this gem might've already fixed this"
|
2713
|
+
raw_require_paths.flatten!
|
2714
|
+
end
|
2715
|
+
|
2743
2716
|
def raw_require_paths # :nodoc:
|
2744
2717
|
@require_paths
|
2745
2718
|
end
|
2746
|
-
|
2747
2719
|
end
|
2748
|
-
|
2749
|
-
# DOC: What is this and why is it here, randomly, at the end of this file?
|
2750
|
-
Gem.clear_paths
|