Results for: "strip"

Returns true for IPv6 multicast address (ff00::/8). It returns false otherwise.

No documentation available

Adds list of ACL entries to this ACL.

Returns true if this is a lower triangular matrix.

No documentation available

Returns true if this is an upper triangular matrix.

Explicit conversion to a Matrix. Returns self

Return a single-column matrix from this vector

Compiled source code (String) on *eval methods on the :script_compiled event. If loaded from a file, it will return nil.

Compiled instruction sequence represented by a RubyVM::InstructionSequence instance on the :script_compiled event.

Note that this method is MRI specific.

Parse a YAML string in yaml. Returns the Psych::Nodes::Stream. This method can handle multiple YAML documents contained in yaml. filename is used in the exception message if a Psych::SyntaxError is raised.

If a block is given, a Psych::Nodes::Document node will be yielded to the block as it’s being parsed.

Raises a Psych::SyntaxError when a YAML syntax error is detected.

Example:

Psych.parse_stream("---\n - a\n - b") # => #<Psych::Nodes::Stream:0x00>

Psych.parse_stream("--- a\n--- b") do |node|
  node # => #<Psych::Nodes::Document:0x00>
end

begin
  Psych.parse_stream("--- `", filename: "file.txt")
rescue Psych::SyntaxError => ex
  ex.file    # => 'file.txt'
  ex.message # => "(file.txt): found character that cannot start any token"
end

Raises a TypeError when NilClass is passed.

See Psych::Nodes for more information about YAML AST.

Dump a list of objects as separate documents to a document stream.

Example:

Psych.dump_stream("foo\n  ", {}) # => "--- ! \"foo\\n  \"\n--- {}\n"

Load multiple documents given in yaml. Returns the parsed documents as a list. If a block is given, each document will be converted to Ruby and passed to the block during parsing

Example:

Psych.load_stream("--- foo\n...\n--- bar\n...") # => ['foo', 'bar']

list = []
Psych.load_stream("--- foo\n...\n--- bar\n...") do |ruby|
  list << ruby
end
list # => ['foo', 'bar']

Copies stream src to dest. src must respond to read(n) and dest must respond to write(str).

Copies stream src to dest. src must respond to read(n) and dest must respond to write(str).

Returns true if the contents of a stream a and b are identical.

Returns true if the contents of a stream a and b are identical.

Returns whether or not the constant const is defined.

See also have_const

Open3.pipeline_start starts a list of commands as a pipeline. No pipes are created for stdin of the first command and stdout of the last command.

Open3.pipeline_start(cmd1, cmd2, ... [, opts]) {|wait_threads|
  ...
}

wait_threads = Open3.pipeline_start(cmd1, cmd2, ... [, opts])
...

Each cmd is a string or an array. If it is an array, the elements are passed to Process.spawn.

cmd:
  commandline                              command line string which is passed to a shell
  [env, commandline, opts]                 command line string which is passed to a shell
  [env, cmdname, arg1, ..., opts]          command name and one or more arguments (no shell)
  [env, [cmdname, argv0], arg1, ..., opts] command name and arguments including argv[0] (no shell)

Note that env and opts are optional, as for Process.spawn.

Example:

# Run xeyes in 10 seconds.
Open3.pipeline_start("xeyes") {|ts|
  sleep 10
  t = ts[0]
  Process.kill("TERM", t.pid)
  p t.value #=> #<Process::Status: pid 911 SIGTERM (signal 15)>
}

# Convert pdf to ps and send it to a printer.
# Collect error message of pdftops and lpr.
pdf_file = "paper.pdf"
printer = "printer-name"
err_r, err_w = IO.pipe
Open3.pipeline_start(["pdftops", pdf_file, "-"],
                     ["lpr", "-P#{printer}"],
                     :err=>err_w) {|ts|
  err_w.close
  p err_r.read # error messages of pdftops and lpr.
}

Open3.pipeline_start starts a list of commands as a pipeline. No pipes are created for stdin of the first command and stdout of the last command.

Open3.pipeline_start(cmd1, cmd2, ... [, opts]) {|wait_threads|
  ...
}

wait_threads = Open3.pipeline_start(cmd1, cmd2, ... [, opts])
...

Each cmd is a string or an array. If it is an array, the elements are passed to Process.spawn.

cmd:
  commandline                              command line string which is passed to a shell
  [env, commandline, opts]                 command line string which is passed to a shell
  [env, cmdname, arg1, ..., opts]          command name and one or more arguments (no shell)
  [env, [cmdname, argv0], arg1, ..., opts] command name and arguments including argv[0] (no shell)

Note that env and opts are optional, as for Process.spawn.

Example:

# Run xeyes in 10 seconds.
Open3.pipeline_start("xeyes") {|ts|
  sleep 10
  t = ts[0]
  Process.kill("TERM", t.pid)
  p t.value #=> #<Process::Status: pid 911 SIGTERM (signal 15)>
}

# Convert pdf to ps and send it to a printer.
# Collect error message of pdftops and lpr.
pdf_file = "paper.pdf"
printer = "printer-name"
err_r, err_w = IO.pipe
Open3.pipeline_start(["pdftops", pdf_file, "-"],
                     ["lpr", "-P#{printer}"],
                     :err=>err_w) {|ts|
  err_w.close
  p err_r.read # error messages of pdftops and lpr.
}

Adds a post-install hook that will be passed an Gem::Installer instance when Gem::Installer#install is called

Adds a post-uninstall hook that will be passed a Gem::Uninstaller instance and the spec that was uninstalled when Gem::Uninstaller#uninstall is called

Returns the status of the last executed child process in the current thread.

Process.wait Process.spawn("ruby", "-e", "exit 13")
Process.last_status   #=> #<Process::Status: pid 4825 exit 13>

If no child process has ever been executed in the current thread, this returns nil.

Process.last_status   #=> nil
No documentation available
No documentation available
Search took: 4ms  ·  Total Results: 1474