rubygems-update 2.6.1 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +5899 -0
- data/CODE_OF_CONDUCT.md +76 -35
- data/CONTRIBUTING.md +231 -0
- data/MAINTAINERS.txt +8 -0
- data/Manifest.txt +428 -216
- data/POLICIES.md +135 -0
- data/README.md +112 -0
- data/UPGRADING.md +15 -0
- data/bundler/CHANGELOG.md +4719 -0
- data/bundler/LICENSE.md +22 -0
- data/bundler/README.md +58 -0
- data/bundler/UPGRADING.md +222 -0
- data/bundler/bundler.gemspec +46 -0
- data/bundler/exe/bundle +29 -0
- data/bundler/exe/bundler +4 -0
- data/bundler/lib/bundler/.document +1 -0
- data/bundler/lib/bundler/build_metadata.rb +45 -0
- data/bundler/lib/bundler/capistrano.rb +22 -0
- data/bundler/lib/bundler/checksum.rb +245 -0
- data/bundler/lib/bundler/ci_detector.rb +75 -0
- data/bundler/lib/bundler/cli/add.rb +47 -0
- data/bundler/lib/bundler/cli/binstubs.rb +57 -0
- data/bundler/lib/bundler/cli/cache.rb +43 -0
- data/bundler/lib/bundler/cli/check.rb +40 -0
- data/bundler/lib/bundler/cli/clean.rb +25 -0
- data/bundler/lib/bundler/cli/common.rb +138 -0
- data/bundler/lib/bundler/cli/config.rb +204 -0
- data/bundler/lib/bundler/cli/console.rb +44 -0
- data/bundler/lib/bundler/cli/doctor.rb +157 -0
- data/bundler/lib/bundler/cli/exec.rb +88 -0
- data/bundler/lib/bundler/cli/fund.rb +36 -0
- data/bundler/lib/bundler/cli/gem.rb +471 -0
- data/bundler/lib/bundler/cli/info.rb +83 -0
- data/bundler/lib/bundler/cli/init.rb +51 -0
- data/bundler/lib/bundler/cli/inject.rb +60 -0
- data/bundler/lib/bundler/cli/install.rb +190 -0
- data/bundler/lib/bundler/cli/issue.rb +41 -0
- data/bundler/lib/bundler/cli/list.rb +66 -0
- data/bundler/lib/bundler/cli/lock.rb +73 -0
- data/bundler/lib/bundler/cli/open.rb +29 -0
- data/bundler/lib/bundler/cli/outdated.rb +297 -0
- data/bundler/lib/bundler/cli/platform.rb +48 -0
- data/bundler/lib/bundler/cli/plugin.rb +34 -0
- data/bundler/lib/bundler/cli/pristine.rb +60 -0
- data/bundler/lib/bundler/cli/remove.rb +17 -0
- data/bundler/lib/bundler/cli/show.rb +75 -0
- data/bundler/lib/bundler/cli/update.rb +123 -0
- data/bundler/lib/bundler/cli/viz.rb +31 -0
- data/bundler/lib/bundler/cli.rb +846 -0
- data/bundler/lib/bundler/compact_index_client/cache.rb +121 -0
- data/bundler/lib/bundler/compact_index_client/cache_file.rb +153 -0
- data/bundler/lib/bundler/compact_index_client/gem_parser.rb +32 -0
- data/bundler/lib/bundler/compact_index_client/updater.rb +115 -0
- data/bundler/lib/bundler/compact_index_client.rb +126 -0
- data/bundler/lib/bundler/constants.rb +7 -0
- data/bundler/lib/bundler/current_ruby.rb +92 -0
- data/bundler/lib/bundler/definition.rb +1005 -0
- data/bundler/lib/bundler/dependency.rb +101 -0
- data/bundler/lib/bundler/deployment.rb +69 -0
- data/bundler/lib/bundler/deprecate.rb +44 -0
- data/bundler/lib/bundler/digest.rb +71 -0
- data/bundler/lib/bundler/dsl.rb +601 -0
- data/bundler/lib/bundler/endpoint_specification.rb +147 -0
- data/bundler/lib/bundler/env.rb +148 -0
- data/bundler/lib/bundler/environment_preserver.rb +86 -0
- data/bundler/lib/bundler/errors.rb +233 -0
- data/bundler/lib/bundler/feature_flag.rb +53 -0
- data/bundler/lib/bundler/fetcher/base.rb +52 -0
- data/bundler/lib/bundler/fetcher/compact_index.rb +129 -0
- data/bundler/lib/bundler/fetcher/dependency.rb +78 -0
- data/bundler/lib/bundler/fetcher/downloader.rb +91 -0
- data/bundler/lib/bundler/fetcher/gem_remote_fetcher.rb +16 -0
- data/bundler/lib/bundler/fetcher/index.rb +25 -0
- data/bundler/lib/bundler/fetcher.rb +324 -0
- data/bundler/lib/bundler/force_platform.rb +18 -0
- data/bundler/lib/bundler/friendly_errors.rb +126 -0
- data/bundler/lib/bundler/gem_helper.rb +237 -0
- data/bundler/lib/bundler/gem_helpers.rb +127 -0
- data/bundler/lib/bundler/gem_tasks.rb +7 -0
- data/bundler/lib/bundler/gem_version_promoter.rb +145 -0
- data/bundler/lib/bundler/graph.rb +152 -0
- data/bundler/lib/bundler/index.rb +205 -0
- data/bundler/lib/bundler/injector.rb +287 -0
- data/bundler/lib/bundler/inline.rb +73 -0
- data/bundler/lib/bundler/installer/gem_installer.rb +84 -0
- data/bundler/lib/bundler/installer/parallel_installer.rb +202 -0
- data/bundler/lib/bundler/installer/standalone.rb +116 -0
- data/bundler/lib/bundler/installer.rb +267 -0
- data/bundler/lib/bundler/lazy_specification.rb +170 -0
- data/bundler/lib/bundler/lockfile_generator.rb +104 -0
- data/bundler/lib/bundler/lockfile_parser.rb +289 -0
- data/bundler/lib/bundler/man/.document +1 -0
- data/bundler/lib/bundler/man/bundle-add.1 +59 -0
- data/bundler/lib/bundler/man/bundle-add.1.ronn +58 -0
- data/bundler/lib/bundler/man/bundle-binstubs.1 +30 -0
- data/bundler/lib/bundler/man/bundle-binstubs.1.ronn +41 -0
- data/bundler/lib/bundler/man/bundle-cache.1 +40 -0
- data/bundler/lib/bundler/man/bundle-cache.1.ronn +79 -0
- data/bundler/lib/bundler/man/bundle-check.1 +22 -0
- data/bundler/lib/bundler/man/bundle-check.1.ronn +26 -0
- data/bundler/lib/bundler/man/bundle-clean.1 +17 -0
- data/bundler/lib/bundler/man/bundle-clean.1.ronn +18 -0
- data/bundler/lib/bundler/man/bundle-config.1 +321 -0
- data/bundler/lib/bundler/man/bundle-config.1.ronn +411 -0
- data/bundler/lib/bundler/man/bundle-console.1 +35 -0
- data/bundler/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/bundler/lib/bundler/man/bundle-doctor.1 +30 -0
- data/bundler/lib/bundler/man/bundle-doctor.1.ronn +33 -0
- data/bundler/lib/bundler/man/bundle-exec.1 +104 -0
- data/bundler/lib/bundler/man/bundle-exec.1.ronn +151 -0
- data/bundler/lib/bundler/man/bundle-gem.1 +69 -0
- data/bundler/lib/bundler/man/bundle-gem.1.ronn +117 -0
- data/bundler/lib/bundler/man/bundle-help.1 +9 -0
- data/bundler/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/bundler/lib/bundler/man/bundle-info.1 +14 -0
- data/bundler/lib/bundler/man/bundle-info.1.ronn +17 -0
- data/bundler/lib/bundler/man/bundle-init.1 +20 -0
- data/bundler/lib/bundler/man/bundle-init.1.ronn +31 -0
- data/bundler/lib/bundler/man/bundle-inject.1 +23 -0
- data/bundler/lib/bundler/man/bundle-inject.1.ronn +24 -0
- data/bundler/lib/bundler/man/bundle-install.1 +215 -0
- data/bundler/lib/bundler/man/bundle-install.1.ronn +383 -0
- data/bundler/lib/bundler/man/bundle-list.1 +35 -0
- data/bundler/lib/bundler/man/bundle-list.1.ronn +33 -0
- data/bundler/lib/bundler/man/bundle-lock.1 +60 -0
- data/bundler/lib/bundler/man/bundle-lock.1.ronn +94 -0
- data/bundler/lib/bundler/man/bundle-open.1 +32 -0
- data/bundler/lib/bundler/man/bundle-open.1.ronn +27 -0
- data/bundler/lib/bundler/man/bundle-outdated.1 +100 -0
- data/bundler/lib/bundler/man/bundle-outdated.1.ronn +106 -0
- data/bundler/lib/bundler/man/bundle-platform.1 +49 -0
- data/bundler/lib/bundler/man/bundle-platform.1.ronn +49 -0
- data/bundler/lib/bundler/man/bundle-plugin.1 +55 -0
- data/bundler/lib/bundler/man/bundle-plugin.1.ronn +59 -0
- data/bundler/lib/bundler/man/bundle-pristine.1 +23 -0
- data/bundler/lib/bundler/man/bundle-pristine.1.ronn +34 -0
- data/bundler/lib/bundler/man/bundle-remove.1 +21 -0
- data/bundler/lib/bundler/man/bundle-remove.1.ronn +23 -0
- data/bundler/lib/bundler/man/bundle-show.1 +16 -0
- data/bundler/lib/bundler/man/bundle-show.1.ronn +21 -0
- data/bundler/lib/bundler/man/bundle-update.1 +275 -0
- data/bundler/lib/bundler/man/bundle-update.1.ronn +351 -0
- data/bundler/lib/bundler/man/bundle-version.1 +22 -0
- data/bundler/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/bundler/lib/bundler/man/bundle-viz.1 +30 -0
- data/bundler/lib/bundler/man/bundle-viz.1.ronn +32 -0
- data/bundler/lib/bundler/man/bundle.1 +102 -0
- data/bundler/lib/bundler/man/bundle.1.ronn +116 -0
- data/bundler/lib/bundler/man/gemfile.5 +470 -0
- data/bundler/lib/bundler/man/gemfile.5.ronn +552 -0
- data/bundler/lib/bundler/man/index.txt +29 -0
- data/bundler/lib/bundler/match_metadata.rb +17 -0
- data/bundler/lib/bundler/match_platform.rb +23 -0
- data/bundler/lib/bundler/match_remote_metadata.rb +29 -0
- data/bundler/lib/bundler/mirror.rb +221 -0
- data/bundler/lib/bundler/plugin/api/source.rb +321 -0
- data/bundler/lib/bundler/plugin/api.rb +81 -0
- data/bundler/lib/bundler/plugin/dsl.rb +53 -0
- data/bundler/lib/bundler/plugin/events.rb +61 -0
- data/bundler/lib/bundler/plugin/index.rb +193 -0
- data/bundler/lib/bundler/plugin/installer/git.rb +34 -0
- data/bundler/lib/bundler/plugin/installer/rubygems.rb +19 -0
- data/bundler/lib/bundler/plugin/installer.rb +112 -0
- data/bundler/lib/bundler/plugin/source_list.rb +31 -0
- data/bundler/lib/bundler/plugin.rb +359 -0
- data/bundler/lib/bundler/process_lock.rb +24 -0
- data/bundler/lib/bundler/remote_specification.rb +117 -0
- data/bundler/lib/bundler/resolver/base.rb +107 -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 +77 -0
- data/bundler/lib/bundler/resolver/root.rb +25 -0
- data/bundler/lib/bundler/resolver/spec_group.rb +79 -0
- data/bundler/lib/bundler/resolver.rb +462 -0
- data/bundler/lib/bundler/retry.rb +66 -0
- data/bundler/lib/bundler/ruby_dsl.rb +53 -0
- data/bundler/lib/bundler/ruby_version.rb +131 -0
- data/bundler/lib/bundler/rubygems_ext.rb +328 -0
- data/bundler/lib/bundler/rubygems_gem_installer.rb +137 -0
- data/bundler/lib/bundler/rubygems_integration.rb +493 -0
- data/bundler/lib/bundler/runtime.rb +307 -0
- data/bundler/lib/bundler/safe_marshal.rb +31 -0
- data/bundler/lib/bundler/self_manager.rb +186 -0
- data/bundler/lib/bundler/settings/validator.rb +102 -0
- data/bundler/lib/bundler/settings.rb +588 -0
- data/bundler/lib/bundler/setup.rb +33 -0
- data/bundler/lib/bundler/shared_helpers.rb +380 -0
- data/bundler/lib/bundler/similarity_detector.rb +63 -0
- data/bundler/lib/bundler/source/gemspec.rb +18 -0
- data/bundler/lib/bundler/source/git/git_proxy.rb +455 -0
- data/bundler/lib/bundler/source/git.rb +380 -0
- data/bundler/lib/bundler/source/metadata.rb +62 -0
- data/bundler/lib/bundler/source/path/installer.rb +53 -0
- data/bundler/lib/bundler/source/path.rb +261 -0
- data/bundler/lib/bundler/source/rubygems/remote.rb +68 -0
- data/bundler/lib/bundler/source/rubygems.rb +516 -0
- data/bundler/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/bundler/lib/bundler/source.rb +116 -0
- data/bundler/lib/bundler/source_list.rb +227 -0
- data/bundler/lib/bundler/source_map.rb +71 -0
- data/bundler/lib/bundler/spec_set.rb +247 -0
- data/bundler/lib/bundler/stub_specification.rb +119 -0
- data/bundler/lib/bundler/templates/.document +1 -0
- data/bundler/lib/bundler/templates/Executable +27 -0
- data/bundler/lib/bundler/templates/Executable.bundler +109 -0
- data/bundler/lib/bundler/templates/Executable.standalone +14 -0
- data/bundler/lib/bundler/templates/Gemfile +5 -0
- data/bundler/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +84 -0
- data/bundler/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +26 -0
- data/bundler/lib/bundler/templates/newgem/LICENSE.txt.tt +21 -0
- data/bundler/lib/bundler/templates/newgem/README.md.tt +45 -0
- data/bundler/lib/bundler/templates/newgem/Rakefile.tt +67 -0
- data/bundler/lib/bundler/templates/newgem/bin/console.tt +11 -0
- data/bundler/lib/bundler/templates/newgem/bin/setup.tt +8 -0
- data/bundler/lib/bundler/templates/newgem/circleci/config.yml.tt +25 -0
- data/bundler/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +10 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +9 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +6 -0
- data/bundler/lib/bundler/templates/newgem/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 +23 -0
- data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +18 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +9 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +15 -0
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +51 -0
- data/bundler/lib/bundler/templates/newgem/rspec.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/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 +11 -0
- data/bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +15 -0
- 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/minitest/test_newgem.rb.tt +13 -0
- data/bundler/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- data/bundler/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- data/bundler/lib/bundler/ui/rg_proxy.rb +19 -0
- data/bundler/lib/bundler/ui/shell.rb +165 -0
- data/bundler/lib/bundler/ui/silent.rb +85 -0
- data/bundler/lib/bundler/ui.rb +9 -0
- data/bundler/lib/bundler/uri_credentials_filter.rb +43 -0
- data/bundler/lib/bundler/uri_normalizer.rb +23 -0
- 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 +175 -0
- data/bundler/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +2694 -0
- 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 +41 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +65 -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 +1073 -0
- 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 +150 -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 +248 -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 +105 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +61 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +108 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +143 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +373 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +130 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +340 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +825 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/command.rb +151 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +107 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +106 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +281 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb +178 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +37 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +88 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor.rb +17 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +89 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +195 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +178 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +293 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +72 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +335 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +388 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +115 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +84 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/lcs_diff.rb +49 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +134 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell.rb +81 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +285 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +3 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +663 -0
- data/bundler/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/bundler/lib/bundler/vendor/tsort/lib/tsort.rb +455 -0
- data/bundler/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +853 -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 +1588 -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 +183 -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 +4 -0
- data/bundler/lib/bundler/vendored_net_http.rb +8 -0
- data/bundler/lib/bundler/vendored_persistent.rb +11 -0
- data/bundler/lib/bundler/vendored_pub_grub.rb +4 -0
- data/bundler/lib/bundler/vendored_thor.rb +8 -0
- data/bundler/lib/bundler/vendored_timeout.rb +8 -0
- data/bundler/lib/bundler/vendored_tsort.rb +4 -0
- data/bundler/lib/bundler/vendored_uri.rb +4 -0
- data/bundler/lib/bundler/version.rb +13 -0
- data/bundler/lib/bundler/vlad.rb +17 -0
- data/bundler/lib/bundler/worker.rb +117 -0
- data/bundler/lib/bundler/yaml_serializer.rb +93 -0
- data/bundler/lib/bundler.rb +665 -0
- data/{test/rubygems/bogussources.rb → exe/gem} +5 -2
- data/exe/update_rubygems +38 -0
- data/hide_lib_for_update/note.txt +0 -4
- data/lib/rubygems/available_set.rb +12 -12
- data/lib/rubygems/basic_specification.rb +75 -58
- data/lib/rubygems/bundler_version_finder.rb +77 -0
- data/lib/rubygems/ci_detector.rb +75 -0
- data/lib/rubygems/command.rb +144 -71
- data/lib/rubygems/command_manager.rb +64 -27
- data/lib/rubygems/commands/build_command.rb +88 -17
- data/lib/rubygems/commands/cert_command.rb +131 -83
- data/lib/rubygems/commands/check_command.rb +30 -27
- data/lib/rubygems/commands/cleanup_command.rb +57 -40
- data/lib/rubygems/commands/contents_command.rb +37 -39
- data/lib/rubygems/commands/dependency_command.rb +53 -65
- data/lib/rubygems/commands/environment_command.rb +32 -16
- data/lib/rubygems/commands/exec_command.rb +249 -0
- data/lib/rubygems/commands/fetch_command.rb +36 -19
- data/lib/rubygems/commands/generate_index_command.rb +40 -74
- data/lib/rubygems/commands/help_command.rb +22 -22
- data/lib/rubygems/commands/info_command.rb +38 -0
- data/lib/rubygems/commands/install_command.rb +67 -143
- data/lib/rubygems/commands/list_command.rb +10 -9
- data/lib/rubygems/commands/lock_command.rb +12 -14
- data/lib/rubygems/commands/mirror_command.rb +4 -4
- data/lib/rubygems/commands/open_command.rb +28 -26
- data/lib/rubygems/commands/outdated_command.rb +6 -6
- data/lib/rubygems/commands/owner_command.rb +51 -27
- data/lib/rubygems/commands/pristine_command.rb +99 -71
- data/lib/rubygems/commands/push_command.rb +53 -46
- data/lib/rubygems/commands/query_command.rb +21 -328
- data/lib/rubygems/commands/rdoc_command.rb +33 -33
- data/lib/rubygems/commands/search_command.rb +9 -9
- data/lib/rubygems/commands/server_command.rb +15 -76
- data/lib/rubygems/commands/setup_command.rb +370 -186
- data/lib/rubygems/commands/signin_command.rb +34 -0
- data/lib/rubygems/commands/signout_command.rb +32 -0
- data/lib/rubygems/commands/sources_command.rb +57 -41
- data/lib/rubygems/commands/specification_command.rb +38 -28
- data/lib/rubygems/commands/stale_command.rb +6 -5
- data/lib/rubygems/commands/uninstall_command.rb +96 -62
- data/lib/rubygems/commands/unpack_command.rb +44 -53
- data/lib/rubygems/commands/update_command.rb +155 -99
- data/lib/rubygems/commands/which_command.rb +14 -17
- data/lib/rubygems/commands/yank_command.rb +28 -32
- data/lib/rubygems/compatibility.rb +13 -32
- data/lib/rubygems/config_file.rb +214 -119
- data/lib/rubygems/core_ext/kernel_gem.rb +10 -16
- data/lib/rubygems/core_ext/kernel_require.rb +92 -90
- data/lib/rubygems/core_ext/kernel_warn.rb +49 -0
- data/lib/rubygems/core_ext/tcpsocket_init.rb +54 -0
- data/lib/rubygems/defaults.rb +184 -54
- data/lib/rubygems/dependency.rb +75 -62
- data/lib/rubygems/dependency_installer.rb +74 -230
- data/lib/rubygems/dependency_list.rb +32 -33
- data/lib/rubygems/deprecate.rb +113 -17
- data/lib/rubygems/doctor.rb +31 -31
- data/lib/rubygems/errors.rb +51 -13
- data/lib/rubygems/exceptions.rb +65 -35
- data/lib/rubygems/ext/build_error.rb +3 -1
- data/lib/rubygems/ext/builder.rb +103 -77
- 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 +6 -9
- data/lib/rubygems/ext/ext_conf_builder.rb +40 -61
- data/lib/rubygems/ext/rake_builder.rb +18 -21
- data/lib/rubygems/ext.rb +8 -7
- data/lib/rubygems/gem_runner.rb +19 -21
- data/lib/rubygems/gemcutter_utilities/webauthn_listener/response.rb +163 -0
- data/lib/rubygems/gemcutter_utilities/webauthn_listener.rb +105 -0
- data/lib/rubygems/gemcutter_utilities/webauthn_poller.rb +78 -0
- data/lib/rubygems/gemcutter_utilities.rb +246 -43
- data/lib/rubygems/install_default_message.rb +3 -3
- data/lib/rubygems/install_message.rb +3 -3
- data/lib/rubygems/install_update_options.rb +104 -98
- data/lib/rubygems/installer.rb +407 -225
- data/lib/rubygems/installer_uninstaller_utils.rb +27 -0
- data/lib/rubygems/local_remote_options.rb +29 -32
- data/lib/rubygems/name_tuple.rb +18 -23
- data/lib/rubygems/net/http.rb +3 -0
- data/lib/rubygems/net-http/LICENSE.txt +22 -0
- data/lib/rubygems/net-http/lib/net/http/backward.rb +40 -0
- data/lib/rubygems/net-http/lib/net/http/exceptions.rb +34 -0
- data/lib/rubygems/net-http/lib/net/http/generic_request.rb +414 -0
- data/lib/rubygems/net-http/lib/net/http/header.rb +981 -0
- data/lib/rubygems/net-http/lib/net/http/proxy_delta.rb +17 -0
- data/lib/rubygems/net-http/lib/net/http/request.rb +88 -0
- data/lib/rubygems/net-http/lib/net/http/requests.rb +425 -0
- data/lib/rubygems/net-http/lib/net/http/response.rb +738 -0
- data/lib/rubygems/net-http/lib/net/http/responses.rb +1174 -0
- data/lib/rubygems/net-http/lib/net/http/status.rb +84 -0
- data/lib/rubygems/net-http/lib/net/http.rb +2496 -0
- data/lib/rubygems/net-http/lib/net/https.rb +23 -0
- data/lib/rubygems/net-protocol/LICENSE.txt +22 -0
- data/lib/rubygems/net-protocol/lib/net/protocol.rb +544 -0
- 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 +2330 -0
- data/lib/rubygems/optparse.rb +3 -0
- data/lib/rubygems/package/digest_io.rb +5 -7
- data/lib/rubygems/package/file_source.rb +6 -8
- data/lib/rubygems/package/io_source.rb +6 -4
- data/lib/rubygems/package/old.rb +19 -28
- data/lib/rubygems/package/source.rb +1 -1
- data/lib/rubygems/package/tar_header.rb +114 -93
- data/lib/rubygems/package/tar_reader/entry.rb +116 -22
- data/lib/rubygems/package/tar_reader.rb +18 -40
- data/lib/rubygems/package/tar_writer.rb +42 -56
- data/lib/rubygems/package.rb +245 -145
- data/lib/rubygems/package_task.rb +8 -14
- data/lib/rubygems/path_support.rb +21 -16
- data/lib/rubygems/platform.rb +135 -74
- data/lib/rubygems/psych_tree.rb +3 -2
- data/lib/rubygems/query_utils.rb +349 -0
- data/lib/rubygems/rdoc.rb +4 -326
- data/lib/rubygems/remote_fetcher.rb +99 -181
- data/lib/rubygems/request/connection_pools.rb +31 -24
- data/lib/rubygems/request/http_pool.rb +6 -7
- data/lib/rubygems/request/https_pool.rb +2 -3
- data/lib/rubygems/request.rb +103 -53
- data/lib/rubygems/request_set/gem_dependency_api.rb +182 -190
- data/lib/rubygems/request_set/lockfile/parser.rb +42 -52
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +34 -24
- data/lib/rubygems/request_set/lockfile.rb +32 -35
- data/lib/rubygems/request_set.rb +115 -71
- data/lib/rubygems/requirement.rb +77 -68
- data/lib/rubygems/resolv/LICENSE.txt +22 -0
- data/lib/rubygems/resolv/lib/resolv.rb +3387 -0
- data/lib/rubygems/resolver/activation_request.rb +34 -61
- data/lib/rubygems/resolver/api_set/gem_parser.rb +24 -0
- data/lib/rubygems/resolver/api_set.rb +40 -32
- data/lib/rubygems/resolver/api_specification.rb +37 -18
- data/lib/rubygems/resolver/best_set.rb +15 -17
- data/lib/rubygems/resolver/composed_set.rb +9 -11
- data/lib/rubygems/resolver/conflict.rb +19 -33
- data/lib/rubygems/resolver/current_set.rb +2 -4
- data/lib/rubygems/resolver/dependency_request.rb +8 -9
- data/lib/rubygems/resolver/git_set.rb +8 -10
- data/lib/rubygems/resolver/git_specification.rb +11 -13
- data/lib/rubygems/resolver/index_set.rb +13 -15
- data/lib/rubygems/resolver/index_specification.rb +42 -11
- data/lib/rubygems/resolver/installed_specification.rb +9 -11
- data/lib/rubygems/resolver/installer_set.rb +87 -45
- data/lib/rubygems/resolver/local_specification.rb +5 -7
- data/lib/rubygems/resolver/lock_set.rb +13 -15
- data/lib/rubygems/resolver/lock_specification.rb +13 -15
- data/lib/rubygems/resolver/molinillo/LICENSE +9 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb +88 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb +36 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +66 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +62 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +63 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +61 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb +126 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb +46 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb +36 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +164 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +110 -146
- data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +83 -9
- 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 +552 -172
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb +3 -2
- data/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb +12 -6
- data/lib/rubygems/resolver/molinillo/lib/molinillo.rb +6 -5
- data/lib/rubygems/resolver/molinillo.rb +2 -1
- data/lib/rubygems/resolver/requirement_list.rb +2 -2
- data/lib/rubygems/resolver/set.rb +3 -5
- data/lib/rubygems/resolver/source_set.rb +6 -7
- data/lib/rubygems/resolver/spec_specification.rb +16 -4
- data/lib/rubygems/resolver/specification.rb +25 -10
- data/lib/rubygems/resolver/stats.rb +1 -0
- data/lib/rubygems/resolver/vendor_set.rb +6 -8
- data/lib/rubygems/resolver/vendor_specification.rb +6 -8
- data/lib/rubygems/resolver.rb +121 -72
- data/lib/rubygems/s3_uri_signer.rb +177 -0
- data/lib/rubygems/safe_marshal/elements.rb +138 -0
- data/lib/rubygems/safe_marshal/reader.rb +306 -0
- data/lib/rubygems/safe_marshal/visitors/stream_printer.rb +31 -0
- data/lib/rubygems/safe_marshal/visitors/to_ruby.rb +385 -0
- data/lib/rubygems/safe_marshal/visitors/visitor.rb +74 -0
- data/lib/rubygems/safe_marshal.rb +74 -0
- data/lib/rubygems/safe_yaml.rb +36 -0
- data/lib/rubygems/security/policies.rb +49 -51
- data/lib/rubygems/security/policy.rb +46 -53
- data/lib/rubygems/security/signer.rb +86 -29
- data/lib/rubygems/security/trust_dir.rb +22 -24
- data/lib/rubygems/security.rb +101 -82
- data/lib/rubygems/security_option.rb +43 -0
- data/lib/rubygems/shellwords.rb +3 -0
- data/lib/rubygems/source/git.rb +40 -42
- data/lib/rubygems/source/installed.rb +5 -9
- data/lib/rubygems/source/local.rb +30 -33
- data/lib/rubygems/source/lock.rb +10 -10
- data/lib/rubygems/source/specific_file.rb +7 -9
- data/lib/rubygems/source/vendor.rb +3 -7
- data/lib/rubygems/source.rb +78 -68
- data/lib/rubygems/source_list.rb +11 -15
- data/lib/rubygems/spec_fetcher.rb +71 -83
- data/lib/rubygems/specification.rb +833 -1115
- data/lib/rubygems/specification_policy.rb +538 -0
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA.pem +21 -0
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +21 -0
- data/lib/rubygems/stub_specification.rb +55 -57
- data/lib/rubygems/text.rb +39 -27
- data/lib/rubygems/timeout/LICENSE.txt +22 -0
- data/lib/rubygems/timeout/lib/timeout.rb +199 -0
- data/lib/rubygems/timeout.rb +3 -0
- data/lib/rubygems/tsort/.document +1 -0
- data/lib/rubygems/tsort/LICENSE.txt +22 -0
- data/lib/rubygems/tsort/lib/tsort.rb +455 -0
- data/lib/rubygems/tsort.rb +3 -0
- data/lib/rubygems/uninstaller.rb +150 -87
- data/lib/rubygems/unknown_command_spell_checker.rb +21 -0
- data/lib/rubygems/update_suggestion.rb +56 -0
- data/lib/rubygems/uri.rb +126 -0
- data/lib/rubygems/uri_formatter.rb +4 -7
- data/lib/rubygems/user_interaction.rb +92 -146
- data/lib/rubygems/util/licenses.rb +712 -317
- data/lib/rubygems/util/list.rb +5 -2
- data/lib/rubygems/util.rb +58 -75
- data/lib/rubygems/validator.rb +26 -48
- data/lib/rubygems/version.rb +106 -56
- data/lib/rubygems/version_option.rb +22 -14
- data/lib/rubygems/yaml_serializer.rb +93 -0
- data/lib/rubygems.rb +427 -361
- data/rubygems-update.gemspec +38 -0
- data/setup.rb +13 -27
- metadata +500 -363
- data/.autotest +0 -71
- data/.document +0 -5
- data/.travis.yml +0 -46
- data/CONTRIBUTING.rdoc +0 -129
- data/CVE-2013-4287.txt +0 -35
- data/CVE-2013-4363.txt +0 -45
- data/CVE-2015-3900.txt +0 -40
- data/History.txt +0 -3105
- data/MAINTAINERS.md +0 -5
- data/POLICIES.rdoc +0 -61
- data/README.rdoc +0 -54
- data/Rakefile +0 -449
- data/UPGRADING.rdoc +0 -92
- data/appveyor.yml +0 -36
- data/bin/gem +0 -25
- data/bin/update_rubygems +0 -37
- data/lib/gauntlet_rubygems.rb +0 -51
- data/lib/rubygems/indexer.rb +0 -434
- data/lib/rubygems/installer_test_case.rb +0 -194
- data/lib/rubygems/mock_gem_ui.rb +0 -89
- data/lib/rubygems/package/tar_test_case.rb +0 -147
- data/lib/rubygems/psych_additions.rb +0 -10
- data/lib/rubygems/server.rb +0 -869
- data/lib/rubygems/source_local.rb +0 -6
- data/lib/rubygems/source_specific_file.rb +0 -5
- data/lib/rubygems/ssl_certs/AddTrustExternalCARoot-2048.pem +0 -25
- data/lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem +0 -32
- data/lib/rubygems/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +0 -14
- data/lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/rubygems/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +0 -28
- data/lib/rubygems/ssl_certs/GeoTrustGlobalCA.pem +0 -20
- data/lib/rubygems/syck_hack.rb +0 -77
- data/lib/rubygems/test_case.rb +0 -1496
- data/lib/rubygems/test_utilities.rb +0 -384
- data/lib/ubygems.rb +0 -11
- data/test/rubygems/alternate_cert.pem +0 -18
- data/test/rubygems/alternate_cert_32.pem +0 -18
- data/test/rubygems/alternate_key.pem +0 -27
- data/test/rubygems/bad_rake.rb +0 -2
- data/test/rubygems/ca_cert.pem +0 -68
- data/test/rubygems/child_cert.pem +0 -18
- data/test/rubygems/child_cert_32.pem +0 -18
- data/test/rubygems/child_key.pem +0 -27
- data/test/rubygems/client.pem +0 -49
- data/test/rubygems/data/gem-private_key.pem +0 -27
- data/test/rubygems/data/gem-public_cert.pem +0 -20
- data/test/rubygems/data/null-type.gemspec.rz +0 -0
- data/test/rubygems/encrypted_private_key.pem +0 -30
- data/test/rubygems/expired_cert.pem +0 -18
- data/test/rubygems/fake_certlib/openssl.rb +0 -8
- data/test/rubygems/fix_openssl_warnings.rb +0 -13
- data/test/rubygems/foo/discover.rb +0 -1
- data/test/rubygems/future_cert.pem +0 -18
- data/test/rubygems/future_cert_32.pem +0 -18
- data/test/rubygems/good_rake.rb +0 -2
- data/test/rubygems/grandchild_cert.pem +0 -18
- data/test/rubygems/grandchild_cert_32.pem +0 -18
- data/test/rubygems/grandchild_key.pem +0 -27
- data/test/rubygems/invalid_client.pem +0 -49
- data/test/rubygems/invalid_issuer_cert.pem +0 -18
- data/test/rubygems/invalid_issuer_cert_32.pem +0 -18
- data/test/rubygems/invalid_key.pem +0 -27
- data/test/rubygems/invalid_signer_cert.pem +0 -18
- data/test/rubygems/invalid_signer_cert_32.pem +0 -18
- data/test/rubygems/invalidchild_cert.pem +0 -18
- data/test/rubygems/invalidchild_cert_32.pem +0 -18
- data/test/rubygems/invalidchild_key.pem +0 -27
- data/test/rubygems/plugin/exception/rubygems_plugin.rb +0 -3
- data/test/rubygems/plugin/load/rubygems_plugin.rb +0 -4
- data/test/rubygems/plugin/standarderror/rubygems_plugin.rb +0 -3
- data/test/rubygems/private_key.pem +0 -27
- data/test/rubygems/public_cert.pem +0 -18
- data/test/rubygems/public_cert_32.pem +0 -18
- data/test/rubygems/public_key.pem +0 -9
- data/test/rubygems/rubygems/commands/crash_command.rb +0 -6
- data/test/rubygems/rubygems_plugin.rb +0 -22
- data/test/rubygems/sff/discover.rb +0 -1
- data/test/rubygems/simple_gem.rb +0 -67
- data/test/rubygems/specifications/bar-0.0.2.gemspec +0 -9
- data/test/rubygems/specifications/foo-0.0.1-x86-mswin32.gemspec +0 -0
- data/test/rubygems/ssl_cert.pem +0 -19
- data/test/rubygems/ssl_key.pem +0 -15
- data/test/rubygems/test_bundled_ca.rb +0 -59
- data/test/rubygems/test_config.rb +0 -24
- data/test/rubygems/test_deprecate.rb +0 -77
- data/test/rubygems/test_gem.rb +0 -1718
- data/test/rubygems/test_gem_available_set.rb +0 -130
- data/test/rubygems/test_gem_command.rb +0 -248
- data/test/rubygems/test_gem_command_manager.rb +0 -264
- data/test/rubygems/test_gem_commands_build_command.rb +0 -121
- data/test/rubygems/test_gem_commands_cert_command.rb +0 -671
- data/test/rubygems/test_gem_commands_check_command.rb +0 -69
- data/test/rubygems/test_gem_commands_cleanup_command.rb +0 -197
- data/test/rubygems/test_gem_commands_contents_command.rb +0 -240
- data/test/rubygems/test_gem_commands_dependency_command.rb +0 -230
- data/test/rubygems/test_gem_commands_environment_command.rb +0 -154
- data/test/rubygems/test_gem_commands_fetch_command.rb +0 -127
- data/test/rubygems/test_gem_commands_generate_index_command.rb +0 -51
- data/test/rubygems/test_gem_commands_help_command.rb +0 -75
- data/test/rubygems/test_gem_commands_install_command.rb +0 -1007
- data/test/rubygems/test_gem_commands_list_command.rb +0 -34
- data/test/rubygems/test_gem_commands_lock_command.rb +0 -69
- data/test/rubygems/test_gem_commands_mirror.rb +0 -20
- data/test/rubygems/test_gem_commands_open_command.rb +0 -70
- data/test/rubygems/test_gem_commands_outdated_command.rb +0 -33
- data/test/rubygems/test_gem_commands_owner_command.rb +0 -205
- data/test/rubygems/test_gem_commands_pristine_command.rb +0 -491
- data/test/rubygems/test_gem_commands_push_command.rb +0 -330
- data/test/rubygems/test_gem_commands_query_command.rb +0 -657
- data/test/rubygems/test_gem_commands_search_command.rb +0 -18
- data/test/rubygems/test_gem_commands_server_command.rb +0 -60
- data/test/rubygems/test_gem_commands_setup_command.rb +0 -136
- data/test/rubygems/test_gem_commands_sources_command.rb +0 -249
- data/test/rubygems/test_gem_commands_specification_command.rb +0 -251
- data/test/rubygems/test_gem_commands_stale_command.rb +0 -43
- data/test/rubygems/test_gem_commands_uninstall_command.rb +0 -283
- data/test/rubygems/test_gem_commands_unpack_command.rb +0 -209
- data/test/rubygems/test_gem_commands_update_command.rb +0 -514
- data/test/rubygems/test_gem_commands_which_command.rb +0 -87
- data/test/rubygems/test_gem_commands_yank_command.rb +0 -100
- data/test/rubygems/test_gem_config_file.rb +0 -491
- data/test/rubygems/test_gem_dependency.rb +0 -362
- data/test/rubygems/test_gem_dependency_installer.rb +0 -1235
- data/test/rubygems/test_gem_dependency_list.rb +0 -260
- data/test/rubygems/test_gem_dependency_resolution_error.rb +0 -29
- data/test/rubygems/test_gem_doctor.rb +0 -169
- data/test/rubygems/test_gem_ext_builder.rb +0 -341
- data/test/rubygems/test_gem_ext_cmake_builder.rb +0 -87
- data/test/rubygems/test_gem_ext_configure_builder.rb +0 -87
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +0 -211
- data/test/rubygems/test_gem_ext_rake_builder.rb +0 -65
- data/test/rubygems/test_gem_gem_runner.rb +0 -69
- data/test/rubygems/test_gem_gemcutter_utilities.rb +0 -235
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +0 -62
- data/test/rubygems/test_gem_indexer.rb +0 -367
- data/test/rubygems/test_gem_install_update_options.rb +0 -197
- data/test/rubygems/test_gem_installer.rb +0 -1552
- data/test/rubygems/test_gem_local_remote_options.rb +0 -134
- data/test/rubygems/test_gem_name_tuple.rb +0 -45
- data/test/rubygems/test_gem_package.rb +0 -876
- data/test/rubygems/test_gem_package_old.rb +0 -90
- data/test/rubygems/test_gem_package_tar_header.rb +0 -147
- data/test/rubygems/test_gem_package_tar_reader.rb +0 -90
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +0 -142
- data/test/rubygems/test_gem_package_tar_writer.rb +0 -264
- data/test/rubygems/test_gem_package_task.rb +0 -84
- data/test/rubygems/test_gem_path_support.rb +0 -121
- data/test/rubygems/test_gem_platform.rb +0 -308
- data/test/rubygems/test_gem_rdoc.rb +0 -270
- data/test/rubygems/test_gem_remote_fetcher.rb +0 -1051
- data/test/rubygems/test_gem_request.rb +0 -363
- data/test/rubygems/test_gem_request_connection_pools.rb +0 -130
- data/test/rubygems/test_gem_request_set.rb +0 -595
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +0 -831
- data/test/rubygems/test_gem_request_set_lockfile.rb +0 -470
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +0 -549
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +0 -306
- data/test/rubygems/test_gem_requirement.rb +0 -387
- data/test/rubygems/test_gem_resolver.rb +0 -715
- data/test/rubygems/test_gem_resolver_activation_request.rb +0 -74
- data/test/rubygems/test_gem_resolver_api_set.rb +0 -209
- data/test/rubygems/test_gem_resolver_api_specification.rb +0 -145
- data/test/rubygems/test_gem_resolver_best_set.rb +0 -138
- data/test/rubygems/test_gem_resolver_composed_set.rb +0 -46
- data/test/rubygems/test_gem_resolver_conflict.rb +0 -88
- data/test/rubygems/test_gem_resolver_dependency_request.rb +0 -85
- data/test/rubygems/test_gem_resolver_git_set.rb +0 -190
- data/test/rubygems/test_gem_resolver_git_specification.rb +0 -114
- data/test/rubygems/test_gem_resolver_index_set.rb +0 -90
- data/test/rubygems/test_gem_resolver_index_specification.rb +0 -90
- data/test/rubygems/test_gem_resolver_installed_specification.rb +0 -50
- data/test/rubygems/test_gem_resolver_installer_set.rb +0 -258
- data/test/rubygems/test_gem_resolver_local_specification.rb +0 -46
- data/test/rubygems/test_gem_resolver_lock_set.rb +0 -64
- data/test/rubygems/test_gem_resolver_lock_specification.rb +0 -100
- data/test/rubygems/test_gem_resolver_requirement_list.rb +0 -21
- data/test/rubygems/test_gem_resolver_specification.rb +0 -65
- data/test/rubygems/test_gem_resolver_vendor_set.rb +0 -84
- data/test/rubygems/test_gem_resolver_vendor_specification.rb +0 -84
- data/test/rubygems/test_gem_security.rb +0 -307
- data/test/rubygems/test_gem_security_policy.rb +0 -541
- data/test/rubygems/test_gem_security_signer.rb +0 -209
- data/test/rubygems/test_gem_security_trust_dir.rb +0 -101
- data/test/rubygems/test_gem_server.rb +0 -409
- data/test/rubygems/test_gem_silent_ui.rb +0 -117
- data/test/rubygems/test_gem_source.rb +0 -242
- data/test/rubygems/test_gem_source_fetch_problem.rb +0 -20
- data/test/rubygems/test_gem_source_git.rb +0 -309
- data/test/rubygems/test_gem_source_installed.rb +0 -37
- data/test/rubygems/test_gem_source_list.rb +0 -118
- data/test/rubygems/test_gem_source_local.rb +0 -107
- data/test/rubygems/test_gem_source_lock.rb +0 -115
- data/test/rubygems/test_gem_source_specific_file.rb +0 -76
- data/test/rubygems/test_gem_source_vendor.rb +0 -32
- data/test/rubygems/test_gem_spec_fetcher.rb +0 -311
- data/test/rubygems/test_gem_specification.rb +0 -3519
- data/test/rubygems/test_gem_stream_ui.rb +0 -239
- data/test/rubygems/test_gem_stub_specification.rb +0 -217
- data/test/rubygems/test_gem_text.rb +0 -77
- data/test/rubygems/test_gem_uninstaller.rb +0 -485
- data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +0 -33
- data/test/rubygems/test_gem_uri_formatter.rb +0 -29
- data/test/rubygems/test_gem_util.rb +0 -40
- data/test/rubygems/test_gem_validator.rb +0 -46
- data/test/rubygems/test_gem_version.rb +0 -222
- data/test/rubygems/test_gem_version_option.rb +0 -152
- data/test/rubygems/test_kernel.rb +0 -86
- data/test/rubygems/test_require.rb +0 -322
- data/test/rubygems/wrong_key_cert.pem +0 -18
- data/test/rubygems/wrong_key_cert_32.pem +0 -18
- data/util/CL2notes +0 -56
- data/util/create_certs.rb +0 -157
- data/util/create_encrypted_key.rb +0 -17
- data/util/generate_spdx_license_list.rb +0 -51
- data/util/update_bundled_ca_certificates.rb +0 -118
@@ -1,1552 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require 'rubygems/installer_test_case'
|
3
|
-
|
4
|
-
class TestGemInstaller < Gem::InstallerTestCase
|
5
|
-
|
6
|
-
def setup
|
7
|
-
super
|
8
|
-
common_installer_setup
|
9
|
-
|
10
|
-
if __name__ =~ /^test_install(_|$)/ then
|
11
|
-
FileUtils.rm_r @spec.gem_dir
|
12
|
-
FileUtils.rm_r @user_spec.gem_dir
|
13
|
-
end
|
14
|
-
|
15
|
-
@config = Gem.configuration
|
16
|
-
end
|
17
|
-
|
18
|
-
def teardown
|
19
|
-
common_installer_teardown
|
20
|
-
|
21
|
-
super
|
22
|
-
|
23
|
-
Gem.configuration = @config
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_app_script_text
|
27
|
-
util_make_exec @spec, ''
|
28
|
-
|
29
|
-
expected = <<-EOF
|
30
|
-
#!#{Gem.ruby}
|
31
|
-
#
|
32
|
-
# This file was generated by RubyGems.
|
33
|
-
#
|
34
|
-
# The application 'a' is installed as part of a gem, and
|
35
|
-
# this file is here to facilitate running it.
|
36
|
-
#
|
37
|
-
|
38
|
-
require 'rubygems'
|
39
|
-
|
40
|
-
version = \">= 0.a\"
|
41
|
-
|
42
|
-
if ARGV.first
|
43
|
-
str = ARGV.first
|
44
|
-
str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
|
45
|
-
if str =~ /\\A_(.*)_\\z/ and Gem::Version.correct?($1) then
|
46
|
-
version = $1
|
47
|
-
ARGV.shift
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
load Gem.bin_path('a', 'executable', version)
|
52
|
-
EOF
|
53
|
-
|
54
|
-
wrapper = @installer.app_script_text 'executable'
|
55
|
-
assert_equal expected, wrapper
|
56
|
-
end
|
57
|
-
|
58
|
-
def test_check_executable_overwrite
|
59
|
-
@installer.generate_bin
|
60
|
-
|
61
|
-
@spec = Gem::Specification.new do |s|
|
62
|
-
s.files = ['lib/code.rb']
|
63
|
-
s.name = "a"
|
64
|
-
s.version = "3"
|
65
|
-
s.summary = "summary"
|
66
|
-
s.description = "desc"
|
67
|
-
s.require_path = 'lib'
|
68
|
-
end
|
69
|
-
|
70
|
-
util_make_exec
|
71
|
-
@installer.gem_dir = util_gem_dir @spec
|
72
|
-
@installer.wrappers = true
|
73
|
-
@installer.generate_bin
|
74
|
-
|
75
|
-
installed_exec = File.join util_inst_bindir, 'executable'
|
76
|
-
assert_path_exists installed_exec
|
77
|
-
|
78
|
-
wrapper = File.read installed_exec
|
79
|
-
assert_match %r|generated by RubyGems|, wrapper
|
80
|
-
end
|
81
|
-
|
82
|
-
def test_check_executable_overwrite_default_bin_dir
|
83
|
-
if defined?(RUBY_FRAMEWORK_VERSION)
|
84
|
-
orig_RUBY_FRAMEWORK_VERSION = RUBY_FRAMEWORK_VERSION
|
85
|
-
Object.send :remove_const, :RUBY_FRAMEWORK_VERSION
|
86
|
-
end
|
87
|
-
orig_bindir = RbConfig::CONFIG['bindir']
|
88
|
-
RbConfig::CONFIG['bindir'] = Gem.bindir
|
89
|
-
|
90
|
-
util_conflict_executable false
|
91
|
-
|
92
|
-
ui = Gem::MockGemUi.new "n\n"
|
93
|
-
use_ui ui do
|
94
|
-
e = assert_raises Gem::InstallError do
|
95
|
-
@installer.generate_bin
|
96
|
-
end
|
97
|
-
|
98
|
-
conflicted = File.join @gemhome, 'bin', 'executable'
|
99
|
-
assert_match %r%\A"executable" from a conflicts with (?:#{Regexp.quote(conflicted)}|installed executable from conflict)\z%,
|
100
|
-
e.message
|
101
|
-
end
|
102
|
-
ensure
|
103
|
-
Object.const_set :RUBY_FRAMEWORK_VERSION, orig_RUBY_FRAMEWORK_VERSION if
|
104
|
-
orig_RUBY_FRAMEWORK_VERSION
|
105
|
-
if orig_bindir then
|
106
|
-
RbConfig::CONFIG['bindir'] = orig_bindir
|
107
|
-
else
|
108
|
-
RbConfig::CONFIG.delete 'bindir'
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
def test_check_executable_overwrite_format_executable
|
113
|
-
@installer.generate_bin
|
114
|
-
|
115
|
-
@spec = Gem::Specification.new do |s|
|
116
|
-
s.files = ['lib/code.rb']
|
117
|
-
s.name = "a"
|
118
|
-
s.version = "3"
|
119
|
-
s.summary = "summary"
|
120
|
-
s.description = "desc"
|
121
|
-
s.require_path = 'lib'
|
122
|
-
end
|
123
|
-
|
124
|
-
open File.join(util_inst_bindir, 'executable'), 'w' do |io|
|
125
|
-
io.write <<-EXEC
|
126
|
-
#!/usr/local/bin/ruby
|
127
|
-
#
|
128
|
-
# This file was generated by RubyGems
|
129
|
-
|
130
|
-
gem 'other', version
|
131
|
-
EXEC
|
132
|
-
end
|
133
|
-
|
134
|
-
util_make_exec
|
135
|
-
Gem::Installer.exec_format = 'foo-%s-bar'
|
136
|
-
@installer.gem_dir = @spec.gem_dir
|
137
|
-
@installer.wrappers = true
|
138
|
-
@installer.format_executable = true
|
139
|
-
|
140
|
-
@installer.generate_bin # should not raise
|
141
|
-
|
142
|
-
installed_exec = File.join util_inst_bindir, 'foo-executable-bar'
|
143
|
-
assert_path_exists installed_exec
|
144
|
-
|
145
|
-
wrapper = File.read installed_exec
|
146
|
-
assert_match %r|generated by RubyGems|, wrapper
|
147
|
-
end
|
148
|
-
|
149
|
-
def test_check_executable_overwrite_other_gem
|
150
|
-
util_conflict_executable true
|
151
|
-
|
152
|
-
ui = Gem::MockGemUi.new "n\n"
|
153
|
-
|
154
|
-
use_ui ui do
|
155
|
-
e = assert_raises Gem::InstallError do
|
156
|
-
@installer.generate_bin
|
157
|
-
end
|
158
|
-
|
159
|
-
assert_equal '"executable" from a conflicts with installed executable from conflict',
|
160
|
-
e.message
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
def test_check_executable_overwrite_other_gem_force
|
165
|
-
util_conflict_executable true
|
166
|
-
@installer.wrappers = true
|
167
|
-
@installer.force = true
|
168
|
-
|
169
|
-
@installer.generate_bin
|
170
|
-
|
171
|
-
installed_exec = File.join util_inst_bindir, 'executable'
|
172
|
-
assert_path_exists installed_exec
|
173
|
-
|
174
|
-
wrapper = File.read installed_exec
|
175
|
-
assert_match %r|generated by RubyGems|, wrapper
|
176
|
-
end
|
177
|
-
|
178
|
-
def test_check_executable_overwrite_other_non_gem
|
179
|
-
util_conflict_executable false
|
180
|
-
@installer.wrappers = true
|
181
|
-
|
182
|
-
@installer.generate_bin
|
183
|
-
|
184
|
-
installed_exec = File.join util_inst_bindir, 'executable'
|
185
|
-
assert_path_exists installed_exec
|
186
|
-
|
187
|
-
wrapper = File.read installed_exec
|
188
|
-
assert_match %r|generated by RubyGems|, wrapper
|
189
|
-
end unless Gem.win_platform?
|
190
|
-
|
191
|
-
def test_check_that_user_bin_dir_is_in_path
|
192
|
-
bin_dir = @installer.bin_dir
|
193
|
-
|
194
|
-
if Gem.win_platform?
|
195
|
-
bin_dir = bin_dir.downcase.gsub(File::SEPARATOR, File::ALT_SEPARATOR)
|
196
|
-
end
|
197
|
-
|
198
|
-
orig_PATH, ENV['PATH'] =
|
199
|
-
ENV['PATH'], [ENV['PATH'], bin_dir].join(File::PATH_SEPARATOR)
|
200
|
-
|
201
|
-
use_ui @ui do
|
202
|
-
@installer.check_that_user_bin_dir_is_in_path
|
203
|
-
end
|
204
|
-
|
205
|
-
assert_empty @ui.error
|
206
|
-
ensure
|
207
|
-
ENV['PATH'] = orig_PATH
|
208
|
-
end
|
209
|
-
|
210
|
-
def test_check_that_user_bin_dir_is_in_path_tilde
|
211
|
-
skip "Tilde is PATH is not supported under MS Windows" if win_platform?
|
212
|
-
|
213
|
-
orig_PATH, ENV['PATH'] =
|
214
|
-
ENV['PATH'], [ENV['PATH'], '~/bin'].join(File::PATH_SEPARATOR)
|
215
|
-
|
216
|
-
@installer.bin_dir.replace File.join @userhome, 'bin'
|
217
|
-
|
218
|
-
use_ui @ui do
|
219
|
-
@installer.check_that_user_bin_dir_is_in_path
|
220
|
-
end
|
221
|
-
|
222
|
-
assert_empty @ui.error
|
223
|
-
ensure
|
224
|
-
ENV['PATH'] = orig_PATH unless win_platform?
|
225
|
-
end
|
226
|
-
|
227
|
-
def test_check_that_user_bin_dir_is_in_path_not_in_path
|
228
|
-
use_ui @ui do
|
229
|
-
@installer.check_that_user_bin_dir_is_in_path
|
230
|
-
end
|
231
|
-
|
232
|
-
expected = @installer.bin_dir
|
233
|
-
|
234
|
-
if Gem.win_platform? then
|
235
|
-
expected = expected.downcase.gsub(File::SEPARATOR, File::ALT_SEPARATOR)
|
236
|
-
end
|
237
|
-
|
238
|
-
assert_match expected, @ui.error
|
239
|
-
end
|
240
|
-
|
241
|
-
def test_ensure_dependency
|
242
|
-
util_spec 'a'
|
243
|
-
|
244
|
-
dep = Gem::Dependency.new 'a', '>= 2'
|
245
|
-
assert @installer.ensure_dependency(@spec, dep)
|
246
|
-
|
247
|
-
dep = Gem::Dependency.new 'b', '> 2'
|
248
|
-
e = assert_raises Gem::InstallError do
|
249
|
-
@installer.ensure_dependency @spec, dep
|
250
|
-
end
|
251
|
-
|
252
|
-
assert_equal 'a requires b (> 2)', e.message
|
253
|
-
end
|
254
|
-
|
255
|
-
def test_ensure_loadable_spec
|
256
|
-
a, a_gem = util_gem 'a', 2 do |s|
|
257
|
-
s.add_dependency 'garbage ~> 5'
|
258
|
-
end
|
259
|
-
|
260
|
-
installer = Gem::Installer.at a_gem
|
261
|
-
|
262
|
-
e = assert_raises Gem::InstallError do
|
263
|
-
installer.ensure_loadable_spec
|
264
|
-
end
|
265
|
-
|
266
|
-
assert_equal "The specification for #{a.full_name} is corrupt " +
|
267
|
-
"(SyntaxError)", e.message
|
268
|
-
end
|
269
|
-
|
270
|
-
def test_ensure_loadable_spec_security_policy
|
271
|
-
skip 'openssl is missing' unless defined?(OpenSSL::SSL)
|
272
|
-
|
273
|
-
_, a_gem = util_gem 'a', 2 do |s|
|
274
|
-
s.add_dependency 'garbage ~> 5'
|
275
|
-
end
|
276
|
-
|
277
|
-
policy = Gem::Security::HighSecurity
|
278
|
-
installer = Gem::Installer.at a_gem, :security_policy => policy
|
279
|
-
|
280
|
-
assert_raises Gem::Security::Exception do
|
281
|
-
installer.ensure_loadable_spec
|
282
|
-
end
|
283
|
-
end
|
284
|
-
|
285
|
-
def test_extract_files
|
286
|
-
@installer.extract_files
|
287
|
-
|
288
|
-
assert_path_exists File.join util_gem_dir, 'bin/executable'
|
289
|
-
end
|
290
|
-
|
291
|
-
def test_generate_bin_bindir
|
292
|
-
@installer.wrappers = true
|
293
|
-
|
294
|
-
@spec.executables = %w[executable]
|
295
|
-
@spec.bindir = '.'
|
296
|
-
|
297
|
-
exec_file = @installer.formatted_program_filename 'executable'
|
298
|
-
exec_path = File.join util_gem_dir(@spec), exec_file
|
299
|
-
File.open exec_path, 'w' do |f|
|
300
|
-
f.puts '#!/usr/bin/ruby'
|
301
|
-
end
|
302
|
-
|
303
|
-
@installer.gem_dir = util_gem_dir
|
304
|
-
|
305
|
-
@installer.generate_bin
|
306
|
-
|
307
|
-
assert_equal true, File.directory?(util_inst_bindir)
|
308
|
-
installed_exec = File.join(util_inst_bindir, 'executable')
|
309
|
-
assert_path_exists installed_exec
|
310
|
-
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
|
311
|
-
|
312
|
-
wrapper = File.read installed_exec
|
313
|
-
assert_match %r|generated by RubyGems|, wrapper
|
314
|
-
end
|
315
|
-
|
316
|
-
def test_generate_bin_bindir_with_user_install_warning
|
317
|
-
bin_dir = Gem.win_platform? ? File.expand_path(ENV["WINDIR"]).upcase :
|
318
|
-
"/usr/bin"
|
319
|
-
|
320
|
-
options = {
|
321
|
-
:bin_dir => bin_dir,
|
322
|
-
:install_dir => "/non/existent"
|
323
|
-
}
|
324
|
-
|
325
|
-
inst = Gem::Installer.at '', options
|
326
|
-
|
327
|
-
Gem::Installer.path_warning = false
|
328
|
-
|
329
|
-
use_ui @ui do
|
330
|
-
inst.check_that_user_bin_dir_is_in_path
|
331
|
-
end
|
332
|
-
|
333
|
-
assert_equal "", @ui.error
|
334
|
-
end
|
335
|
-
|
336
|
-
def test_generate_bin_script
|
337
|
-
@installer.wrappers = true
|
338
|
-
util_make_exec
|
339
|
-
@installer.gem_dir = util_gem_dir
|
340
|
-
|
341
|
-
@installer.generate_bin
|
342
|
-
assert File.directory? util_inst_bindir
|
343
|
-
installed_exec = File.join util_inst_bindir, 'executable'
|
344
|
-
assert_path_exists installed_exec
|
345
|
-
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
|
346
|
-
|
347
|
-
wrapper = File.read installed_exec
|
348
|
-
assert_match %r|generated by RubyGems|, wrapper
|
349
|
-
end
|
350
|
-
|
351
|
-
def test_generate_bin_script_format
|
352
|
-
@installer.format_executable = true
|
353
|
-
@installer.wrappers = true
|
354
|
-
util_make_exec
|
355
|
-
@installer.gem_dir = util_gem_dir
|
356
|
-
|
357
|
-
Gem::Installer.exec_format = 'foo-%s-bar'
|
358
|
-
@installer.generate_bin
|
359
|
-
assert_equal true, File.directory?(util_inst_bindir)
|
360
|
-
installed_exec = File.join util_inst_bindir, 'foo-executable-bar'
|
361
|
-
assert_path_exists installed_exec
|
362
|
-
ensure
|
363
|
-
Gem::Installer.exec_format = nil
|
364
|
-
end
|
365
|
-
|
366
|
-
def test_generate_bin_script_format_disabled
|
367
|
-
@installer.wrappers = true
|
368
|
-
util_make_exec
|
369
|
-
@installer.gem_dir = util_gem_dir
|
370
|
-
|
371
|
-
Gem::Installer.exec_format = 'foo-%s-bar'
|
372
|
-
@installer.generate_bin
|
373
|
-
assert_equal true, File.directory?(util_inst_bindir)
|
374
|
-
installed_exec = File.join util_inst_bindir, 'executable'
|
375
|
-
assert_path_exists installed_exec
|
376
|
-
ensure
|
377
|
-
Gem::Installer.exec_format = nil
|
378
|
-
end
|
379
|
-
|
380
|
-
def test_generate_bin_script_install_dir
|
381
|
-
@installer.wrappers = true
|
382
|
-
|
383
|
-
gem_dir = File.join("#{@gemhome}2", "gems", @spec.full_name)
|
384
|
-
gem_bindir = File.join gem_dir, 'bin'
|
385
|
-
FileUtils.mkdir_p gem_bindir
|
386
|
-
File.open File.join(gem_bindir, 'executable'), 'w' do |f|
|
387
|
-
f.puts "#!/bin/ruby"
|
388
|
-
end
|
389
|
-
|
390
|
-
@installer.gem_home = "#{@gemhome}2"
|
391
|
-
@installer.gem_dir = gem_dir
|
392
|
-
@installer.bin_dir = File.join "#{@gemhome}2", 'bin'
|
393
|
-
|
394
|
-
@installer.generate_bin
|
395
|
-
|
396
|
-
installed_exec = File.join("#{@gemhome}2", "bin", 'executable')
|
397
|
-
assert_path_exists installed_exec
|
398
|
-
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
|
399
|
-
|
400
|
-
wrapper = File.read installed_exec
|
401
|
-
assert_match %r|generated by RubyGems|, wrapper
|
402
|
-
end
|
403
|
-
|
404
|
-
def test_generate_bin_script_no_execs
|
405
|
-
util_execless
|
406
|
-
|
407
|
-
@installer.wrappers = true
|
408
|
-
@installer.generate_bin
|
409
|
-
|
410
|
-
refute_path_exists util_inst_bindir, 'bin dir was created when not needed'
|
411
|
-
end
|
412
|
-
|
413
|
-
def test_generate_bin_script_no_perms
|
414
|
-
@installer.wrappers = true
|
415
|
-
util_make_exec
|
416
|
-
|
417
|
-
Dir.mkdir util_inst_bindir
|
418
|
-
|
419
|
-
if win_platform?
|
420
|
-
skip('test_generate_bin_script_no_perms skipped on MS Windows')
|
421
|
-
else
|
422
|
-
FileUtils.chmod 0000, util_inst_bindir
|
423
|
-
|
424
|
-
assert_raises Gem::FilePermissionError do
|
425
|
-
@installer.generate_bin
|
426
|
-
end
|
427
|
-
end
|
428
|
-
ensure
|
429
|
-
FileUtils.chmod 0755, util_inst_bindir unless ($DEBUG or win_platform?)
|
430
|
-
end
|
431
|
-
|
432
|
-
def test_generate_bin_script_no_shebang
|
433
|
-
@installer.wrappers = true
|
434
|
-
@spec.executables = %w[executable]
|
435
|
-
|
436
|
-
gem_dir = File.join @gemhome, 'gems', @spec.full_name
|
437
|
-
gem_bindir = File.join gem_dir, 'bin'
|
438
|
-
FileUtils.mkdir_p gem_bindir
|
439
|
-
File.open File.join(gem_bindir, 'executable'), 'w' do |f|
|
440
|
-
f.puts "blah blah blah"
|
441
|
-
end
|
442
|
-
|
443
|
-
@installer.generate_bin
|
444
|
-
|
445
|
-
installed_exec = File.join @gemhome, 'bin', 'executable'
|
446
|
-
assert_path_exists installed_exec
|
447
|
-
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
|
448
|
-
|
449
|
-
wrapper = File.read installed_exec
|
450
|
-
assert_match %r|generated by RubyGems|, wrapper
|
451
|
-
# HACK some gems don't have #! in their executables, restore 2008/06
|
452
|
-
#assert_no_match %r|generated by RubyGems|, wrapper
|
453
|
-
end
|
454
|
-
|
455
|
-
def test_generate_bin_script_wrappers
|
456
|
-
@installer.wrappers = true
|
457
|
-
util_make_exec
|
458
|
-
@installer.gem_dir = util_gem_dir
|
459
|
-
installed_exec = File.join(util_inst_bindir, 'executable')
|
460
|
-
|
461
|
-
real_exec = File.join util_gem_dir, 'bin', 'executable'
|
462
|
-
|
463
|
-
# fake --no-wrappers for previous install
|
464
|
-
unless Gem.win_platform? then
|
465
|
-
FileUtils.mkdir_p File.dirname(installed_exec)
|
466
|
-
FileUtils.ln_s real_exec, installed_exec
|
467
|
-
end
|
468
|
-
|
469
|
-
@installer.generate_bin
|
470
|
-
assert_equal true, File.directory?(util_inst_bindir)
|
471
|
-
assert_path_exists installed_exec
|
472
|
-
assert_equal mask, File.stat(installed_exec).mode unless win_platform?
|
473
|
-
|
474
|
-
assert_match %r|generated by RubyGems|, File.read(installed_exec)
|
475
|
-
|
476
|
-
refute_match %r|generated by RubyGems|, File.read(real_exec),
|
477
|
-
'real executable overwritten'
|
478
|
-
end
|
479
|
-
|
480
|
-
def test_generate_bin_symlink
|
481
|
-
return if win_platform? #Windows FS do not support symlinks
|
482
|
-
|
483
|
-
@installer.wrappers = false
|
484
|
-
util_make_exec
|
485
|
-
@installer.gem_dir = util_gem_dir
|
486
|
-
|
487
|
-
@installer.generate_bin
|
488
|
-
assert_equal true, File.directory?(util_inst_bindir)
|
489
|
-
installed_exec = File.join util_inst_bindir, 'executable'
|
490
|
-
assert_equal true, File.symlink?(installed_exec)
|
491
|
-
assert_equal(File.join(util_gem_dir, 'bin', 'executable'),
|
492
|
-
File.readlink(installed_exec))
|
493
|
-
end
|
494
|
-
|
495
|
-
def test_generate_bin_symlink_no_execs
|
496
|
-
util_execless
|
497
|
-
|
498
|
-
@installer.wrappers = false
|
499
|
-
@installer.generate_bin
|
500
|
-
|
501
|
-
refute_path_exists util_inst_bindir
|
502
|
-
end
|
503
|
-
|
504
|
-
def test_generate_bin_symlink_no_perms
|
505
|
-
@installer.wrappers = false
|
506
|
-
util_make_exec
|
507
|
-
@installer.gem_dir = util_gem_dir
|
508
|
-
|
509
|
-
Dir.mkdir util_inst_bindir
|
510
|
-
|
511
|
-
if win_platform?
|
512
|
-
skip('test_generate_bin_symlink_no_perms skipped on MS Windows')
|
513
|
-
else
|
514
|
-
FileUtils.chmod 0000, util_inst_bindir
|
515
|
-
|
516
|
-
assert_raises Gem::FilePermissionError do
|
517
|
-
@installer.generate_bin
|
518
|
-
end
|
519
|
-
end
|
520
|
-
ensure
|
521
|
-
FileUtils.chmod 0755, util_inst_bindir unless ($DEBUG or win_platform?)
|
522
|
-
end
|
523
|
-
|
524
|
-
def test_generate_bin_symlink_update_newer
|
525
|
-
return if win_platform? #Windows FS do not support symlinks
|
526
|
-
|
527
|
-
@installer.wrappers = false
|
528
|
-
util_make_exec
|
529
|
-
@installer.gem_dir = util_gem_dir
|
530
|
-
|
531
|
-
@installer.generate_bin
|
532
|
-
installed_exec = File.join(util_inst_bindir, 'executable')
|
533
|
-
assert_equal(File.join(util_gem_dir, 'bin', 'executable'),
|
534
|
-
File.readlink(installed_exec))
|
535
|
-
|
536
|
-
@spec = Gem::Specification.new do |s|
|
537
|
-
s.files = ['lib/code.rb']
|
538
|
-
s.name = "a"
|
539
|
-
s.version = "3"
|
540
|
-
s.summary = "summary"
|
541
|
-
s.description = "desc"
|
542
|
-
s.require_path = 'lib'
|
543
|
-
end
|
544
|
-
|
545
|
-
util_make_exec
|
546
|
-
@installer.gem_dir = util_gem_dir @spec
|
547
|
-
@installer.generate_bin
|
548
|
-
installed_exec = File.join(util_inst_bindir, 'executable')
|
549
|
-
assert_equal(@spec.bin_file('executable'),
|
550
|
-
File.readlink(installed_exec),
|
551
|
-
"Ensure symlink moved to latest version")
|
552
|
-
end
|
553
|
-
|
554
|
-
def test_generate_bin_symlink_update_older
|
555
|
-
return if win_platform? #Windows FS do not support symlinks
|
556
|
-
|
557
|
-
@installer.wrappers = false
|
558
|
-
util_make_exec
|
559
|
-
@installer.gem_dir = util_gem_dir
|
560
|
-
|
561
|
-
@installer.generate_bin
|
562
|
-
installed_exec = File.join(util_inst_bindir, 'executable')
|
563
|
-
assert_equal(File.join(util_gem_dir, 'bin', 'executable'),
|
564
|
-
File.readlink(installed_exec))
|
565
|
-
|
566
|
-
spec = Gem::Specification.new do |s|
|
567
|
-
s.files = ['lib/code.rb']
|
568
|
-
s.name = "a"
|
569
|
-
s.version = "1"
|
570
|
-
s.summary = "summary"
|
571
|
-
s.description = "desc"
|
572
|
-
s.require_path = 'lib'
|
573
|
-
end
|
574
|
-
|
575
|
-
util_make_exec
|
576
|
-
one = @spec.dup
|
577
|
-
one.version = 1
|
578
|
-
@installer = Gem::Installer.for_spec spec
|
579
|
-
@installer.gem_dir = util_gem_dir one
|
580
|
-
|
581
|
-
@installer.generate_bin
|
582
|
-
|
583
|
-
installed_exec = File.join util_inst_bindir, 'executable'
|
584
|
-
expected = File.join util_gem_dir, 'bin', 'executable'
|
585
|
-
assert_equal(expected,
|
586
|
-
File.readlink(installed_exec),
|
587
|
-
"Ensure symlink not moved")
|
588
|
-
end
|
589
|
-
|
590
|
-
def test_generate_bin_symlink_update_remove_wrapper
|
591
|
-
return if win_platform? #Windows FS do not support symlinks
|
592
|
-
|
593
|
-
@installer.wrappers = true
|
594
|
-
util_make_exec
|
595
|
-
@installer.gem_dir = util_gem_dir
|
596
|
-
|
597
|
-
@installer.generate_bin
|
598
|
-
|
599
|
-
installed_exec = File.join util_inst_bindir, 'executable'
|
600
|
-
assert_path_exists installed_exec
|
601
|
-
|
602
|
-
@spec = Gem::Specification.new do |s|
|
603
|
-
s.files = ['lib/code.rb']
|
604
|
-
s.name = "a"
|
605
|
-
s.version = "3"
|
606
|
-
s.summary = "summary"
|
607
|
-
s.description = "desc"
|
608
|
-
s.require_path = 'lib'
|
609
|
-
end
|
610
|
-
util_make_exec
|
611
|
-
|
612
|
-
util_installer @spec, @gemhome
|
613
|
-
@installer.wrappers = false
|
614
|
-
@installer.gem_dir = util_gem_dir
|
615
|
-
|
616
|
-
@installer.generate_bin
|
617
|
-
|
618
|
-
installed_exec = File.join util_inst_bindir, 'executable'
|
619
|
-
assert_equal(@spec.bin_file('executable'),
|
620
|
-
File.readlink(installed_exec),
|
621
|
-
"Ensure symlink moved to latest version")
|
622
|
-
end
|
623
|
-
|
624
|
-
def test_generate_bin_symlink_win32
|
625
|
-
old_win_platform = Gem.win_platform?
|
626
|
-
Gem.win_platform = true
|
627
|
-
old_alt_separator = File::ALT_SEPARATOR
|
628
|
-
File.__send__(:remove_const, :ALT_SEPARATOR)
|
629
|
-
File.const_set(:ALT_SEPARATOR, '\\')
|
630
|
-
@installer.wrappers = false
|
631
|
-
util_make_exec
|
632
|
-
@installer.gem_dir = util_gem_dir
|
633
|
-
|
634
|
-
use_ui @ui do
|
635
|
-
@installer.generate_bin
|
636
|
-
end
|
637
|
-
|
638
|
-
assert_equal true, File.directory?(util_inst_bindir)
|
639
|
-
installed_exec = File.join(util_inst_bindir, 'executable')
|
640
|
-
assert_path_exists installed_exec
|
641
|
-
|
642
|
-
assert_match(/Unable to use symlinks on Windows, installing wrapper/i,
|
643
|
-
@ui.error)
|
644
|
-
|
645
|
-
wrapper = File.read installed_exec
|
646
|
-
assert_match(/generated by RubyGems/, wrapper)
|
647
|
-
ensure
|
648
|
-
File.__send__(:remove_const, :ALT_SEPARATOR)
|
649
|
-
File.const_set(:ALT_SEPARATOR, old_alt_separator)
|
650
|
-
Gem.win_platform = old_win_platform
|
651
|
-
end
|
652
|
-
|
653
|
-
def test_generate_bin_uses_default_shebang
|
654
|
-
return if win_platform? #Windows FS do not support symlinks
|
655
|
-
|
656
|
-
@installer.wrappers = true
|
657
|
-
util_make_exec
|
658
|
-
|
659
|
-
@installer.generate_bin
|
660
|
-
|
661
|
-
default_shebang = Gem.ruby
|
662
|
-
shebang_line = open("#{@gemhome}/bin/executable") { |f| f.readlines.first }
|
663
|
-
assert_match(/\A#!/, shebang_line)
|
664
|
-
assert_match(/#{default_shebang}/, shebang_line)
|
665
|
-
end
|
666
|
-
|
667
|
-
def test_initialize
|
668
|
-
spec = util_spec 'a' do |s| s.platform = Gem::Platform.new 'mswin32' end
|
669
|
-
gem = File.join @tempdir, spec.file_name
|
670
|
-
|
671
|
-
Dir.mkdir util_inst_bindir
|
672
|
-
util_build_gem spec
|
673
|
-
FileUtils.mv spec.cache_file, @tempdir
|
674
|
-
|
675
|
-
installer = Gem::Installer.at gem
|
676
|
-
|
677
|
-
assert_equal File.join(@gemhome, 'gems', spec.full_name), installer.gem_dir
|
678
|
-
assert_equal File.join(@gemhome, 'bin'), installer.bin_dir
|
679
|
-
end
|
680
|
-
|
681
|
-
def test_initialize_user_install
|
682
|
-
installer = Gem::Installer.at @gem, :user_install => true
|
683
|
-
|
684
|
-
assert_equal File.join(Gem.user_dir, 'gems', @spec.full_name),
|
685
|
-
installer.gem_dir
|
686
|
-
assert_equal Gem.bindir(Gem.user_dir), installer.bin_dir
|
687
|
-
end
|
688
|
-
|
689
|
-
def test_initialize_user_install_bin_dir
|
690
|
-
installer =
|
691
|
-
Gem::Installer.at @gem, :user_install => true, :bin_dir => @tempdir
|
692
|
-
|
693
|
-
assert_equal File.join(Gem.user_dir, 'gems', @spec.full_name),
|
694
|
-
installer.gem_dir
|
695
|
-
assert_equal @tempdir, installer.bin_dir
|
696
|
-
end
|
697
|
-
|
698
|
-
def test_install
|
699
|
-
Dir.mkdir util_inst_bindir
|
700
|
-
util_setup_gem
|
701
|
-
util_clear_gems
|
702
|
-
|
703
|
-
gemdir = File.join @gemhome, 'gems', @spec.full_name
|
704
|
-
cache_file = File.join @gemhome, 'cache', @spec.file_name
|
705
|
-
stub_exe = File.join @gemhome, 'bin', 'executable'
|
706
|
-
rakefile = File.join gemdir, 'ext', 'a', 'Rakefile'
|
707
|
-
spec_file = File.join @gemhome, 'specifications', @spec.spec_name
|
708
|
-
|
709
|
-
Gem.pre_install do |installer|
|
710
|
-
refute_path_exists cache_file, 'cache file must not exist yet'
|
711
|
-
refute_path_exists spec_file, 'spec file must not exist yet'
|
712
|
-
true
|
713
|
-
end
|
714
|
-
|
715
|
-
Gem.post_build do |installer|
|
716
|
-
assert_path_exists gemdir, 'gem install dir must exist'
|
717
|
-
assert_path_exists rakefile, 'gem executable must exist'
|
718
|
-
refute_path_exists stub_exe, 'gem executable must not exist'
|
719
|
-
refute_path_exists spec_file, 'spec file must not exist yet'
|
720
|
-
true
|
721
|
-
end
|
722
|
-
|
723
|
-
Gem.post_install do |installer|
|
724
|
-
assert_path_exists cache_file, 'cache file must exist'
|
725
|
-
assert_path_exists spec_file, 'spec file must exist'
|
726
|
-
end
|
727
|
-
|
728
|
-
@newspec = nil
|
729
|
-
build_rake_in do
|
730
|
-
use_ui @ui do
|
731
|
-
@newspec = @installer.install
|
732
|
-
end
|
733
|
-
end
|
734
|
-
|
735
|
-
assert_equal @spec, @newspec
|
736
|
-
assert_path_exists gemdir
|
737
|
-
assert_path_exists stub_exe, 'gem executable must exist'
|
738
|
-
|
739
|
-
exe = File.join gemdir, 'bin', 'executable'
|
740
|
-
assert_path_exists exe
|
741
|
-
|
742
|
-
exe_mode = File.stat(exe).mode & 0111
|
743
|
-
assert_equal 0111, exe_mode, "0%o" % exe_mode unless win_platform?
|
744
|
-
|
745
|
-
assert_path_exists File.join gemdir, 'lib', 'code.rb'
|
746
|
-
|
747
|
-
assert_path_exists rakefile
|
748
|
-
|
749
|
-
spec_file = File.join(@gemhome, 'specifications', @spec.spec_name)
|
750
|
-
|
751
|
-
assert_equal spec_file, @newspec.loaded_from
|
752
|
-
assert_path_exists spec_file
|
753
|
-
|
754
|
-
assert_same @installer, @post_build_hook_arg
|
755
|
-
assert_same @installer, @post_install_hook_arg
|
756
|
-
assert_same @installer, @pre_install_hook_arg
|
757
|
-
end
|
758
|
-
|
759
|
-
def test_install_creates_working_binstub
|
760
|
-
Dir.mkdir util_inst_bindir
|
761
|
-
util_setup_gem
|
762
|
-
util_clear_gems
|
763
|
-
|
764
|
-
@installer.wrappers = true
|
765
|
-
|
766
|
-
gemdir = File.join @gemhome, 'gems', @spec.full_name
|
767
|
-
|
768
|
-
@newspec = nil
|
769
|
-
build_rake_in do
|
770
|
-
use_ui @ui do
|
771
|
-
@newspec = @installer.install
|
772
|
-
end
|
773
|
-
end
|
774
|
-
|
775
|
-
exe = File.join gemdir, 'bin', 'executable'
|
776
|
-
|
777
|
-
e = assert_raises RuntimeError do
|
778
|
-
instance_eval File.read(exe)
|
779
|
-
end
|
780
|
-
|
781
|
-
assert_match(/ran executable/, e.message)
|
782
|
-
end
|
783
|
-
|
784
|
-
def test_install_creates_binstub_that_understand_version
|
785
|
-
Dir.mkdir util_inst_bindir
|
786
|
-
util_setup_gem
|
787
|
-
util_clear_gems
|
788
|
-
|
789
|
-
@installer.wrappers = true
|
790
|
-
|
791
|
-
@newspec = nil
|
792
|
-
build_rake_in do
|
793
|
-
use_ui @ui do
|
794
|
-
@newspec = @installer.install
|
795
|
-
end
|
796
|
-
end
|
797
|
-
|
798
|
-
exe = File.join @gemhome, 'bin', 'executable'
|
799
|
-
|
800
|
-
ARGV.unshift "_3.0_"
|
801
|
-
|
802
|
-
begin
|
803
|
-
Gem::Specification.reset
|
804
|
-
|
805
|
-
e = assert_raises Gem::GemNotFoundException do
|
806
|
-
instance_eval File.read(exe)
|
807
|
-
end
|
808
|
-
ensure
|
809
|
-
ARGV.shift if ARGV.first == "_3.0_"
|
810
|
-
end
|
811
|
-
|
812
|
-
assert_includes(e.message, "can't find gem a (= 3.0)")
|
813
|
-
end
|
814
|
-
|
815
|
-
def test_install_creates_binstub_that_dont_trust_encoding
|
816
|
-
skip unless "".respond_to?(:force_encoding)
|
817
|
-
|
818
|
-
Dir.mkdir util_inst_bindir
|
819
|
-
util_setup_gem
|
820
|
-
util_clear_gems
|
821
|
-
|
822
|
-
@installer.wrappers = true
|
823
|
-
|
824
|
-
@newspec = nil
|
825
|
-
build_rake_in do
|
826
|
-
use_ui @ui do
|
827
|
-
@newspec = @installer.install
|
828
|
-
end
|
829
|
-
end
|
830
|
-
|
831
|
-
exe = File.join @gemhome, 'bin', 'executable'
|
832
|
-
|
833
|
-
extra_arg = "\xE4pfel".dup.force_encoding("UTF-8")
|
834
|
-
ARGV.unshift extra_arg
|
835
|
-
|
836
|
-
begin
|
837
|
-
Gem::Specification.reset
|
838
|
-
|
839
|
-
e = assert_raises RuntimeError do
|
840
|
-
instance_eval File.read(exe)
|
841
|
-
end
|
842
|
-
ensure
|
843
|
-
ARGV.shift if ARGV.first == extra_arg
|
844
|
-
end
|
845
|
-
|
846
|
-
assert_match(/ran executable/, e.message)
|
847
|
-
end
|
848
|
-
|
849
|
-
def test_install_with_no_prior_files
|
850
|
-
Dir.mkdir util_inst_bindir
|
851
|
-
util_clear_gems
|
852
|
-
|
853
|
-
util_setup_gem
|
854
|
-
build_rake_in do
|
855
|
-
use_ui @ui do
|
856
|
-
assert_equal @spec, @installer.install
|
857
|
-
end
|
858
|
-
end
|
859
|
-
|
860
|
-
gemdir = File.join(@gemhome, 'gems', @spec.full_name)
|
861
|
-
assert_path_exists File.join gemdir, 'lib', 'code.rb'
|
862
|
-
|
863
|
-
util_setup_gem
|
864
|
-
# Morph spec to have lib/other.rb instead of code.rb and recreate
|
865
|
-
@spec.files = File.join('lib', 'other.rb')
|
866
|
-
Dir.chdir @tempdir do
|
867
|
-
File.open File.join('lib', 'other.rb'), 'w' do |f| f.puts '1' end
|
868
|
-
use_ui ui do
|
869
|
-
FileUtils.rm @gem
|
870
|
-
Gem::Package.build @spec
|
871
|
-
end
|
872
|
-
end
|
873
|
-
@installer = Gem::Installer.at @gem
|
874
|
-
build_rake_in do
|
875
|
-
use_ui @ui do
|
876
|
-
assert_equal @spec, @installer.install
|
877
|
-
end
|
878
|
-
end
|
879
|
-
|
880
|
-
assert_path_exists File.join gemdir, 'lib', 'other.rb'
|
881
|
-
refute_path_exists File.join gemdir, 'lib', 'code.rb',
|
882
|
-
"code.rb from prior install of same gem shouldn't remain here"
|
883
|
-
end
|
884
|
-
|
885
|
-
def test_install_force
|
886
|
-
use_ui @ui do
|
887
|
-
installer = Gem::Installer.at old_ruby_required, :force => true
|
888
|
-
installer.install
|
889
|
-
end
|
890
|
-
|
891
|
-
gem_dir = File.join(@gemhome, 'gems', 'old_ruby_required-1')
|
892
|
-
assert_path_exists gem_dir
|
893
|
-
end
|
894
|
-
|
895
|
-
def test_install_missing_dirs
|
896
|
-
FileUtils.rm_f File.join(Gem.dir, 'cache')
|
897
|
-
FileUtils.rm_f File.join(Gem.dir, 'docs')
|
898
|
-
FileUtils.rm_f File.join(Gem.dir, 'specifications')
|
899
|
-
|
900
|
-
use_ui @ui do
|
901
|
-
@installer.install
|
902
|
-
end
|
903
|
-
|
904
|
-
File.directory? File.join(Gem.dir, 'cache')
|
905
|
-
File.directory? File.join(Gem.dir, 'docs')
|
906
|
-
File.directory? File.join(Gem.dir, 'specifications')
|
907
|
-
|
908
|
-
assert_path_exists File.join @gemhome, 'cache', @spec.file_name
|
909
|
-
assert_path_exists File.join @gemhome, 'specifications', @spec.spec_name
|
910
|
-
end
|
911
|
-
|
912
|
-
def test_install_post_build_false
|
913
|
-
util_clear_gems
|
914
|
-
|
915
|
-
Gem.post_build do
|
916
|
-
false
|
917
|
-
end
|
918
|
-
|
919
|
-
use_ui @ui do
|
920
|
-
e = assert_raises Gem::InstallError do
|
921
|
-
@installer.install
|
922
|
-
end
|
923
|
-
|
924
|
-
location = "#{__FILE__}:#{__LINE__ - 9}"
|
925
|
-
|
926
|
-
assert_equal "post-build hook at #{location} failed for a-2", e.message
|
927
|
-
end
|
928
|
-
|
929
|
-
spec_file = File.join @gemhome, 'specifications', @spec.spec_name
|
930
|
-
refute_path_exists spec_file
|
931
|
-
|
932
|
-
gem_dir = File.join @gemhome, 'gems', @spec.full_name
|
933
|
-
refute_path_exists gem_dir
|
934
|
-
end
|
935
|
-
|
936
|
-
def test_install_post_build_nil
|
937
|
-
util_clear_gems
|
938
|
-
|
939
|
-
Gem.post_build do
|
940
|
-
nil
|
941
|
-
end
|
942
|
-
|
943
|
-
use_ui @ui do
|
944
|
-
@installer.install
|
945
|
-
end
|
946
|
-
|
947
|
-
spec_file = File.join @gemhome, 'specifications', @spec.spec_name
|
948
|
-
assert_path_exists spec_file
|
949
|
-
|
950
|
-
gem_dir = File.join @gemhome, 'gems', @spec.full_name
|
951
|
-
assert_path_exists gem_dir
|
952
|
-
end
|
953
|
-
|
954
|
-
def test_install_pre_install_false
|
955
|
-
util_clear_gems
|
956
|
-
|
957
|
-
Gem.pre_install do
|
958
|
-
false
|
959
|
-
end
|
960
|
-
|
961
|
-
use_ui @ui do
|
962
|
-
e = assert_raises Gem::InstallError do
|
963
|
-
@installer.install
|
964
|
-
end
|
965
|
-
|
966
|
-
location = "#{__FILE__}:#{__LINE__ - 9}"
|
967
|
-
|
968
|
-
assert_equal "pre-install hook at #{location} failed for a-2", e.message
|
969
|
-
end
|
970
|
-
|
971
|
-
spec_file = File.join @gemhome, 'specifications', @spec.spec_name
|
972
|
-
refute_path_exists spec_file
|
973
|
-
end
|
974
|
-
|
975
|
-
def test_install_pre_install_nil
|
976
|
-
util_clear_gems
|
977
|
-
|
978
|
-
Gem.pre_install do
|
979
|
-
nil
|
980
|
-
end
|
981
|
-
|
982
|
-
use_ui @ui do
|
983
|
-
@installer.install
|
984
|
-
end
|
985
|
-
|
986
|
-
spec_file = File.join @gemhome, 'specifications', @spec.spec_name
|
987
|
-
assert_path_exists spec_file
|
988
|
-
end
|
989
|
-
|
990
|
-
def test_install_with_message
|
991
|
-
@spec.post_install_message = 'I am a shiny gem!'
|
992
|
-
|
993
|
-
use_ui @ui do
|
994
|
-
path = Gem::Package.build @spec
|
995
|
-
|
996
|
-
@installer = Gem::Installer.at path
|
997
|
-
@installer.install
|
998
|
-
end
|
999
|
-
|
1000
|
-
assert_match %r|I am a shiny gem!|, @ui.output
|
1001
|
-
end
|
1002
|
-
|
1003
|
-
def test_install_with_skipped_message
|
1004
|
-
@spec.post_install_message = 'I am a shiny gem!'
|
1005
|
-
|
1006
|
-
use_ui @ui do
|
1007
|
-
path = Gem::Package.build @spec
|
1008
|
-
|
1009
|
-
@installer = Gem::Installer.at path, :post_install_message => false
|
1010
|
-
@installer.install
|
1011
|
-
end
|
1012
|
-
|
1013
|
-
refute_match %r|I am a shiny gem!|, @ui.output
|
1014
|
-
end
|
1015
|
-
|
1016
|
-
def test_install_extension_dir
|
1017
|
-
gemhome2 = "#{@gemhome}2"
|
1018
|
-
|
1019
|
-
@spec.extensions << "extconf.rb"
|
1020
|
-
write_file File.join(@tempdir, "extconf.rb") do |io|
|
1021
|
-
io.write <<-RUBY
|
1022
|
-
require "mkmf"
|
1023
|
-
create_makefile("#{@spec.name}")
|
1024
|
-
RUBY
|
1025
|
-
end
|
1026
|
-
|
1027
|
-
@spec.files += %w[extconf.rb]
|
1028
|
-
|
1029
|
-
use_ui @ui do
|
1030
|
-
path = Gem::Package.build @spec
|
1031
|
-
|
1032
|
-
installer = Gem::Installer.at path, :install_dir => gemhome2
|
1033
|
-
installer.install
|
1034
|
-
end
|
1035
|
-
|
1036
|
-
expected_makefile = File.join gemhome2, 'gems', @spec.full_name, 'Makefile'
|
1037
|
-
|
1038
|
-
assert_path_exists expected_makefile
|
1039
|
-
end
|
1040
|
-
|
1041
|
-
def test_install_extension_and_script
|
1042
|
-
@spec.extensions << "extconf.rb"
|
1043
|
-
write_file File.join(@tempdir, "extconf.rb") do |io|
|
1044
|
-
io.write <<-RUBY
|
1045
|
-
require "mkmf"
|
1046
|
-
create_makefile("#{@spec.name}")
|
1047
|
-
RUBY
|
1048
|
-
end
|
1049
|
-
|
1050
|
-
rb = File.join("lib", "#{@spec.name}.rb")
|
1051
|
-
@spec.files += [rb]
|
1052
|
-
write_file File.join(@tempdir, rb) do |io|
|
1053
|
-
io.write <<-RUBY
|
1054
|
-
# #{@spec.name}.rb
|
1055
|
-
RUBY
|
1056
|
-
end
|
1057
|
-
|
1058
|
-
Dir.mkdir(File.join("lib", @spec.name))
|
1059
|
-
rb2 = File.join("lib", @spec.name, "#{@spec.name}.rb")
|
1060
|
-
@spec.files << rb2
|
1061
|
-
write_file File.join(@tempdir, rb2) do |io|
|
1062
|
-
io.write <<-RUBY
|
1063
|
-
# #{@spec.name}/#{@spec.name}.rb
|
1064
|
-
RUBY
|
1065
|
-
end
|
1066
|
-
|
1067
|
-
refute_path_exists File.join @spec.gem_dir, rb
|
1068
|
-
refute_path_exists File.join @spec.gem_dir, rb2
|
1069
|
-
use_ui @ui do
|
1070
|
-
path = Gem::Package.build @spec
|
1071
|
-
|
1072
|
-
@installer = Gem::Installer.at path
|
1073
|
-
@installer.install
|
1074
|
-
end
|
1075
|
-
assert_path_exists File.join @spec.gem_dir, rb
|
1076
|
-
assert_path_exists File.join @spec.gem_dir, rb2
|
1077
|
-
end
|
1078
|
-
|
1079
|
-
def test_install_extension_flat
|
1080
|
-
skip '1.9.2 and earlier mkmf.rb does not create TOUCH' if
|
1081
|
-
RUBY_VERSION < '1.9.3'
|
1082
|
-
|
1083
|
-
if RUBY_VERSION == "1.9.3" and RUBY_PATCHLEVEL <= 194
|
1084
|
-
skip "TOUCH was introduced into 1.9.3 after p194"
|
1085
|
-
end
|
1086
|
-
|
1087
|
-
@spec.require_paths = ["."]
|
1088
|
-
|
1089
|
-
@spec.extensions << "extconf.rb"
|
1090
|
-
|
1091
|
-
write_file File.join(@tempdir, "extconf.rb") do |io|
|
1092
|
-
io.write <<-RUBY
|
1093
|
-
require "mkmf"
|
1094
|
-
|
1095
|
-
CONFIG['CC'] = '$(TOUCH) $@ ||'
|
1096
|
-
CONFIG['LDSHARED'] = '$(TOUCH) $@ ||'
|
1097
|
-
$ruby = '#{Gem.ruby}'
|
1098
|
-
|
1099
|
-
create_makefile("#{@spec.name}")
|
1100
|
-
RUBY
|
1101
|
-
end
|
1102
|
-
|
1103
|
-
# empty depend file for no auto dependencies
|
1104
|
-
@spec.files += %W"depend #{@spec.name}.c".each {|file|
|
1105
|
-
write_file File.join(@tempdir, file)
|
1106
|
-
}
|
1107
|
-
|
1108
|
-
so = File.join(@spec.gem_dir, "#{@spec.name}.#{RbConfig::CONFIG["DLEXT"]}")
|
1109
|
-
refute_path_exists so
|
1110
|
-
use_ui @ui do
|
1111
|
-
path = Gem::Package.build @spec
|
1112
|
-
|
1113
|
-
@installer = Gem::Installer.at path
|
1114
|
-
@installer.install
|
1115
|
-
end
|
1116
|
-
assert_path_exists so
|
1117
|
-
rescue
|
1118
|
-
puts '-' * 78
|
1119
|
-
puts File.read File.join(@gemhome, 'gems', 'a-2', 'Makefile')
|
1120
|
-
puts '-' * 78
|
1121
|
-
|
1122
|
-
path = File.join(@gemhome, 'gems', 'a-2', 'gem_make.out')
|
1123
|
-
|
1124
|
-
if File.exist?(path)
|
1125
|
-
puts File.read(path)
|
1126
|
-
puts '-' * 78
|
1127
|
-
end
|
1128
|
-
|
1129
|
-
raise
|
1130
|
-
end
|
1131
|
-
|
1132
|
-
def test_installation_satisfies_dependency_eh
|
1133
|
-
util_spec 'a'
|
1134
|
-
|
1135
|
-
dep = Gem::Dependency.new 'a', '>= 2'
|
1136
|
-
assert @installer.installation_satisfies_dependency?(dep)
|
1137
|
-
|
1138
|
-
dep = Gem::Dependency.new 'a', '> 2'
|
1139
|
-
refute @installer.installation_satisfies_dependency?(dep)
|
1140
|
-
end
|
1141
|
-
|
1142
|
-
def test_installation_satisfies_dependency_eh_development
|
1143
|
-
@installer.options[:development] = true
|
1144
|
-
@installer.options[:dev_shallow] = true
|
1145
|
-
|
1146
|
-
util_spec 'a'
|
1147
|
-
|
1148
|
-
dep = Gem::Dependency.new 'a', :development
|
1149
|
-
assert @installer.installation_satisfies_dependency?(dep)
|
1150
|
-
end
|
1151
|
-
|
1152
|
-
def test_pre_install_checks_dependencies
|
1153
|
-
@spec.add_dependency 'b', '> 5'
|
1154
|
-
util_setup_gem
|
1155
|
-
|
1156
|
-
use_ui @ui do
|
1157
|
-
assert_raises Gem::InstallError do
|
1158
|
-
@installer.install
|
1159
|
-
end
|
1160
|
-
end
|
1161
|
-
end
|
1162
|
-
|
1163
|
-
def test_pre_install_checks_dependencies_ignore
|
1164
|
-
@spec.add_dependency 'b', '> 5'
|
1165
|
-
@installer.ignore_dependencies = true
|
1166
|
-
|
1167
|
-
build_rake_in do
|
1168
|
-
use_ui @ui do
|
1169
|
-
assert @installer.pre_install_checks
|
1170
|
-
end
|
1171
|
-
end
|
1172
|
-
end
|
1173
|
-
|
1174
|
-
def test_pre_install_checks_dependencies_install_dir
|
1175
|
-
gemhome2 = "#{@gemhome}2"
|
1176
|
-
@spec.add_dependency 'd'
|
1177
|
-
|
1178
|
-
quick_gem 'd', 2
|
1179
|
-
|
1180
|
-
gem = File.join @gemhome, @spec.file_name
|
1181
|
-
|
1182
|
-
FileUtils.mv @gemhome, gemhome2
|
1183
|
-
FileUtils.mkdir @gemhome
|
1184
|
-
|
1185
|
-
FileUtils.mv File.join(gemhome2, 'cache', @spec.file_name), gem
|
1186
|
-
|
1187
|
-
# Don't leak any already activated gems into the installer, require
|
1188
|
-
# that it work everything out on it's own.
|
1189
|
-
Gem::Specification.reset
|
1190
|
-
|
1191
|
-
installer = Gem::Installer.at gem, :install_dir => gemhome2
|
1192
|
-
|
1193
|
-
build_rake_in do
|
1194
|
-
use_ui @ui do
|
1195
|
-
assert installer.pre_install_checks
|
1196
|
-
end
|
1197
|
-
end
|
1198
|
-
end
|
1199
|
-
|
1200
|
-
def test_pre_install_checks_ruby_version
|
1201
|
-
use_ui @ui do
|
1202
|
-
installer = Gem::Installer.at old_ruby_required
|
1203
|
-
e = assert_raises Gem::InstallError do
|
1204
|
-
installer.pre_install_checks
|
1205
|
-
end
|
1206
|
-
assert_equal 'old_ruby_required requires Ruby version = 1.4.6.',
|
1207
|
-
e.message
|
1208
|
-
end
|
1209
|
-
end
|
1210
|
-
|
1211
|
-
def test_pre_install_checks_wrong_rubygems_version
|
1212
|
-
spec = util_spec 'old_rubygems_required', '1' do |s|
|
1213
|
-
s.required_rubygems_version = '< 0'
|
1214
|
-
end
|
1215
|
-
|
1216
|
-
util_build_gem spec
|
1217
|
-
|
1218
|
-
gem = File.join(@gemhome, 'cache', spec.file_name)
|
1219
|
-
|
1220
|
-
use_ui @ui do
|
1221
|
-
@installer = Gem::Installer.at gem
|
1222
|
-
e = assert_raises Gem::InstallError do
|
1223
|
-
@installer.pre_install_checks
|
1224
|
-
end
|
1225
|
-
assert_equal 'old_rubygems_required requires RubyGems version < 0. ' +
|
1226
|
-
"Try 'gem update --system' to update RubyGems itself.", e.message
|
1227
|
-
end
|
1228
|
-
end
|
1229
|
-
|
1230
|
-
def test_shebang
|
1231
|
-
util_make_exec @spec, "#!/usr/bin/ruby"
|
1232
|
-
|
1233
|
-
shebang = @installer.shebang 'executable'
|
1234
|
-
|
1235
|
-
assert_equal "#!#{Gem.ruby}", shebang
|
1236
|
-
end
|
1237
|
-
|
1238
|
-
def test_process_options
|
1239
|
-
assert_nil @installer.build_root
|
1240
|
-
assert_equal File.join(@gemhome, 'bin'), @installer.bin_dir
|
1241
|
-
assert_equal @gemhome, @installer.gem_home
|
1242
|
-
end
|
1243
|
-
|
1244
|
-
def test_process_options_build_root
|
1245
|
-
build_root = File.join @tempdir, 'build_root'
|
1246
|
-
|
1247
|
-
@installer = Gem::Installer.at @gem, :build_root => build_root
|
1248
|
-
|
1249
|
-
assert_equal Pathname(build_root), @installer.build_root
|
1250
|
-
assert_equal File.join(build_root, @gemhome, 'bin'), @installer.bin_dir
|
1251
|
-
assert_equal File.join(build_root, @gemhome), @installer.gem_home
|
1252
|
-
end
|
1253
|
-
|
1254
|
-
def test_shebang_arguments
|
1255
|
-
util_make_exec @spec, "#!/usr/bin/ruby -ws"
|
1256
|
-
|
1257
|
-
shebang = @installer.shebang 'executable'
|
1258
|
-
|
1259
|
-
assert_equal "#!#{Gem.ruby} -ws", shebang
|
1260
|
-
end
|
1261
|
-
|
1262
|
-
def test_shebang_empty
|
1263
|
-
util_make_exec @spec, ''
|
1264
|
-
|
1265
|
-
shebang = @installer.shebang 'executable'
|
1266
|
-
assert_equal "#!#{Gem.ruby}", shebang
|
1267
|
-
end
|
1268
|
-
|
1269
|
-
def test_shebang_env
|
1270
|
-
util_make_exec @spec, "#!/usr/bin/env ruby"
|
1271
|
-
|
1272
|
-
shebang = @installer.shebang 'executable'
|
1273
|
-
|
1274
|
-
assert_equal "#!#{Gem.ruby}", shebang
|
1275
|
-
end
|
1276
|
-
|
1277
|
-
def test_shebang_env_arguments
|
1278
|
-
util_make_exec @spec, "#!/usr/bin/env ruby -ws"
|
1279
|
-
|
1280
|
-
shebang = @installer.shebang 'executable'
|
1281
|
-
|
1282
|
-
assert_equal "#!#{Gem.ruby} -ws", shebang
|
1283
|
-
end
|
1284
|
-
|
1285
|
-
def test_shebang_env_shebang
|
1286
|
-
util_make_exec @spec, ''
|
1287
|
-
@installer.env_shebang = true
|
1288
|
-
|
1289
|
-
shebang = @installer.shebang 'executable'
|
1290
|
-
|
1291
|
-
env_shebang = "/usr/bin/env" unless Gem.win_platform?
|
1292
|
-
|
1293
|
-
assert_equal("#!#{env_shebang} #{RbConfig::CONFIG['ruby_install_name']}",
|
1294
|
-
shebang)
|
1295
|
-
end
|
1296
|
-
|
1297
|
-
def test_shebang_nested
|
1298
|
-
util_make_exec @spec, "#!/opt/local/ruby/bin/ruby"
|
1299
|
-
|
1300
|
-
shebang = @installer.shebang 'executable'
|
1301
|
-
|
1302
|
-
assert_equal "#!#{Gem.ruby}", shebang
|
1303
|
-
end
|
1304
|
-
|
1305
|
-
def test_shebang_nested_arguments
|
1306
|
-
util_make_exec @spec, "#!/opt/local/ruby/bin/ruby -ws"
|
1307
|
-
|
1308
|
-
shebang = @installer.shebang 'executable'
|
1309
|
-
|
1310
|
-
assert_equal "#!#{Gem.ruby} -ws", shebang
|
1311
|
-
end
|
1312
|
-
|
1313
|
-
def test_shebang_version
|
1314
|
-
util_make_exec @spec, "#!/usr/bin/ruby18"
|
1315
|
-
|
1316
|
-
shebang = @installer.shebang 'executable'
|
1317
|
-
|
1318
|
-
assert_equal "#!#{Gem.ruby}", shebang
|
1319
|
-
end
|
1320
|
-
|
1321
|
-
def test_shebang_version_arguments
|
1322
|
-
util_make_exec @spec, "#!/usr/bin/ruby18 -ws"
|
1323
|
-
|
1324
|
-
shebang = @installer.shebang 'executable'
|
1325
|
-
|
1326
|
-
assert_equal "#!#{Gem.ruby} -ws", shebang
|
1327
|
-
end
|
1328
|
-
|
1329
|
-
def test_shebang_version_env
|
1330
|
-
util_make_exec @spec, "#!/usr/bin/env ruby18"
|
1331
|
-
|
1332
|
-
shebang = @installer.shebang 'executable'
|
1333
|
-
|
1334
|
-
assert_equal "#!#{Gem.ruby}", shebang
|
1335
|
-
end
|
1336
|
-
|
1337
|
-
def test_shebang_version_env_arguments
|
1338
|
-
util_make_exec @spec, "#!/usr/bin/env ruby18 -ws"
|
1339
|
-
|
1340
|
-
shebang = @installer.shebang 'executable'
|
1341
|
-
|
1342
|
-
assert_equal "#!#{Gem.ruby} -ws", shebang
|
1343
|
-
end
|
1344
|
-
|
1345
|
-
def test_shebang_custom
|
1346
|
-
conf = Gem::ConfigFile.new []
|
1347
|
-
conf[:custom_shebang] = 'test'
|
1348
|
-
|
1349
|
-
Gem.configuration = conf
|
1350
|
-
|
1351
|
-
util_make_exec @spec, "#!/usr/bin/ruby"
|
1352
|
-
|
1353
|
-
shebang = @installer.shebang 'executable'
|
1354
|
-
|
1355
|
-
assert_equal "#!test", shebang
|
1356
|
-
end
|
1357
|
-
|
1358
|
-
def test_shebang_custom_with_expands
|
1359
|
-
bin_env = win_platform? ? '' : '/usr/bin/env'
|
1360
|
-
conf = Gem::ConfigFile.new []
|
1361
|
-
conf[:custom_shebang] = '1 $env 2 $ruby 3 $exec 4 $name'
|
1362
|
-
|
1363
|
-
Gem.configuration = conf
|
1364
|
-
|
1365
|
-
util_make_exec @spec, "#!/usr/bin/ruby"
|
1366
|
-
|
1367
|
-
shebang = @installer.shebang 'executable'
|
1368
|
-
|
1369
|
-
assert_equal "#!1 #{bin_env} 2 #{Gem.ruby} 3 executable 4 a", shebang
|
1370
|
-
end
|
1371
|
-
|
1372
|
-
def test_shebang_custom_with_expands_and_arguments
|
1373
|
-
bin_env = win_platform? ? '' : '/usr/bin/env'
|
1374
|
-
conf = Gem::ConfigFile.new []
|
1375
|
-
conf[:custom_shebang] = '1 $env 2 $ruby 3 $exec'
|
1376
|
-
|
1377
|
-
Gem.configuration = conf
|
1378
|
-
|
1379
|
-
util_make_exec @spec, "#!/usr/bin/ruby -ws"
|
1380
|
-
|
1381
|
-
shebang = @installer.shebang 'executable'
|
1382
|
-
|
1383
|
-
assert_equal "#!1 #{bin_env} 2 #{Gem.ruby} -ws 3 executable", shebang
|
1384
|
-
end
|
1385
|
-
|
1386
|
-
def test_unpack
|
1387
|
-
util_setup_gem
|
1388
|
-
|
1389
|
-
dest = File.join @gemhome, 'gems', @spec.full_name
|
1390
|
-
|
1391
|
-
@installer.unpack dest
|
1392
|
-
|
1393
|
-
assert_path_exists File.join dest, 'lib', 'code.rb'
|
1394
|
-
assert_path_exists File.join dest, 'bin', 'executable'
|
1395
|
-
end
|
1396
|
-
|
1397
|
-
def test_write_build_info_file
|
1398
|
-
refute_path_exists @spec.build_info_file
|
1399
|
-
|
1400
|
-
@installer.build_args = %w[
|
1401
|
-
--with-libyaml-dir /usr/local/Cellar/libyaml/0.1.4
|
1402
|
-
]
|
1403
|
-
|
1404
|
-
@installer.write_build_info_file
|
1405
|
-
|
1406
|
-
assert_path_exists @spec.build_info_file
|
1407
|
-
|
1408
|
-
expected = "--with-libyaml-dir\n/usr/local/Cellar/libyaml/0.1.4\n"
|
1409
|
-
|
1410
|
-
assert_equal expected, File.read(@spec.build_info_file)
|
1411
|
-
end
|
1412
|
-
|
1413
|
-
def test_write_build_info_file_empty
|
1414
|
-
refute_path_exists @spec.build_info_file
|
1415
|
-
|
1416
|
-
@installer.write_build_info_file
|
1417
|
-
|
1418
|
-
refute_path_exists @spec.build_info_file
|
1419
|
-
end
|
1420
|
-
|
1421
|
-
def test_write_build_info_file_install_dir
|
1422
|
-
installer = Gem::Installer.at @gem, :install_dir => "#{@gemhome}2"
|
1423
|
-
|
1424
|
-
installer.build_args = %w[
|
1425
|
-
--with-libyaml-dir /usr/local/Cellar/libyaml/0.1.4
|
1426
|
-
]
|
1427
|
-
|
1428
|
-
installer.write_build_info_file
|
1429
|
-
|
1430
|
-
refute_path_exists @spec.build_info_file
|
1431
|
-
assert_path_exists \
|
1432
|
-
File.join("#{@gemhome}2", 'build_info', "#{@spec.full_name}.info")
|
1433
|
-
end
|
1434
|
-
|
1435
|
-
def test_write_cache_file
|
1436
|
-
cache_file = File.join @gemhome, 'cache', @spec.file_name
|
1437
|
-
gem = File.join @gemhome, @spec.file_name
|
1438
|
-
|
1439
|
-
FileUtils.mv cache_file, gem
|
1440
|
-
refute_path_exists cache_file
|
1441
|
-
|
1442
|
-
installer = Gem::Installer.at gem
|
1443
|
-
installer.gem_home = @gemhome
|
1444
|
-
|
1445
|
-
installer.write_cache_file
|
1446
|
-
|
1447
|
-
assert_path_exists cache_file
|
1448
|
-
end
|
1449
|
-
|
1450
|
-
def test_write_spec
|
1451
|
-
FileUtils.rm @spec.spec_file
|
1452
|
-
refute_path_exists @spec.spec_file
|
1453
|
-
|
1454
|
-
@installer = Gem::Installer.for_spec @spec
|
1455
|
-
@installer.gem_home = @gemhome
|
1456
|
-
|
1457
|
-
@installer.write_spec
|
1458
|
-
|
1459
|
-
assert_path_exists @spec.spec_file
|
1460
|
-
|
1461
|
-
loaded = Gem::Specification.load @spec.spec_file
|
1462
|
-
|
1463
|
-
assert_equal @spec, loaded
|
1464
|
-
|
1465
|
-
assert_equal Gem.rubygems_version, @spec.installed_by_version
|
1466
|
-
end
|
1467
|
-
|
1468
|
-
def test_write_spec_writes_cached_spec
|
1469
|
-
FileUtils.rm @spec.spec_file
|
1470
|
-
refute_path_exists @spec.spec_file
|
1471
|
-
|
1472
|
-
@spec.files = %w[a.rb b.rb c.rb]
|
1473
|
-
|
1474
|
-
@installer = Gem::Installer.for_spec @spec
|
1475
|
-
@installer.gem_home = @gemhome
|
1476
|
-
|
1477
|
-
@installer.write_spec
|
1478
|
-
|
1479
|
-
# cached specs have no file manifest:
|
1480
|
-
@spec.files = []
|
1481
|
-
|
1482
|
-
assert_equal @spec, eval(File.read(@spec.spec_file))
|
1483
|
-
end
|
1484
|
-
|
1485
|
-
def test_dir
|
1486
|
-
assert_match %r!/gemhome/gems/a-2$!, @installer.dir
|
1487
|
-
end
|
1488
|
-
|
1489
|
-
def test_default_gem_loaded_from
|
1490
|
-
spec = util_spec 'a'
|
1491
|
-
installer = Gem::Installer.for_spec spec, :install_as_default => true
|
1492
|
-
installer.install
|
1493
|
-
assert_predicate spec, :default_gem?
|
1494
|
-
end
|
1495
|
-
|
1496
|
-
def test_default_gem
|
1497
|
-
FileUtils.rm_f File.join(Gem.dir, 'specifications')
|
1498
|
-
|
1499
|
-
@installer.wrappers = true
|
1500
|
-
@installer.options[:install_as_default] = true
|
1501
|
-
@installer.gem_dir = util_gem_dir @spec
|
1502
|
-
@installer.generate_bin
|
1503
|
-
|
1504
|
-
use_ui @ui do
|
1505
|
-
@installer.install
|
1506
|
-
end
|
1507
|
-
|
1508
|
-
assert File.directory? util_inst_bindir
|
1509
|
-
installed_exec = File.join util_inst_bindir, 'executable'
|
1510
|
-
assert_path_exists installed_exec
|
1511
|
-
|
1512
|
-
assert File.directory? File.join(Gem.default_dir, 'specifications')
|
1513
|
-
assert File.directory? File.join(Gem.default_dir, 'specifications', 'default')
|
1514
|
-
|
1515
|
-
default_spec = eval File.read File.join(Gem.default_dir, 'specifications', 'default', 'a-2.gemspec')
|
1516
|
-
assert_equal Gem::Version.new("2"), default_spec.version
|
1517
|
-
assert_equal ['bin/executable'], default_spec.files
|
1518
|
-
end
|
1519
|
-
|
1520
|
-
def old_ruby_required
|
1521
|
-
spec = util_spec 'old_ruby_required', '1' do |s|
|
1522
|
-
s.required_ruby_version = '= 1.4.6'
|
1523
|
-
end
|
1524
|
-
|
1525
|
-
util_build_gem spec
|
1526
|
-
|
1527
|
-
spec.cache_file
|
1528
|
-
end
|
1529
|
-
|
1530
|
-
def util_execless
|
1531
|
-
@spec = util_spec 'z'
|
1532
|
-
util_build_gem @spec
|
1533
|
-
|
1534
|
-
@installer = util_installer @spec, @gemhome
|
1535
|
-
end
|
1536
|
-
|
1537
|
-
def util_conflict_executable wrappers
|
1538
|
-
conflict = quick_gem 'conflict' do |spec|
|
1539
|
-
util_make_exec spec
|
1540
|
-
end
|
1541
|
-
|
1542
|
-
util_build_gem conflict
|
1543
|
-
|
1544
|
-
installer = util_installer conflict, @gemhome
|
1545
|
-
installer.wrappers = wrappers
|
1546
|
-
installer.generate_bin
|
1547
|
-
end
|
1548
|
-
|
1549
|
-
def mask
|
1550
|
-
0100755 & (~File.umask)
|
1551
|
-
end
|
1552
|
-
end
|