/usr/share/doc/ruby-session/examples/stdin.rb is in ruby-session 3.1.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #!/usr/bin/env ruby
$:.unshift '.', '..', 'lib', File.join('..','lib')
require 'session'
sh = Session::new
stdout, stderr = sh.execute('cat', :stdin => open('/etc/passwd'))
stdout.each{|line| print line}
stdin, stdout, stderr = "42\n", '', ''
sh.execute('cat', 0 => stdin, 1 => stdout, 2 => stderr)
stdout.each{|line| print line}
|