Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Gem::GemcutterUtilities#with_response

with_response(response, error_prefix = nil) { |response| ... }

If response is an HTTP Success (2XX) response, yields the response if a block was given or shows the response body to the user.

If the response was not successful, shows an error to the user including the error_prefix and the response body. If the response was a permanent redirect, shows an error to the user including the redirect location.

See also #verify_api_key #update_scope also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0