-v
is just a shorter way of writing --verbose
, so they are the same thing. -w
turns on warnings, see http://www.caliban.org/ruby/rubyguide.shtml#warnings for more info about those.
Part 2:
-n
and -p
are not related to verbosity. They just loop your ruby script.
Run the following from your terminal:
ruby -n -e "puts 'hello world'"
Now press the enter key a few times. You should see:
hello world
hello world
hello world
Now do the same for -p
:
ruby -p -e "puts 'hello world'"
This just repeats what you typed before pressing enter.
asdf
hello world
asdf
hello world
asdfs
hello world
asdfs
34644
hello world
34644