module Utils::IRB::String

def >>(filename)

Returns:
  • (Integer) - the number of bytes written to the file

Parameters:
  • filename (String) -- the path to the file where the string content will be written
def >>(filename)
  File.secure_write(filename, self)
end

def |(cmd)

Returns:
  • (String) - the output of the executed command

Parameters:
  • cmd (String) -- the shell command to execute
def |(cmd)
  IO.popen(cmd, 'w+') do |f|
    f.write self
    f.close_write
    return f.read
  end
end