command line options hash

Discussion in 'Ruby' started by aidy, Aug 18, 2008.

  1. aidy

    aidy Guest

    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
     
    aidy, Aug 18, 2008
    #1
    1. Advertisements

  2. Try this:
    run File.join(File.dirname(__FILE__), "../projects/#{filename}", "-
    fh: => C:/rspec_reports/#{filename}.htm")
     
    Mateusz Tybura, Aug 18, 2008
    #2
    1. Advertisements

  3. aidy

    Pit Capitain Guest

    I have an options hash map as a run method's second parameter
    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
     
    Pit Capitain, Aug 18, 2008
    #3
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.