Parses a given string as a blob that contains configuration for OpenSSL
.
If the source of the IO
is a file, then consider using parse_config.
Emit a scalar with value
Called when a scalar value
is found. The scalar may have an anchor
, a tag
, be implicitly plain
or implicitly quoted
value
is the string value of the scalar anchor
is an associated anchor or nil tag
is an associated tag or nil plain
is a boolean value quoted
is a boolean value style
is an integer indicating the string style
See the constants in Psych::Nodes::Scalar
for the possible values of style
Here is a YAML
document that exercises most of the possible ways this method can be called:
--- - !str "foo" - &anchor fun - many lines - | many newlines
The above YAML
document contains a list with four strings. Here are the parameters sent to this method in the same order:
# value anchor tag plain quoted style ["foo", nil, "!str", false, false, 3 ] ["fun", "anchor", nil, true, false, 1 ] ["many lines", nil, nil, true, false, 1 ] ["many\nnewlines\n", nil, nil, false, true, 4 ]
Parse the YAML
document contained in yaml
. Events will be called on the handler set on the parser instance.
See Psych::Parser
and Psych::Parser#handler
Returns a Psych::Parser::Mark
object that contains line, column, and index information.
Emit a scalar with value
, anchor
, tag
, and a plain
or quoted
string type with style
.
Enter error recovering mode. This method does not call on_error
.
Leave error recovering mode.
Starts the parser. init
is a data accumulator and is passed to the next event handler (as of Enumerable#inject
).
Logs a message
at the error (syslog warning) log level, or logs the message returned from the block.
Logs a message
at the warn (syslog notice) log level, or logs the message returned from the block.
Creates a GzipReader
or GzipWriter
associated with io
, passing in any necessary extra options, and executes the block with the newly created object just like File.open
.
The GzipFile
object will be closed automatically after executing the block. If you want to keep the associated IO
object open, you may call Zlib::GzipFile#finish
method in the block.
Reads at most maxlen bytes from the gziped stream but it blocks only if gzipreader has no data immediately available. If the optional outbuf argument is present, it must reference a String
, which will receive the data. It raises EOFError
on end of file.
See Zlib::GzipReader
documentation for a description.
Returns true
if the file is a character device, false
if it isn’t or if the operating system doesn’t support this feature.
File.stat("/dev/tty").chardev? #=> true
Parse a raw cookie string into a hash of cookie-name=>Cookie pairs.
cookies = CGI::Cookie.parse("raw_cookie_string") # { "name1" => cookie1, "name2" => cookie2, ... }
A set of tasks to prepare the file in order to parse it
Returns true
if U
, and hence A
, is singular.
A setter to toggle transfers in binary mode. newmode
is either true
or false
Puts the connection into binary (image) mode, issues the given command, and fetches the data returned, passing it to the associated block in chunks of blocksize
characters. Note that cmd
is a server command (such as “RETR myfile”).