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:

路路路

--
Posted via http://www.ruby-forum.com/.

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>

路路路

From: Kaspir Ghost <trevor@nugendesign.com>
Reply-To: <ruby-talk@ruby-lang.org>
Newsgroups: comp.lang.ruby
Date: Tue, 10 Aug 2010 05:39:22 +0900
To: ruby-talk ML <ruby-talk@ruby-lang.org>
Subject: 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:
--
Posted via http://www.ruby-forum.com/\.

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

路路路

On Mon, Aug 9, 2010 at 9:39 PM, Kaspir Ghost <trevor@nugendesign.com> wrote:

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:
--
Posted via http://www.ruby-forum.com/\.

--

gnome-open <url>

should work too.

路路路

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

In Ubuntu : Gnome : gnome-open Firefox

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}"

路路路

--
Posted via http://www.ruby-forum.com/.

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

路路路

--
Posted via http://www.ruby-forum.com/.