I write my yaml data by hand, this has helped me check that everything is OK.
------------------
require 'yaml'
require 'pp'
info_for_test = YAML::load( File.open('data_for_test.yml' ))
pp info_for_test
---------------------------------------
Since I came from the Perl world, I tend to think
that all the world's problems can be solved by always using a hash. So as
you can imagine, info_for_test would be a hash variable.
-pierre garigue
-----Original Message-----
From: Zeljko Filipin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 11, 2006 5:58 AM
To: [email protected]
Subject: Re: [Wtr-general] Read In from external file
I use yaml (http://yaml4r.sourceforge.net/). Try it, you will love it.
Zeljko
2006/1/11, Torres, Ben (HQP) <[EMAIL PROTECTED]>:
> Hello,
>
> Can Watir read from an external file and plug that data into a script?
> If so, how?
>
> Ex: I have var1 = city, var2 = state, var3 = zip. Can I have a file
> containing just different values for these variables and have the script
> take in these values:
>
> "San Francisco","California","94404"
> "Dallas","Texas","32345"
> "Miami","Florida","22342"
>
> So I will have my script run 3 times and each run will grab 1 line.
>
> Thanks in advance,
> Ben
>
>
> _______________________________________________
> Wtr-general mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-general
>
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general