In Python, you can do this:
import webbrowser
webbrowser.open_new("http://example.com/")
It will open the passed in url in the default browser
Is there a ruby equivalent?
In Python, you can do this:
import webbrowser
webbrowser.open_new("http://example.com/")
It will open the passed in url in the default browser
Is there a ruby equivalent?
Windows Only Solution:
require 'win32ole'
shell = WIN32OLE.new('Shell.Application')
shell.ShellExecute(...)
If it's windows and it's IE, try this: http://rubyonwindows.blogspot.com/search/label/watir also check out Selenium ruby: http://selenium.rubyforge.org/getting-started.html
HTH
Mac-only solution:
system("open", "http://stackoverflow.com/")
or
`open http://stackoverflow.com/`
Cross-platform solution
First, install the Launchy gem:
$ [sudo] gem install launchy
Then, you can run this:
require 'rubygems'
require 'launchy'
Launchy.open("http://stackoverflow.com")