You can set Windows ENV variables from the command line by using the set
command.
C:\> SET BROWSER=chrome
C:\> ruby watir1_environment.rb
You can find out more about set
at http://ss64.com/nt/set.html.
Alternatively, rather than using ENV['BROWSER']
you can access the ARGV
variable, which is an array of arguments passed at the command line. Just change your case statement to:
case ARGV[0]
This requires only the keyword, and not the -BROWSER=
.
C:\> ruby watir1_environment.rb chrome