In-memory session storage class.
Implements session storage as a global in-memory hash. Session
data will only persist for as long as the Ruby interpreter instance does.
Dummy session storage class.
Implements session storage place holder. No actual storage will be done.
PStore-based session storage class.
This builds upon the top-level PStore
class provided by the library file pstore.rb. Session
data is marshalled and stored in a file. File
locking and transaction services are provided.
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
See Request Headers.
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
See Request Headers.
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
See Request Headers.
Related:
Net::HTTP#propfind
: sends PROPFIND
request, returns response object.
Tokens where state should be ignored used for :on_comment, :on_heredoc_end, :on_embexpr_end
Ignored newlines can occasionally have a LABEL state attached to them, so we compare the state differently here.
The :line tracepoint event gets fired whenever the Ruby VM encounters an expression on a new line. The types of expressions that can trigger this event are:
if statements
unless statements
nodes that are children of statements lists
In order to keep track of the newlines, we have a list of offsets that come back from the parser. We assign these offsets to the first nodes that we find in the tree that are on those lines.
Note that the logic in this file should be kept in sync with the Java MarkNewlinesVisitor, since that visitor is responsible for marking the newlines for JRuby/TruffleRuby.
Searches for gems starting with the supplied argument.