Module: Utils::IRB::String

Included in:
String
Defined in:
lib/utils/irb.rb

Instance Method Summary collapse

Instance Method Details

#>>(filename) ⇒ Object

Write this string into file filename.



407
408
409
# File 'lib/utils/irb.rb', line 407

def >>(filename)
  File.secure_write(filename, self)
end

#|(cmd) ⇒ Object

Pipe this string into cmd.



398
399
400
401
402
403
404
# File 'lib/utils/irb.rb', line 398

def |(cmd)
  IO.popen(cmd, 'w+') do |f|
    f.write self
    f.close_write
    return f.read
  end
end