Discard changes that have not been committed and revert the last commit
Cannot revert the first commit
Returns URL-escaped string following RFC 3986.
Returns URL-unescaped string following RFC 3986.
define methodname as instance method of current module, using ERB
object or eRuby file
define methodname as instance method of current module, using ERB
object or eRuby file
Sets the request body to a URL-encoded string derived from argument params
, and sets request header field 'Content-Type'
to 'application/x-www-form-urlencoded'
.
The resulting request is suitable for HTTP
request POST
or PUT
.
Argument params
must be suitable for use as argument enum
to URI.encode_www_form
.
With only argument params
given, sets the body to a URL-encoded string with the default separator '&'
:
req = Net::HTTP::Post.new('example.com') req.set_form_data(q: 'ruby', lang: 'en') req.body # => "q=ruby&lang=en" req['Content-Type'] # => "application/x-www-form-urlencoded" req.set_form_data([['q', 'ruby'], ['lang', 'en']]) req.body # => "q=ruby&lang=en" req.set_form_data(q: ['ruby', 'perl'], lang: 'en') req.body # => "q=ruby&q=perl&lang=en" req.set_form_data([['q', 'ruby'], ['q', 'perl'], ['lang', 'en']]) req.body # => "q=ruby&q=perl&lang=en"
With string argument sep
also given, uses that string as the separator:
req.set_form_data({q: 'ruby', lang: 'en'}, '|') req.body # => "q=ruby|lang=en"
Net::HTTPHeader#form_data=
is an alias for Net::HTTPHeader#set_form_data
.
Yields to a block and preserves the previous set of objects being printed.
Removes an object from the set of objects being pretty printed.
A pretty print for a pair of Hash
Creates a self-signed certificate with an issuer and subject from email
, a subject alternative name of email
and the given extensions
for the key
.
Retrieves the pre-configured API key key
or terminates interaction with an error.
Returns true when the user has enabled multifactor authentication from response
text and no otp provided by options.
Allows Gem::OptionParser
to handle HTTP URIs.
Asks for a password with a prompt
Asks the user to answer question
with an answer from the given list
.
Foo::Bar &&= baz ^^^^^^^^^^^^^^^^
Foo::Bar ||= baz ^^^^^^^^^^^^^^^^
Foo::Bar &&= baz ^^^^^^^^^^^^^^^^