Sha256: aaeaa6e5fa6609bdc945c017dfcae6f276d1702e139bc26d49ef212a430f3183

Contents?: true

Size: 191 Bytes

Versions: 5

Compression:

Stored size: 191 Bytes

Contents

# encoding: utf-8

require 'tty-command'

cmd = TTY::Command.new

stdin = StringIO.new
stdin.puts "hello"
stdin.puts "world"
stdin.rewind

out, _ = cmd.run(:cat, :in => stdin)

puts "#{out}"

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tty-command-0.4.0 examples/redirect_stdin.rb
tty-command-0.3.3 examples/redirect_stdin.rb
tty-command-0.3.2 examples/redirect_stdin.rb
tty-command-0.3.1 examples/redirect_stdin.rb
tty-command-0.3.0 examples/redirect_stdin.rb