Sha256: e7862cad74a88c066a05108a085f730cd9e680969bd32761f1971f2f5df1b511

Contents?: true

Size: 229 Bytes

Versions: 2

Compression:

Stored size: 229 Bytes

Contents

# encoding: utf-8

require 'tty-command'

cli = File.expand_path('cli', __dir__)
cmd = TTY::Command.new

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

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

puts "#{out}"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tty-command-0.8.1 examples/redirect_stdin.rb
tty-command-0.8.0 examples/redirect_stdin.rb