Calls the block with each capitalized field name:
res = Net::HTTP.get_response(hostname, '/todos/1') res.each_capitalized_name do |key| p key if key.start_with?('C') end
Output:
"Content-Type" "Connection" "Cache-Control" "Cf-Cache-Status" "Cf-Ray"
The capitalization is system-dependent; see Case Mapping.
Returns an enumerator if no block is given.
Sets header 'Proxy-Authorization'
using the given account
and password
strings:
req.proxy_basic_auth('my_account', 'my_password') req['Proxy-Authorization'] # => "Basic bXlfYWNjb3VudDpteV9wYXNzd29yZA=="
Returns whether the HTTP
session is to be kept alive.
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
.
Allows Gem::OptionParser
to handle HTTP URIs.
Add the –source option
Determines if current environment is eligible for update suggestion.
Asks the user to answer question
with an answer from the given list
.
Starts tracing object allocations.
Stop tracing object allocations.
Note that if ::trace_object_allocations_start
is called n-times, then tracing will stop after calling ::trace_object_allocations_stop
n-times.
Clear recorded tracing information.
If the SOURCE_DATE_EPOCH environment variable is set, returns it’s value. Otherwise, returns DEFAULT_SOURCE_DATE_EPOCH
as a string.
NOTE(@duckinator): The implementation is a tad weird because we want to:
1. Make builds reproducible by default, by having this function always return the same result during a given run. 2. Allow changing ENV['SOURCE_DATE_EPOCH'] at runtime, since multiple tests that set this variable will be run in a single process.
If you simplify this function and a lot of tests fail, that is likely due to #2 above.
Details on SOURCE_DATE_EPOCH: reproducible-builds.org/specs/source-date-epoch/
Return the value that should be dumped for the command_line option.
Initializes this object from orig if it can be duplicated/cloned and returns it.
Returns the string that is used to insert a space before the ‘:’ in JSON
objects.
Sets the string that is used to insert a space before the ‘:’ in JSON
objects.
If this boolean is true, the forward slashes will be escaped in the json output.
If this boolean is true, the forward slashes will be escaped in the json output.
This sets whether or not the forward slashes will be escaped in the json output.
Negate the value of a numeric node. This is a special case where you have a negative sign on one line and then a number on the next line. In normal Ruby
, this will always be a method call. The parser gem, however, marks this as a numeric literal. We have to massage the tree here to get it into the correct form.
Visit a numeric node and account for the optional sign.
Certain strings are merged into a single string token.