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 idicating 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 ]
Another entry point for the parser. If you use this method, you must implement RECEIVER#METHOD_ID method.
RECEIVER#METHOD_ID is a method to get next token. It must ‘yield’ the token, which format is [TOKEN-SYMBOL, VALUE].
Enter error recovering mode. This method does not call on_error
.
Leave error recovering mode.
The line number of the current token. This value starts from 1. This method is valid only in event handlers.
Starts the parser. init
is a data accumulator and is passed to the next event handler (as of Enumerable#inject
).
Returns the netmask address of ifaddr. nil is returned if netmask is not available in ifaddr.
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.
The line number of the last row read from this file.
Specify line number of the last row read from this file.
Resets the position of the file pointer to the point created the GzipReader
object. The associated IO
object needs to respond to the seek
method.
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.
See Zlib::GzipReader
documentation for a description.
This is a deprecated alias for each_line
.
See Zlib::GzipReader
documentation for a description.
Returns true
if the effective user id of the process is the same as the owner of stat.
File.stat("testfile").owned? #=> true File.stat("/etc/passwd").owned? #=> false
Returns true if the effective group id of the process is the same as the group id of stat. On Windows NT, returns false
.
File.stat("testfile").grpowned? #=> true File.stat("/etc/passwd").grpowned? #=> false
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, ... }
Returns true
if U
, and hence A
, is singular.