Accessing programs through the terminal with ruby

Specifically browsers. I’m trying to get a bunch of different browsers
(FF, Opera, Safari, IE, Chrome, and Fock) to all open the same url/file
location either 1) Simultaneously or 2) One after the other. Meaning one
browser open and when you close it out the next one opens.

So basically I need to know if it’s possible to submit commands to the
terminal to open browsers to a specific location.

I’m using the gnome-terminal in Ubuntu 10.04

Thanks in advance! :smiley:

In OS X : open /Applications/Tools/browsers/Firefox.app

In Ubuntu : Gnome : gnome-open Firefox

From irb: FIREFOX would be opened. Samething in Ubuntu

! irb
irb(main):001:0> open /Applications/Tools/browsers/Firefox.app
=> “”
irb(main):002:0>

You could try the launchy gem, its specifically for launching the
default
browser,
but the documentation might hint at other uses.

Tried all of these. None of them really seemed to work. Came across this
though, and it worked great.

#!/usr/bin/ruby
nugen = “http://www.nugendesign.com
system “firefox #{nugen}”

Ok so I started working on this a little bit and I basically have this
so far:

#!/usr/bin/ruby
puts “Enter url”
url = gets

system “firefox #{url}”
system “opera #{url}”
system “flock #{url}”

So far it’s doing exactly what I want it to do, but when it gets to
flock it does this:

flock: bad number: http://www.nugendesign.com

On 8/9/2010 1:58 PM, Joseph E. Savard wrote:

In Ubuntu : Gnome : gnome-open Firefox

gnome-open

should work too.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs