Sets the read timeout, in seconds, for self
to integer sec
; the initial value is 60.
Argument sec
must be a non-negative numeric value:
http = Net::HTTP.new(hostname) http.read_timeout # => 60 http.get('/todos/1') # => #<Net::HTTPOK 200 OK readbody=true> http.read_timeout = 0 http.get('/todos/1') # Raises Net::ReadTimeout.
Sets the write timeout, in seconds, for self
to integer sec
; the initial value is 60.
Argument sec
must be a non-negative numeric value:
_uri = uri.dup _uri.path = '/posts' body = 'bar' * 200000 data = <<EOF {"title": "foo", "body": "#{body}", "userId": "1"} EOF headers = {'content-type': 'application/json'} http = Net::HTTP.new(hostname) http.write_timeout # => 60 http.post(_uri.path, data, headers) # => #<Net::HTTPCreated 201 Created readbody=true> http.write_timeout = 0 http.post(_uri.path, data, headers) # Raises Net::WriteTimeout.
Executes a request which uses a representation and returns its body.
Return the character offset for the given byte offset.
Return the column number in characters for the given byte offset.
Return the character offset for the given byte offset.
Return the column number in characters for the given byte offset.
Unregister the Symbol
command
as a gem command.
Location of RubyGems.org credentials
Indicated, based on the requested domain, if local gems should be considered.
Return a list of the gem specifications in the dependency list, sorted in order so that no gemspec in the list depends on a gemspec earlier in the list.
This is useful when removing gems from a set of installed gems. By removing them in the returned order, you don’t get into as many dependency issues.
If there are circular dependencies (yuck!), then gems will be returned in order until only the circular dependents and anything they reference are left. Then arbitrary gemspecs will be returned until the circular dependency is broken, after which gems will be returned in dependency order again.
Ensure that the dependency is satisfied by the current installation of gem. If it is not an exception is raised.
Extracts only the bin/ files from the gem into the gem directory. This is used by default gems to allow a gem-aware stub to function without the full gem installed.
This is ported over from the yaml_tree in 1.9.3
True if version
satisfies this Requirement
.
remove trailing zeros segments before first letter or at the end of the version
Adds a runtime dependency named gem
with requirements
to this gem.
Usage:
spec.add_dependency 'example', '~> 1.1', '>= 1.1.4'