command line options hash

A

aidy

Hi,

I have an options hash map as a run method's second parameter

I am currently doing this

run File.join(File.dirname(__FILE__), "../projects/#{filename}", {"-
fh:" => "C:/rspec_reports/#{filename}.htm"})

But I am recieving this error

`join': can't convert Hash into String (TypeError)

Could anyone give me the correct syntax please?

Aidy
 
M

Mateusz Tybura

aidy said:
Hi,

I have an options hash map as a run method's second parameter

I am currently doing this

run File.join(File.dirname(__FILE__), "../projects/#{filename}", {"-
fh:" => "C:/rspec_reports/#{filename}.htm"})

But I am recieving this error

`join': can't convert Hash into String (TypeError)

Could anyone give me the correct syntax please?

Aidy

Try this:
run File.join(File.dirname(__FILE__), "../projects/#{filename}", "-
fh: => C:/rspec_reports/#{filename}.htm")
 
P

Pit Capitain

I have an options hash map as a run method's second parameter
run File.join(File.dirname(__FILE__), "../projects/#{filename}", {"-
fh:" => "C:/rspec_reports/#{filename}.htm"})

Aidy, you call the run method with only one parameter, the result of
File.join. The hash is the third parameter to File.join.

Regards,
Pit
 

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,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top