I have a script that runs via a pipe and it doesn't seem to want to capture user input.
This is the simplest example:
echo "gets.chomp" | ruby
-:1: private method `chomp' called for nil:NilClass (NoMethodError)
The goal is to confirm an action (Are you sure you want to do this? yes / no: ). How can I capture input when using pipes?