There is the one liner bash syntax for Ruby:
The -n option processes lines, the $_ magic variable yields from STDIN:
echo "Foo\nBar\nBaz" | ruby -ne 'puts $_.downcase!'
outputs "foo\nbar\nbaz"
The -p option processes lines and prints the output:
echo "My String" | ruby -pe '$_.downcase'
outputs "my string"
Just using -e allows you to pull all of STDIN with gets:
echo "My String" | ruby -e "puts gets.downcase"
is functionally equivalent to the last.
More references: https://www.notch8.com/bash-commands-ruby/