It runs fine without line 10, "exec address", and produces:
file://K:/_Utilities/Apache/xampp/apache/htdocs/index.html
file://K:/_Utilities/Apache/xampp/htdocs/index.html
file://K:/_Utilities/Apache/xampp/htdocs/restricted/index.html
file://K:/_Utilities/Apache/xampp/licenses/gd/index.html
file://K:/_Utilities/Apache/xampp/php/docs/Structures_Graph/docs/html/index.html
But with line 10 active, I hang with:
K:\>ruby K:\_Projects\Ruby\_Ruby_Tests\TestDirTraversal
\TestDirTraversal.rb
file://K:/_Utilities/Apache/xampp/apache/htdocs/index.html
K:/_Projects/Ruby/_Ruby_Tests/TestDirTraversal/TestDirTraversal.rb:
10:in `exec': Invalid argument - file://K:/_Utilities/Apache/xampp/apache/htdocs/in
dex.html (Errno::EINVAL)
from K:/_Projects/Ruby/_Ruby_Tests/TestDirTraversal/
TestDirTraversal.rb:10:in `block in <main>'
[snip]
Of course, if I pasted these addresses on successive lines of Word
(with space characters appended to each), I'd have a series of
hyperlinks that could control-click to invoke the respective URLs in
Firefox.
Is there a way I can repair the code here to achieve the equivalent
effect with Ruby?
Thanks in advance for any education you may offer,
Richard
Yeah, I know, but my question is how to repair my code so that it
works. Or more specifically, what command can I take which accepts
the text of a URL as an argument and invokes my browser with that
command as an argument?
Do you have a further idea? I greatly appreciate learning any other
idea you might have on the question.
You're my hero!! I couldn't think of what command I could use to
invoke the browser on my machine. I wish I had possessed enough
imagination to at least try that idea before posting my question. I
did harbor the fancy of poking through Rails source code, thinking I
might find a clue there. But that seemed daunting to me.
The launchy gem looks cool. The page I found it on also advertised
Process Explorer from SysInternals that replaces Window's
StartMenu ... something I've wanted for a long time. So, it's a
double-hitter.
Yeah, I know, but my question is how to repair my code so that it
works. Or more specifically, what command can I take which accepts
the text of a URL as an argument and invokes my browser with that
command as an argument?
Thanks for that link in your second post. I only received it about an
hour after your original response, which only pointed out that I
lacked a function reference. Hence my request for further idea(s).
Now I have a wealth of good solutions: Yours, Colin's and Fred's