Sha256: e215c04bc32a4e703a08196e5582c00c330eaab591d7af905231402bb0808b8b
Contents?: true
Size: 530 Bytes
Versions: 13
Compression:
Stored size: 530 Bytes
Contents
# This extension adds a UNIX-style pipe to strings # # Synopsis: # # >> puts "UtilityBelt is better than alfalfa" | "cowsay" # ____________________________________ # < UtilityBelt is better than alfalfa > # ------------------------------------ # \ ^__^ # \ (oo)\_______ # (__)\ )\/\ # ||----w | # || || # => nil # class String def |(cmd) IO.popen(cmd, 'r+') do |pipe| pipe.write(self) pipe.close_write pipe.read end end end
Version data entries
13 entries across 13 versions & 6 rubygems