Here's a workaround that I'm using. Ideally, the ruby source should be
changed to work with both command line uses of double quotes but this
should work for watir. It's not pretty but this has worked for me in
both versions 1.8.6-26 and 1.8.6-27. The older code branch uses \" to
indicate a double quote and the newer code branch uses """

 module PageContainer
    alias :old_eval_in_spawned_process :eval_in_spawned_process
    def eval_in_spawned_process(command)
      command.strip!
      load_path_code = _code_that_copies_readonly_array($LOAD_PATH,
'$LOAD_PATH')
      ruby_code = "require 'watir/ie'; "
      ruby_code << "pc = #{attach_command}; " # pc = page container
      if Date::parse(RUBY_RELEASE_DATE) >=  Date::parse("2008-01-11")
        ruby_code << "pc.instance_eval(\"#{command}\")"
        exec_string = (load_path_code + '; ' + ruby_code)
        exec_string = "start rubyw -e \"#{exec_string.gsub!('"','"""')}
\""
      else
        ruby_code << "pc.instance_eval(#{command.inspect})"
        exec_string = "start rubyw -e #{(load_path_code + '; ' +
ruby_code).inspect}"
      end
      system(exec_string)
    end
  end
end

Seems to me that ruby should be able to parse either way like Perl
does:

>perl -e "print \"test\""
test
>perl -e "print """test""""
test

I'll see if I can get the latest Ruby (1.9.x) and see how it's handled
there...

Hugh
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to