rubygems-update 2.7.11 → 3.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +67 -0
- data/.travis.yml +24 -18
- data/CODE_OF_CONDUCT.md +10 -8
- data/CONTRIBUTING.md +148 -0
- data/History.txt +458 -8
- data/MAINTAINERS.txt +1 -0
- data/Manifest.txt +16 -9
- data/POLICIES.md +92 -0
- data/README.md +53 -26
- data/Rakefile +77 -211
- data/{UPGRADING.rdoc → UPGRADING.md} +31 -32
- data/appveyor.yml +20 -45
- data/bin/gem +1 -2
- data/bin/update_rubygems +2 -3
- data/bundler/CHANGELOG.md +65 -0
- data/bundler/bundler.gemspec +7 -1
- data/bundler/lib/bundler/build_metadata.rb +1 -1
- data/bundler/lib/bundler/cli/add.rb +15 -5
- data/bundler/lib/bundler/cli/binstubs.rb +8 -2
- data/bundler/lib/bundler/cli/doctor.rb +47 -1
- data/bundler/lib/bundler/cli/install.rb +8 -5
- data/bundler/lib/bundler/cli/list.rb +41 -5
- data/bundler/lib/bundler/cli/outdated.rb +7 -1
- data/bundler/lib/bundler/cli/pristine.rb +4 -0
- data/bundler/lib/bundler/cli/remove.rb +18 -0
- data/bundler/lib/bundler/cli.rb +63 -21
- data/bundler/lib/bundler/definition.rb +15 -16
- data/bundler/lib/bundler/dependency.rb +2 -2
- data/bundler/lib/bundler/dsl.rb +19 -3
- data/bundler/lib/bundler/feature_flag.rb +7 -0
- data/bundler/lib/bundler/gem_version_promoter.rb +4 -2
- data/bundler/lib/bundler/injector.rb +168 -9
- data/bundler/lib/bundler/installer/parallel_installer.rb +5 -0
- data/bundler/lib/bundler/installer.rb +29 -6
- data/bundler/lib/bundler/plugin/events.rb +61 -0
- data/bundler/lib/bundler/plugin.rb +10 -3
- data/bundler/lib/bundler/resolver.rb +2 -2
- data/bundler/lib/bundler/rubygems_gem_installer.rb +7 -0
- data/bundler/lib/bundler/runtime.rb +8 -2
- data/bundler/lib/bundler/settings/validator.rb +23 -0
- data/bundler/lib/bundler/settings.rb +24 -3
- data/bundler/lib/bundler/shared_helpers.rb +19 -3
- data/bundler/lib/bundler/source/metadata.rb +2 -3
- data/bundler/lib/bundler/source.rb +9 -9
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +1 -0
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler.rb +26 -8
- data/bundler/man/bundle-add.ronn +13 -2
- data/bundler/man/bundle-config.ronn +21 -0
- data/bundler/man/bundle-install.ronn +1 -1
- data/bundler/man/bundle-list.ronn +19 -1
- data/bundler/man/bundle-outdated.ronn +4 -0
- data/bundler/man/bundle-remove.ronn +23 -0
- data/bundler/man/bundle-update.ronn +1 -1
- data/bundler/man/bundle.ronn +3 -0
- data/lib/rubygems/available_set.rb +1 -1
- data/lib/rubygems/basic_specification.rb +12 -12
- data/lib/rubygems/bundler_version_finder.rb +3 -3
- data/lib/rubygems/command.rb +22 -15
- data/lib/rubygems/command_manager.rb +22 -5
- data/lib/rubygems/commands/build_command.rb +41 -7
- data/lib/rubygems/commands/cert_command.rb +45 -24
- data/lib/rubygems/commands/check_command.rb +1 -1
- data/lib/rubygems/commands/cleanup_command.rb +14 -7
- data/lib/rubygems/commands/contents_command.rb +14 -15
- data/lib/rubygems/commands/dependency_command.rb +17 -17
- data/lib/rubygems/commands/environment_command.rb +20 -1
- data/lib/rubygems/commands/fetch_command.rb +2 -3
- data/lib/rubygems/commands/generate_index_command.rb +2 -3
- data/lib/rubygems/commands/help_command.rb +12 -13
- data/lib/rubygems/commands/info_command.rb +33 -0
- data/lib/rubygems/commands/install_command.rb +21 -17
- data/lib/rubygems/commands/list_command.rb +0 -1
- data/lib/rubygems/commands/lock_command.rb +3 -4
- data/lib/rubygems/commands/open_command.rb +16 -10
- data/lib/rubygems/commands/owner_command.rb +21 -7
- data/lib/rubygems/commands/pristine_command.rb +23 -16
- data/lib/rubygems/commands/push_command.rb +19 -8
- data/lib/rubygems/commands/query_command.rb +24 -24
- data/lib/rubygems/commands/rdoc_command.rb +3 -4
- data/lib/rubygems/commands/search_command.rb +0 -1
- data/lib/rubygems/commands/server_command.rb +1 -2
- data/lib/rubygems/commands/setup_command.rb +86 -48
- data/lib/rubygems/commands/signin_command.rb +2 -1
- data/lib/rubygems/commands/signout_command.rb +2 -2
- data/lib/rubygems/commands/sources_command.rb +11 -12
- data/lib/rubygems/commands/specification_command.rb +7 -7
- data/lib/rubygems/commands/uninstall_command.rb +50 -18
- data/lib/rubygems/commands/unpack_command.rb +16 -7
- data/lib/rubygems/commands/update_command.rb +28 -23
- data/lib/rubygems/commands/which_command.rb +5 -8
- data/lib/rubygems/commands/yank_command.rb +1 -2
- data/lib/rubygems/compatibility.rb +1 -21
- data/lib/rubygems/config_file.rb +36 -36
- data/lib/rubygems/core_ext/kernel_require.rb +6 -6
- data/lib/rubygems/core_ext/kernel_warn.rb +45 -0
- data/lib/rubygems/defaults.rb +31 -19
- data/lib/rubygems/dependency.rb +15 -15
- data/lib/rubygems/dependency_installer.rb +30 -33
- data/lib/rubygems/dependency_list.rb +9 -10
- data/lib/rubygems/deprecate.rb +2 -3
- data/lib/rubygems/doctor.rb +5 -6
- data/lib/rubygems/errors.rb +3 -3
- data/lib/rubygems/exceptions.rb +11 -8
- data/lib/rubygems/ext/build_error.rb +0 -1
- data/lib/rubygems/ext/builder.rb +50 -23
- data/lib/rubygems/ext/cmake_builder.rb +2 -2
- data/lib/rubygems/ext/configure_builder.rb +2 -3
- data/lib/rubygems/ext/ext_conf_builder.rb +8 -7
- data/lib/rubygems/ext/rake_builder.rb +16 -18
- data/lib/rubygems/ext.rb +0 -1
- data/lib/rubygems/gem_runner.rb +2 -2
- data/lib/rubygems/gemcutter_utilities.rb +46 -12
- data/lib/rubygems/indexer.rb +19 -12
- data/lib/rubygems/install_default_message.rb +0 -1
- data/lib/rubygems/install_message.rb +0 -1
- data/lib/rubygems/install_update_options.rb +3 -29
- data/lib/rubygems/installer.rb +97 -55
- data/lib/rubygems/installer_test_case.rb +2 -16
- data/lib/rubygems/local_remote_options.rb +5 -4
- data/lib/rubygems/mock_gem_ui.rb +3 -4
- data/lib/rubygems/name_tuple.rb +4 -4
- data/lib/rubygems/package/digest_io.rb +3 -4
- data/lib/rubygems/package/file_source.rb +3 -4
- data/lib/rubygems/package/io_source.rb +1 -2
- data/lib/rubygems/package/old.rb +8 -16
- data/lib/rubygems/package/source.rb +0 -1
- data/lib/rubygems/package/tar_header.rb +13 -4
- data/lib/rubygems/package/tar_reader/entry.rb +20 -4
- data/lib/rubygems/package/tar_reader.rb +2 -4
- data/lib/rubygems/package/tar_test_case.rb +2 -8
- data/lib/rubygems/package/tar_writer.rb +13 -15
- data/lib/rubygems/package.rb +90 -63
- data/lib/rubygems/package_task.rb +0 -1
- data/lib/rubygems/path_support.rb +16 -6
- data/lib/rubygems/platform.rb +4 -5
- data/lib/rubygems/psych_tree.rb +1 -1
- data/lib/rubygems/rdoc.rb +2 -313
- data/lib/rubygems/remote_fetcher.rb +29 -82
- data/lib/rubygems/request/connection_pools.rb +24 -13
- data/lib/rubygems/request/http_pool.rb +3 -4
- data/lib/rubygems/request/https_pool.rb +1 -3
- data/lib/rubygems/request.rb +17 -16
- data/lib/rubygems/request_set/gem_dependency_api.rb +46 -49
- data/lib/rubygems/request_set/lockfile/parser.rb +18 -29
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +9 -9
- data/lib/rubygems/request_set/lockfile.rb +12 -12
- data/lib/rubygems/request_set.rb +52 -25
- data/lib/rubygems/requirement.rb +32 -21
- data/lib/rubygems/resolver/activation_request.rb +6 -6
- data/lib/rubygems/resolver/api_set.rb +5 -6
- data/lib/rubygems/resolver/api_specification.rb +2 -3
- data/lib/rubygems/resolver/best_set.rb +5 -6
- data/lib/rubygems/resolver/composed_set.rb +5 -6
- data/lib/rubygems/resolver/conflict.rb +5 -5
- data/lib/rubygems/resolver/current_set.rb +1 -2
- data/lib/rubygems/resolver/dependency_request.rb +4 -4
- data/lib/rubygems/resolver/git_set.rb +5 -6
- data/lib/rubygems/resolver/git_specification.rb +4 -5
- data/lib/rubygems/resolver/index_set.rb +5 -6
- data/lib/rubygems/resolver/index_specification.rb +3 -4
- data/lib/rubygems/resolver/installed_specification.rb +3 -4
- data/lib/rubygems/resolver/installer_set.rb +12 -12
- data/lib/rubygems/resolver/local_specification.rb +1 -2
- data/lib/rubygems/resolver/lock_set.rb +5 -6
- data/lib/rubygems/resolver/lock_specification.rb +7 -8
- data/lib/rubygems/resolver/requirement_list.rb +1 -1
- data/lib/rubygems/resolver/set.rb +2 -2
- data/lib/rubygems/resolver/source_set.rb +4 -5
- data/lib/rubygems/resolver/spec_specification.rb +1 -2
- data/lib/rubygems/resolver/specification.rb +10 -7
- data/lib/rubygems/resolver/stats.rb +1 -1
- data/lib/rubygems/resolver/vendor_set.rb +4 -5
- data/lib/rubygems/resolver/vendor_specification.rb +2 -3
- data/lib/rubygems/resolver.rb +14 -16
- data/lib/rubygems/s3_uri_signer.rb +183 -0
- data/lib/rubygems/safe_yaml.rb +18 -10
- data/lib/rubygems/security/policies.rb +1 -2
- data/lib/rubygems/security/policy.rb +25 -25
- data/lib/rubygems/security/signer.rb +72 -24
- data/lib/rubygems/security/trust_dir.rb +10 -10
- data/lib/rubygems/security.rb +21 -22
- data/lib/rubygems/security_option.rb +0 -1
- data/lib/rubygems/server.rb +21 -21
- data/lib/rubygems/source/git.rb +9 -10
- data/lib/rubygems/source/installed.rb +3 -4
- data/lib/rubygems/source/local.rb +7 -7
- data/lib/rubygems/source/lock.rb +4 -4
- data/lib/rubygems/source/specific_file.rb +5 -5
- data/lib/rubygems/source/vendor.rb +2 -3
- data/lib/rubygems/source.rb +16 -25
- data/lib/rubygems/source_list.rb +2 -2
- data/lib/rubygems/source_local.rb +0 -1
- data/lib/rubygems/spec_fetcher.rb +5 -6
- data/lib/rubygems/specification.rb +219 -558
- data/lib/rubygems/specification_policy.rb +407 -0
- data/lib/rubygems/stub_specification.rb +12 -17
- data/lib/rubygems/test_case.rb +161 -75
- data/lib/rubygems/test_utilities.rb +20 -35
- data/lib/rubygems/text.rb +6 -6
- data/lib/rubygems/uninstaller.rb +38 -27
- data/lib/rubygems/uri_formatter.rb +1 -2
- data/lib/rubygems/user_interaction.rb +37 -89
- data/lib/rubygems/util/licenses.rb +27 -1
- data/lib/rubygems/util/list.rb +1 -1
- data/lib/rubygems/util.rb +32 -14
- data/lib/rubygems/validator.rb +4 -5
- data/lib/rubygems/version.rb +15 -15
- data/lib/rubygems/version_option.rb +2 -3
- data/lib/rubygems.rb +71 -102
- data/rubygems-update.gemspec +43 -0
- data/setup.rb +2 -8
- data/test/rubygems/ca_cert.pem +74 -65
- data/test/rubygems/client.pem +103 -45
- data/test/rubygems/rubygems_plugin.rb +0 -1
- data/test/rubygems/simple_gem.rb +1 -1
- data/test/rubygems/ssl_cert.pem +78 -17
- data/test/rubygems/ssl_key.pem +25 -13
- data/test/rubygems/test_bundled_ca.rb +1 -1
- data/test/rubygems/test_config.rb +7 -2
- data/test/rubygems/test_gem.rb +205 -132
- data/test/rubygems/test_gem_bundler_version_finder.rb +4 -0
- data/test/rubygems/test_gem_command.rb +0 -1
- data/test/rubygems/test_gem_command_manager.rb +18 -3
- data/test/rubygems/test_gem_commands_build_command.rb +220 -15
- data/test/rubygems/test_gem_commands_cert_command.rb +69 -8
- data/test/rubygems/test_gem_commands_check_command.rb +1 -1
- data/test/rubygems/test_gem_commands_cleanup_command.rb +27 -1
- data/test/rubygems/test_gem_commands_contents_command.rb +1 -2
- data/test/rubygems/test_gem_commands_dependency_command.rb +33 -34
- data/test/rubygems/test_gem_commands_environment_command.rb +1 -0
- data/test/rubygems/test_gem_commands_fetch_command.rb +0 -1
- data/test/rubygems/test_gem_commands_generate_index_command.rb +0 -1
- data/test/rubygems/test_gem_commands_help_command.rb +7 -4
- data/test/rubygems/test_gem_commands_info_command.rb +44 -0
- data/test/rubygems/test_gem_commands_install_command.rb +79 -12
- data/test/rubygems/test_gem_commands_lock_command.rb +0 -1
- data/test/rubygems/test_gem_commands_open_command.rb +29 -0
- data/test/rubygems/test_gem_commands_outdated_command.rb +0 -1
- data/test/rubygems/test_gem_commands_owner_command.rb +93 -57
- data/test/rubygems/test_gem_commands_pristine_command.rb +65 -30
- data/test/rubygems/test_gem_commands_push_command.rb +54 -0
- data/test/rubygems/test_gem_commands_query_command.rb +102 -100
- data/test/rubygems/test_gem_commands_search_command.rb +0 -1
- data/test/rubygems/test_gem_commands_server_command.rb +0 -1
- data/test/rubygems/test_gem_commands_setup_command.rb +50 -15
- data/test/rubygems/test_gem_commands_signin_command.rb +1 -1
- data/test/rubygems/test_gem_commands_sources_command.rb +0 -1
- data/test/rubygems/test_gem_commands_specification_command.rb +2 -3
- data/test/rubygems/test_gem_commands_stale_command.rb +3 -2
- data/test/rubygems/test_gem_commands_uninstall_command.rb +161 -8
- data/test/rubygems/test_gem_commands_unpack_command.rb +17 -1
- data/test/rubygems/test_gem_commands_update_command.rb +19 -2
- data/test/rubygems/test_gem_commands_which_command.rb +0 -1
- data/test/rubygems/test_gem_commands_yank_command.rb +0 -1
- data/test/rubygems/test_gem_config_file.rb +4 -2
- data/test/rubygems/test_gem_dependency.rb +0 -1
- data/test/rubygems/test_gem_dependency_installer.rb +8 -5
- data/test/rubygems/test_gem_dependency_list.rb +6 -7
- data/test/rubygems/test_gem_dependency_resolution_error.rb +0 -1
- data/test/rubygems/test_gem_doctor.rb +1 -2
- data/test/rubygems/test_gem_ext_builder.rb +10 -23
- data/test/rubygems/test_gem_ext_cmake_builder.rb +5 -4
- data/test/rubygems/test_gem_ext_configure_builder.rb +3 -3
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +8 -9
- data/test/rubygems/test_gem_ext_rake_builder.rb +20 -5
- data/test/rubygems/test_gem_gem_runner.rb +0 -1
- data/test/rubygems/test_gem_gemcutter_utilities.rb +32 -6
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +0 -1
- data/test/rubygems/test_gem_indexer.rb +16 -10
- data/test/rubygems/test_gem_install_update_options.rb +1 -20
- data/test/rubygems/test_gem_installer.rb +154 -119
- data/test/rubygems/test_gem_local_remote_options.rb +3 -3
- data/test/rubygems/test_gem_name_tuple.rb +0 -1
- data/test/rubygems/test_gem_package.rb +77 -31
- data/test/rubygems/test_gem_package_old.rb +0 -1
- data/test/rubygems/test_gem_package_tar_header.rb +42 -2
- data/test/rubygems/test_gem_package_tar_reader.rb +0 -1
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +11 -0
- data/test/rubygems/test_gem_package_tar_writer.rb +43 -7
- data/test/rubygems/test_gem_package_task.rb +2 -2
- data/test/rubygems/test_gem_path_support.rb +28 -11
- data/test/rubygems/test_gem_platform.rb +4 -5
- data/test/rubygems/test_gem_rdoc.rb +1 -136
- data/test/rubygems/test_gem_remote_fetcher.rb +241 -141
- data/test/rubygems/test_gem_request.rb +9 -9
- data/test/rubygems/test_gem_request_connection_pools.rb +24 -3
- data/test/rubygems/test_gem_request_set.rb +5 -5
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +82 -64
- data/test/rubygems/test_gem_request_set_lockfile.rb +1 -2
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +4 -9
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +1 -1
- data/test/rubygems/test_gem_requirement.rb +24 -4
- data/test/rubygems/test_gem_resolver.rb +13 -17
- data/test/rubygems/test_gem_resolver_activation_request.rb +0 -1
- data/test/rubygems/test_gem_resolver_api_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_api_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_best_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_composed_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_conflict.rb +0 -1
- data/test/rubygems/test_gem_resolver_dependency_request.rb +0 -1
- data/test/rubygems/test_gem_resolver_git_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_git_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_index_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_index_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_installed_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_installer_set.rb +2 -3
- data/test/rubygems/test_gem_resolver_local_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_lock_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_lock_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_requirement_list.rb +0 -1
- data/test/rubygems/test_gem_resolver_specification.rb +1 -2
- data/test/rubygems/test_gem_resolver_vendor_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_vendor_specification.rb +0 -1
- data/test/rubygems/test_gem_security.rb +1 -3
- data/test/rubygems/test_gem_security_policy.rb +5 -6
- data/test/rubygems/test_gem_security_signer.rb +4 -3
- data/test/rubygems/test_gem_security_trust_dir.rb +1 -2
- data/test/rubygems/test_gem_server.rb +4 -4
- data/test/rubygems/test_gem_source.rb +0 -13
- data/test/rubygems/test_gem_source_fetch_problem.rb +0 -1
- data/test/rubygems/test_gem_source_git.rb +0 -1
- data/test/rubygems/test_gem_source_installed.rb +0 -1
- data/test/rubygems/test_gem_source_lock.rb +0 -1
- data/test/rubygems/test_gem_source_vendor.rb +0 -1
- data/test/rubygems/test_gem_spec_fetcher.rb +0 -1
- data/test/rubygems/test_gem_specification.rb +366 -198
- data/test/rubygems/test_gem_stream_ui.rb +15 -32
- data/test/rubygems/test_gem_stub_specification.rb +0 -2
- data/test/rubygems/test_gem_text.rb +4 -0
- data/test/rubygems/test_gem_uninstaller.rb +42 -3
- data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +0 -1
- data/test/rubygems/test_gem_uri_formatter.rb +0 -1
- data/test/rubygems/test_gem_util.rb +31 -11
- data/test/rubygems/test_gem_validator.rb +0 -1
- data/test/rubygems/test_gem_version.rb +11 -11
- data/test/rubygems/test_gem_version_option.rb +0 -1
- data/test/rubygems/test_remote_fetch_error.rb +0 -1
- data/test/rubygems/test_require.rb +67 -52
- data/util/CL2notes +1 -2
- data/util/ci +20 -12
- data/util/cops/deprecations.rb +52 -0
- data/util/create_certs.rb +6 -7
- data/util/create_certs.sh +27 -0
- data/util/create_encrypted_key.rb +4 -5
- data/util/patch_with_prs.rb +1 -1
- data/util/rubocop +8 -0
- data/util/update_bundled_ca_certificates.rb +12 -13
- data/util/update_changelog.rb +1 -1
- metadata +61 -51
- data/.autotest +0 -71
- data/.document +0 -5
- data/CONTRIBUTING.rdoc +0 -130
- data/CVE-2013-4287.txt +0 -35
- data/CVE-2013-4363.txt +0 -45
- data/CVE-2015-3900.txt +0 -40
- data/POLICIES.rdoc +0 -74
- data/test/rubygems/fix_openssl_warnings.rb +0 -13
@@ -33,6 +33,7 @@ permission to.
|
|
33
33
|
super 'owner', 'Manage gem owners of a gem on the push server'
|
34
34
|
add_proxy_option
|
35
35
|
add_key_option
|
36
|
+
add_otp_option
|
36
37
|
defaults.merge! :add => [], :remove => []
|
37
38
|
|
38
39
|
add_option '-a', '--add EMAIL', 'Add an owner' do |value, options|
|
@@ -61,7 +62,9 @@ permission to.
|
|
61
62
|
show_owners name
|
62
63
|
end
|
63
64
|
|
64
|
-
def show_owners
|
65
|
+
def show_owners(name)
|
66
|
+
Gem.load_yaml
|
67
|
+
|
65
68
|
response = rubygems_api_request :get, "api/v1/gems/#{name}/owners.yaml" do |request|
|
66
69
|
request.add_field "Authorization", api_key
|
67
70
|
end
|
@@ -76,20 +79,21 @@ permission to.
|
|
76
79
|
end
|
77
80
|
end
|
78
81
|
|
79
|
-
def add_owners
|
82
|
+
def add_owners(name, owners)
|
80
83
|
manage_owners :post, name, owners
|
81
84
|
end
|
82
85
|
|
83
|
-
def remove_owners
|
86
|
+
def remove_owners(name, owners)
|
84
87
|
manage_owners :delete, name, owners
|
85
88
|
end
|
86
89
|
|
87
|
-
def manage_owners
|
90
|
+
def manage_owners(method, name, owners)
|
88
91
|
owners.each do |owner|
|
89
92
|
begin
|
90
|
-
response =
|
91
|
-
|
92
|
-
|
93
|
+
response = send_owner_request(method, name, owner)
|
94
|
+
|
95
|
+
if need_otp? response
|
96
|
+
response = send_owner_request(method, name, owner, true)
|
93
97
|
end
|
94
98
|
|
95
99
|
action = method == :delete ? "Removing" : "Adding"
|
@@ -101,4 +105,14 @@ permission to.
|
|
101
105
|
end
|
102
106
|
end
|
103
107
|
|
108
|
+
private
|
109
|
+
|
110
|
+
def send_owner_request(method, name, owner, use_otp = false)
|
111
|
+
rubygems_api_request method, "api/v1/gems/#{name}/owners" do |request|
|
112
|
+
request.set_form_data 'email' => owner
|
113
|
+
request.add_field "Authorization", api_key
|
114
|
+
request.add_field "OTP", options[:otp] if use_otp
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
104
118
|
end
|
@@ -24,7 +24,8 @@ class Gem::Commands::PristineCommand < Gem::Command
|
|
24
24
|
|
25
25
|
add_option('--skip=gem_name',
|
26
26
|
'used on --all, skip if name == gem_name') do |value, options|
|
27
|
-
options[:skip]
|
27
|
+
options[:skip] ||= []
|
28
|
+
options[:skip] << value
|
28
29
|
end
|
29
30
|
|
30
31
|
add_option('--[no-]extensions',
|
@@ -45,6 +46,12 @@ class Gem::Commands::PristineCommand < Gem::Command
|
|
45
46
|
options[:env_shebang] = value
|
46
47
|
end
|
47
48
|
|
49
|
+
add_option('-n', '--bindir DIR',
|
50
|
+
'Directory where executables are',
|
51
|
+
'located') do |value, options|
|
52
|
+
options[:bin_dir] = File.expand_path(value)
|
53
|
+
end
|
54
|
+
|
48
55
|
add_version_option('restore to', 'pristine condition')
|
49
56
|
end
|
50
57
|
|
@@ -81,13 +88,13 @@ extensions will be restored.
|
|
81
88
|
end
|
82
89
|
|
83
90
|
def execute
|
84
|
-
specs = if options[:all]
|
91
|
+
specs = if options[:all]
|
85
92
|
Gem::Specification.map
|
86
93
|
|
87
94
|
# `--extensions` must be explicitly given to pristine only gems
|
88
95
|
# with extensions.
|
89
96
|
elsif options[:extensions_set] and
|
90
|
-
options[:extensions] and options[:args].empty?
|
97
|
+
options[:extensions] and options[:args].empty?
|
91
98
|
Gem::Specification.select do |spec|
|
92
99
|
spec.extensions and not spec.extensions.empty?
|
93
100
|
end
|
@@ -97,7 +104,7 @@ extensions will be restored.
|
|
97
104
|
end.flatten
|
98
105
|
end
|
99
106
|
|
100
|
-
if specs.to_a.empty?
|
107
|
+
if specs.to_a.empty?
|
101
108
|
raise Gem::Exception,
|
102
109
|
"Failed to find gems #{options[:args]} #{options[:version]}"
|
103
110
|
end
|
@@ -115,24 +122,21 @@ extensions will be restored.
|
|
115
122
|
next
|
116
123
|
end
|
117
124
|
|
118
|
-
if
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
if spec.bundled_gem_in_old_ruby?
|
124
|
-
say "Skipped #{spec.full_name}, it is bundled with old Ruby"
|
125
|
-
next
|
125
|
+
if options.has_key? :skip
|
126
|
+
if options[:skip].include? spec.name
|
127
|
+
say "Skipped #{spec.full_name}, it was given through options"
|
128
|
+
next
|
129
|
+
end
|
126
130
|
end
|
127
131
|
|
128
|
-
unless spec.extensions.empty? or options[:extensions] or options[:only_executables]
|
132
|
+
unless spec.extensions.empty? or options[:extensions] or options[:only_executables]
|
129
133
|
say "Skipped #{spec.full_name}, it needs to compile an extension"
|
130
134
|
next
|
131
135
|
end
|
132
136
|
|
133
137
|
gem = spec.cache_file
|
134
138
|
|
135
|
-
unless File.exist? gem or options[:only_executables]
|
139
|
+
unless File.exist? gem or options[:only_executables]
|
136
140
|
require 'rubygems/remote_fetcher'
|
137
141
|
|
138
142
|
say "Cached gem for #{spec.full_name} not found, attempting to fetch..."
|
@@ -150,22 +154,25 @@ extensions will be restored.
|
|
150
154
|
end
|
151
155
|
|
152
156
|
env_shebang =
|
153
|
-
if options.include? :env_shebang
|
157
|
+
if options.include? :env_shebang
|
154
158
|
options[:env_shebang]
|
155
159
|
else
|
156
160
|
install_defaults = Gem::ConfigFile::PLATFORM_DEFAULTS['install']
|
157
161
|
install_defaults.to_s['--env-shebang']
|
158
162
|
end
|
159
163
|
|
164
|
+
bin_dir = options[:bin_dir] if options[:bin_dir]
|
165
|
+
|
160
166
|
installer_options = {
|
161
167
|
:wrappers => true,
|
162
168
|
:force => true,
|
163
169
|
:install_dir => spec.base_dir,
|
164
170
|
:env_shebang => env_shebang,
|
165
171
|
:build_args => spec.build_args,
|
172
|
+
:bin_dir => bin_dir
|
166
173
|
}
|
167
174
|
|
168
|
-
if options[:only_executables]
|
175
|
+
if options[:only_executables]
|
169
176
|
installer = Gem::Installer.for_spec(spec, installer_options)
|
170
177
|
installer.generate_bin
|
171
178
|
else
|
@@ -15,6 +15,8 @@ https://rubygems.org) and adds it to the index.
|
|
15
15
|
|
16
16
|
The gem can be removed from the index and deleted from the server using the yank
|
17
17
|
command. For further discussion see the help for the yank command.
|
18
|
+
|
19
|
+
The push command will use ~/.gem/credentials to authenticate to a server, but you can use the RubyGems environment variable GEM_HOST_API_KEY to set the api key to authenticate.
|
18
20
|
EOF
|
19
21
|
end
|
20
22
|
|
@@ -33,6 +35,7 @@ command. For further discussion see the help for the yank command.
|
|
33
35
|
|
34
36
|
add_proxy_option
|
35
37
|
add_key_option
|
38
|
+
add_otp_option
|
36
39
|
|
37
40
|
add_option('--host HOST',
|
38
41
|
'Push to another gemcutter-compatible host',
|
@@ -79,7 +82,7 @@ command. For further discussion see the help for the yank command.
|
|
79
82
|
|
80
83
|
if latest_rubygems_version < Gem.rubygems_version and
|
81
84
|
Gem.rubygems_version.prerelease? and
|
82
|
-
Gem::Version.new('2.0.0.rc.2') != Gem.rubygems_version
|
85
|
+
Gem::Version.new('2.0.0.rc.2') != Gem.rubygems_version
|
83
86
|
alert_error <<-ERROR
|
84
87
|
You are using a beta release of RubyGems (#{Gem::VERSION}) which is not
|
85
88
|
allowed to push gems. Please downgrade or upgrade to a release version.
|
@@ -96,7 +99,7 @@ You can upgrade or downgrade to the latest release version with:
|
|
96
99
|
|
97
100
|
gem_data = Gem::Package.new(name)
|
98
101
|
|
99
|
-
unless @host
|
102
|
+
unless @host
|
100
103
|
@host = gem_data.spec.metadata['default_gem_server']
|
101
104
|
end
|
102
105
|
|
@@ -113,11 +116,10 @@ You can upgrade or downgrade to the latest release version with:
|
|
113
116
|
|
114
117
|
say "Pushing gem to #{@host || Gem.host}..."
|
115
118
|
|
116
|
-
response =
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
request.add_field "Authorization", api_key
|
119
|
+
response = send_push_request(name, args)
|
120
|
+
|
121
|
+
if need_otp? response
|
122
|
+
response = send_push_request(name, args, true)
|
121
123
|
end
|
122
124
|
|
123
125
|
with_response response
|
@@ -125,6 +127,16 @@ You can upgrade or downgrade to the latest release version with:
|
|
125
127
|
|
126
128
|
private
|
127
129
|
|
130
|
+
def send_push_request(name, args, use_otp = false)
|
131
|
+
rubygems_api_request(*args) do |request|
|
132
|
+
request.body = Gem.read_binary name
|
133
|
+
request.add_field "Content-Length", request.body.size
|
134
|
+
request.add_field "Content-Type", "application/octet-stream"
|
135
|
+
request.add_field "Authorization", api_key
|
136
|
+
request.add_field "OTP", options[:otp] if use_otp
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
128
140
|
def get_hosts_for(name)
|
129
141
|
gem_metadata = Gem::Package.new(name).spec.metadata
|
130
142
|
|
@@ -134,4 +146,3 @@ You can upgrade or downgrade to the latest release version with:
|
|
134
146
|
]
|
135
147
|
end
|
136
148
|
end
|
137
|
-
|
@@ -91,8 +91,8 @@ is too hard to use.
|
|
91
91
|
|
92
92
|
prerelease = options[:prerelease]
|
93
93
|
|
94
|
-
unless options[:installed].nil?
|
95
|
-
if no_name
|
94
|
+
unless options[:installed].nil?
|
95
|
+
if no_name
|
96
96
|
alert_error "You must specify a gem name"
|
97
97
|
exit_code |= 4
|
98
98
|
elsif name.count > 1
|
@@ -102,7 +102,7 @@ is too hard to use.
|
|
102
102
|
installed = installed? name.first, options[:version]
|
103
103
|
installed = !installed unless options[:installed]
|
104
104
|
|
105
|
-
if installed
|
105
|
+
if installed
|
106
106
|
say "true"
|
107
107
|
else
|
108
108
|
say "false"
|
@@ -119,8 +119,8 @@ is too hard to use.
|
|
119
119
|
|
120
120
|
private
|
121
121
|
|
122
|
-
def display_header
|
123
|
-
if (ui.outs.tty? and Gem.configuration.verbose) or both?
|
122
|
+
def display_header(type)
|
123
|
+
if (ui.outs.tty? and Gem.configuration.verbose) or both?
|
124
124
|
say
|
125
125
|
say "*** #{type} GEMS ***"
|
126
126
|
say
|
@@ -128,14 +128,14 @@ is too hard to use.
|
|
128
128
|
end
|
129
129
|
|
130
130
|
#Guts of original execute
|
131
|
-
def show_gems
|
131
|
+
def show_gems(name, prerelease)
|
132
132
|
req = Gem::Requirement.default
|
133
133
|
# TODO: deprecate for real
|
134
134
|
dep = Gem::Deprecate.skip_during { Gem::Dependency.new name, req }
|
135
135
|
dep.prerelease = prerelease
|
136
136
|
|
137
|
-
if local?
|
138
|
-
if prerelease and not both?
|
137
|
+
if local?
|
138
|
+
if prerelease and not both?
|
139
139
|
alert_warning "prereleases are always shown locally"
|
140
140
|
end
|
141
141
|
|
@@ -152,7 +152,7 @@ is too hard to use.
|
|
152
152
|
output_query_results spec_tuples
|
153
153
|
end
|
154
154
|
|
155
|
-
if remote?
|
155
|
+
if remote?
|
156
156
|
display_header 'REMOTE'
|
157
157
|
|
158
158
|
fetcher = Gem::SpecFetcher.fetcher
|
@@ -205,7 +205,7 @@ is too hard to use.
|
|
205
205
|
say output.join(options[:details] ? "\n\n" : "\n")
|
206
206
|
end
|
207
207
|
|
208
|
-
def output_versions
|
208
|
+
def output_versions(output, versions)
|
209
209
|
versions.each do |gem_name, matching_tuples|
|
210
210
|
matching_tuples = matching_tuples.sort_by { |n,_| n.version }.reverse
|
211
211
|
|
@@ -218,7 +218,7 @@ is too hard to use.
|
|
218
218
|
seen = {}
|
219
219
|
|
220
220
|
matching_tuples.delete_if do |n,_|
|
221
|
-
if seen[n.version]
|
221
|
+
if seen[n.version]
|
222
222
|
true
|
223
223
|
else
|
224
224
|
seen[n.version] = true
|
@@ -230,7 +230,7 @@ is too hard to use.
|
|
230
230
|
end
|
231
231
|
end
|
232
232
|
|
233
|
-
def entry_details
|
233
|
+
def entry_details(entry, detail_tuple, specs, platforms)
|
234
234
|
return unless options[:details]
|
235
235
|
|
236
236
|
name_tuple, spec = detail_tuple
|
@@ -247,11 +247,11 @@ is too hard to use.
|
|
247
247
|
spec_summary entry, spec
|
248
248
|
end
|
249
249
|
|
250
|
-
def entry_versions
|
250
|
+
def entry_versions(entry, name_tuples, platforms, specs)
|
251
251
|
return unless options[:versions]
|
252
252
|
|
253
253
|
list =
|
254
|
-
if platforms.empty? or options[:details]
|
254
|
+
if platforms.empty? or options[:details]
|
255
255
|
name_tuples.map { |n| n.version }.uniq
|
256
256
|
else
|
257
257
|
platforms.sort.reverse.map do |version, pls|
|
@@ -264,7 +264,7 @@ is too hard to use.
|
|
264
264
|
out = "default: #{out}" if default
|
265
265
|
end
|
266
266
|
|
267
|
-
if pls != [Gem::Platform::RUBY]
|
267
|
+
if pls != [Gem::Platform::RUBY]
|
268
268
|
platform_list = [pls.delete(Gem::Platform::RUBY), *pls.sort].compact
|
269
269
|
out = platform_list.unshift(out).join(' ')
|
270
270
|
end
|
@@ -276,7 +276,7 @@ is too hard to use.
|
|
276
276
|
entry << " (#{list.join ', '})"
|
277
277
|
end
|
278
278
|
|
279
|
-
def make_entry
|
279
|
+
def make_entry(entry_tuples, platforms)
|
280
280
|
detail_tuple = entry_tuples.first
|
281
281
|
|
282
282
|
name_tuples, specs = entry_tuples.flatten.partition do |item|
|
@@ -291,19 +291,19 @@ is too hard to use.
|
|
291
291
|
entry.join
|
292
292
|
end
|
293
293
|
|
294
|
-
def spec_authors
|
294
|
+
def spec_authors(entry, spec)
|
295
295
|
authors = "Author#{spec.authors.length > 1 ? 's' : ''}: ".dup
|
296
296
|
authors << spec.authors.join(', ')
|
297
297
|
entry << format_text(authors, 68, 4)
|
298
298
|
end
|
299
299
|
|
300
|
-
def spec_homepage
|
300
|
+
def spec_homepage(entry, spec)
|
301
301
|
return if spec.homepage.nil? or spec.homepage.empty?
|
302
302
|
|
303
303
|
entry << "\n" << format_text("Homepage: #{spec.homepage}", 68, 4)
|
304
304
|
end
|
305
305
|
|
306
|
-
def spec_license
|
306
|
+
def spec_license(entry, spec)
|
307
307
|
return if spec.license.nil? or spec.license.empty?
|
308
308
|
|
309
309
|
licenses = "License#{spec.licenses.length > 1 ? 's' : ''}: ".dup
|
@@ -311,10 +311,10 @@ is too hard to use.
|
|
311
311
|
entry << "\n" << format_text(licenses, 68, 4)
|
312
312
|
end
|
313
313
|
|
314
|
-
def spec_loaded_from
|
314
|
+
def spec_loaded_from(entry, spec, specs)
|
315
315
|
return unless spec.loaded_from
|
316
316
|
|
317
|
-
if specs.length == 1
|
317
|
+
if specs.length == 1
|
318
318
|
default = spec.default_gem? ? ' (default)' : nil
|
319
319
|
entry << "\n" << " Installed at#{default}: #{spec.base_dir}"
|
320
320
|
else
|
@@ -328,14 +328,14 @@ is too hard to use.
|
|
328
328
|
end
|
329
329
|
end
|
330
330
|
|
331
|
-
def spec_platforms
|
331
|
+
def spec_platforms(entry, platforms)
|
332
332
|
non_ruby = platforms.any? do |_, pls|
|
333
333
|
pls.any? { |pl| pl != Gem::Platform::RUBY }
|
334
334
|
end
|
335
335
|
|
336
336
|
return unless non_ruby
|
337
337
|
|
338
|
-
if platforms.length == 1
|
338
|
+
if platforms.length == 1
|
339
339
|
title = platforms.values.length == 1 ? 'Platform' : 'Platforms'
|
340
340
|
entry << " #{title}: #{platforms.values.sort.join ', '}\n"
|
341
341
|
else
|
@@ -351,7 +351,7 @@ is too hard to use.
|
|
351
351
|
end
|
352
352
|
end
|
353
353
|
|
354
|
-
def spec_summary
|
354
|
+
def spec_summary(entry, spec)
|
355
355
|
summary = truncate_text(spec.summary, "the summary for #{spec.full_name}")
|
356
356
|
entry << "\n\n" << format_text(summary, 68, 4)
|
357
357
|
end
|
@@ -60,7 +60,7 @@ Use --overwrite to force rebuilding of documentation.
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def execute
|
63
|
-
specs = if options[:all]
|
63
|
+
specs = if options[:all]
|
64
64
|
Gem::Specification.to_a
|
65
65
|
else
|
66
66
|
get_all_gem_names.map do |name|
|
@@ -68,7 +68,7 @@ Use --overwrite to force rebuilding of documentation.
|
|
68
68
|
end.flatten.uniq
|
69
69
|
end
|
70
70
|
|
71
|
-
if specs.empty?
|
71
|
+
if specs.empty?
|
72
72
|
alert_error 'No matching gems found'
|
73
73
|
terminate_interaction 1
|
74
74
|
end
|
@@ -78,7 +78,7 @@ Use --overwrite to force rebuilding of documentation.
|
|
78
78
|
|
79
79
|
doc.force = options[:overwrite]
|
80
80
|
|
81
|
-
if options[:overwrite]
|
81
|
+
if options[:overwrite]
|
82
82
|
FileUtils.rm_rf File.join(spec.doc_dir, 'ri')
|
83
83
|
FileUtils.rm_rf File.join(spec.doc_dir, 'rdoc')
|
84
84
|
end
|
@@ -94,4 +94,3 @@ Use --overwrite to force rebuilding of documentation.
|
|
94
94
|
end
|
95
95
|
|
96
96
|
end
|
97
|
-
|
@@ -9,7 +9,7 @@ class Gem::Commands::ServerCommand < Gem::Command
|
|
9
9
|
:port => 8808, :gemdir => [], :daemon => false
|
10
10
|
|
11
11
|
OptionParser.accept :Port do |port|
|
12
|
-
if port =~ /\A\d+\z/
|
12
|
+
if port =~ /\A\d+\z/
|
13
13
|
port = Integer port
|
14
14
|
raise OptionParser::InvalidArgument, "#{port}: not a port number" if
|
15
15
|
port > 65535
|
@@ -84,4 +84,3 @@ You can set up a shortcut to gem server documentation using the URL:
|
|
84
84
|
end
|
85
85
|
|
86
86
|
end
|
87
|
-
|