CSV::InputsScanner receives IO
inputs, encoding and the chunk_size. It also controls the life cycle of the object with its methods keep_start
, keep_end
, keep_back
, keep_drop
.
CSV::InputsScanner.scan() tries to match with pattern at the current position. If there’s a match, the scanner advances the “scan pointer” and returns the matched string. Otherwise, the scanner returns nil.
CSV::InputsScanner.rest() returns the “rest” of the string (i.e. everything after the scan pointer). If there is no more data (eos? = true), it returns “”.
Class for representing HTTP method POST:
require 'net/http' uri = URI('http://example.com') hostname = uri.hostname # => "example.com" uri.path = '/posts' req = Net::HTTP::Post.new(uri) # => #<Net::HTTP::Post POST> req.body = '{"title": "foo","body": "bar","userId": 1}' req.content_type = 'application/json' res = Net::HTTP.start(hostname) do |http| http.request(req) end
Properties:
Request body: yes.
Response body: yes.
Safe: no.
Idempotent: no.
Cacheable: yes.
Related:
Net::HTTP.post
: sends POST
request, returns response object.
Net::HTTP#post
: sends POST
request, returns response object.
Class for representing HTTP method TRACE:
require 'net/http' uri = URI('http://example.com') hostname = uri.hostname # => "example.com" req = Net::HTTP::Trace.new(uri) # => #<Net::HTTP::Trace TRACE> res = Net::HTTP.start(hostname) do |http| http.request(req) end
Properties:
Request body: no.
Response body: yes.
Safe: yes.
Idempotent: yes.
Cacheable: no.
Related:
Net::HTTP#trace
: sends TRACE
request, returns response object.
Class for representing WebDAV method PROPFIND:
require 'net/http' uri = URI('http://example.com') hostname = uri.hostname # => "example.com" req = Net::HTTP::Propfind.new(uri) # => #<Net::HTTP::Propfind PROPFIND> res = Net::HTTP.start(hostname) do |http| http.request(req) end
Related:
Net::HTTP#propfind
: sends PROPFIND
request, returns response object.
Generates a index files for use as a gem server.
See ‘gem help generate_index`
Searches for gems starting with the supplied argument.
Raised when you haven’t provided enough input to your MockGemUi
Allows writing of tar files
A FetchError
that indicates that the reason for not being able to fetch data was that the host could not be contacted