YAML iteration

A

aidy

Hi,

This is the YAML

test: tiscali1
url: http://tiscali3-test.vizumi.com/
first_name: aidy
surname: smith
email: '(e-mail address removed)'
password: password
registration: KJHDF123

test: tiscali2
url: http://tiscali3-test.vizumi.com/
first_name: aidy
surname: smith222
email: '(e-mail address removed)'
password: password
registration: KJHDF122

This is the code that is reading it:

<code>
def SmokeTest.create_from_yaml_file(filename)
data = YAML.load_file(filename)
obj = new(data['test'], data['url'])
obj.register(data['first_name'], data['surname'], data['email'],
data['password'], data['registration'])
obj

end


tiscali = SmokeTest.create_from_yaml_file('C:\test.yaml')
</code>

I would like to read the first YAML hash first, then the second and
any more, If the hash's are commneted out, i would like the data and
test to be ignored.

Aidy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,735
Latest member
HikmatRamazanov

Latest Threads

Top