summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands/owner_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/commands/owner_command.rb')
-rw-r--r--lib/rubygems/commands/owner_command.rb23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/rubygems/commands/owner_command.rb b/lib/rubygems/commands/owner_command.rb
index 4a0f7aa3e4..12bfe3a834 100644
--- a/lib/rubygems/commands/owner_command.rb
+++ b/lib/rubygems/commands/owner_command.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require_relative "../command"
require_relative "../local_remote_options"
require_relative "../gemcutter_utilities"
@@ -15,7 +16,7 @@ The owner command lets you add and remove owners of a gem on a push
server (the default is https://rubygems.org). Multiple owners can be
added or removed at the same time, if the flag is given multiple times.
-The supported user identifiers are dependant on the push server.
+The supported user identifiers are dependent on the push server.
For rubygems.org, both e-mail and handle are supported, even though the
user identifier field is called "email".
@@ -38,7 +39,7 @@ permission to.
add_proxy_option
add_key_option
add_otp_option
- defaults.merge! :add => [], :remove => []
+ defaults.merge! add: [], remove: []
add_option "-a", "--add NEW_OWNER", "Add an owner by user identifier" do |value, options|
options[:add] << value
@@ -78,7 +79,7 @@ permission to.
say "Owners for gem: #{name}"
owners.each do |owner|
- say "- #{owner['email'] || owner['handle'] || owner['id']}"
+ say "- #{owner["email"] || owner["handle"] || owner["id"]}"
end
end
end
@@ -93,14 +94,14 @@ permission to.
def manage_owners(method, name, owners)
owners.each do |owner|
- begin
- response = send_owner_request(method, name, owner)
- action = method == :delete ? "Removing" : "Adding"
-
- with_response response, "#{action} #{owner}"
- rescue
- # ignore
- end
+ response = send_owner_request(method, name, owner)
+ action = method == :delete ? "Removing" : "Adding"
+
+ with_response response, "#{action} #{owner}"
+ rescue Gem::WebauthnVerificationError => e
+ raise e
+ rescue StandardError
+ # ignore early exits to allow for completing the iteration of all owners
end
end