Open browser

Is there a way to open a browser window from ruby, that works on
windows, linux and macos?

thx ck

···

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

Check out launchy. Its good for opening native applications.

http://rubyforge.org/projects/copiousfreetime/

launchy is there (used by heel).

···

On Dec 6, 2007, at 6:52 AM, Christian Kerth wrote:

Is there a way to open a browser window from ruby, that works on
windows, linux and macos?

thx ck
--
Posted via http://www.ruby-forum.com/\.

Not really easily.
You could possibly write code for each OS and many different possible browsers, then wrap all of it with a detect system function that which system to run code for, then check for browsers you can open...

However, if you're considering using a web-based user-interface for cross-platform, that's not a bad idea.
Thus the easiest way to open a browser window on 3 platforms is to get users to click on a link or bookmark!

···

On Dec 6, 2007, at 5:52 AM, Christian Kerth wrote:

Is there a way to open a browser window from ruby, that works on
windows, linux and macos?

Christian Kerth wrote:

Is there a way to open a browser window from ruby, that works on
windows, linux and macos?

thx ck

I'm not 100% sure, but I think you can just launch a URL in Windows and
it will open your default web browser at that page.

···

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

thefed wrote:

Check out launchy. Its good for opening native applications.

http://rubyforge.org/projects/copiousfreetime/

launchy is there (used by heel).

I installed this launchy gem and it works in general, but obviously not
in my context. I have a small wxruby app with just a task bar tray menu.
When i click on this tray icon i want the appolication to open the
browser and point to a certain address. The launchy call is processed
when i kill the application, not at clicking time.

any ideas? thx ck

···

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

The basic idea in pseudocode would be:

   command = windows ? 'start /B' : macosx ? 'open' : '???'
   system(%Q[#{command} "#{url}"])

The /B flag prevents start from creating a Window on Windows.

Problem is I don't think there's a cross-desktop/window manager launcher for Linux. You could look for "/usr/bin/firefox" or whatever but what if it is there but user's default browser is Konqueror?

-- fxn

···

On Dec 6, 2007, at 1:47 PM, Christian Kerth wrote:

thefed wrote:

Check out launchy. Its good for opening native applications.

http://rubyforge.org/projects/copiousfreetime/

launchy is there (used by heel).

I installed this launchy gem and it works in general, but obviously not
in my context. I have a small wxruby app with just a task bar tray menu.
When i click on this tray icon i want the appolication to open the
browser and point to a certain address. The launchy call is processed
when i kill the application, not at clicking time.

thefed wrote:
> Check out launchy. Its good for opening native applications.
>
> http://rubyforge.org/projects/copiousfreetime/
>
> launchy is there (used by heel).

I installed this launchy gem and it works in general, but obviously not
in my context. I have a small wxruby app with just a task bar tray menu.
When i click on this tray icon i want the appolication to open the
browser and point to a certain address. The launchy call is processed
when i kill the application, not at clicking time.

Have you tried forking, or launching a new ruby process to execute the
launchy call?

···

On Dec 6, 2007 6:47 AM, Christian Kerth <christian.kerth@dynamicmedia.at> wrote:

any ideas? thx ck
--
Posted via http://www.ruby-forum.com/\.

--
===Tanner Burson===
tanner.burson@gmail.com
http://www.tannerburson.com

it's called 'htmlview'

a @ http://codeforpeople.com/

···

On Dec 6, 2007, at 8:45 AM, Xavier Noria wrote:

Problem is I don't think there's a cross-desktop/window manager launcher for Linux. You could look for "/usr/bin/firefox" or whatever but what if it is there but user's default browser is Konqueror?

--
it is not enough to be compassionate. you must act.
h.h. the 14th dalai lama

Xavier Noria wrote:

Problem is I don't think there's a cross-desktop/window manager launcher for Linux. You could look for "/usr/bin/firefox" or whatever but what if it is there but user's default browser is Konqueror?

The general opener in KDE is:

kfmclient exec <url-or-file>

···

--
        vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

launchy does the forking internally for those OS's that support it.

enjoy,

-jeremy

···

On Fri, Dec 07, 2007 at 06:19:32AM +0900, Tanner Burson wrote:

On Dec 6, 2007 6:47 AM, Christian Kerth <christian.kerth@dynamicmedia.at> > wrote:

> thefed wrote:
> > Check out launchy. Its good for opening native applications.
> >
> > http://rubyforge.org/projects/copiousfreetime/
> >
> > launchy is there (used by heel).
>
> I installed this launchy gem and it works in general, but obviously not
> in my context. I have a small wxruby app with just a task bar tray menu.
> When i click on this tray icon i want the appolication to open the
> browser and point to a certain address. The launchy call is processed
> when i kill the application, not at clicking time.
>

Have you tried forking, or launching a new ruby process to execute the
launchy call?

--

Jeremy Hinegardner jeremy@hinegardner.org

Is it normally installed?

···

On Dec 6, 2007, at 10:31 PM, ara.t.howard wrote:

Problem is I don't think there's a cross-desktop/window manager launcher for Linux. You could look for "/usr/bin/firefox" or whatever but what if it is there but user's default browser is Konqueror?

it's called 'htmlview'

it's pretty common - but not universal. i would think something like

system "htmlview #{ uri } || firefox #{ uri } || mozilla #{ uri }"

etc would work. see what launchy does.

a @ http://codeforpeople.com/

···

On Dec 6, 2007, at 3:00 PM, Xavier Noria wrote:

Is it normally installed?

--
it is not enough to be compassionate. you must act.
h.h. the 14th dalai lama

Yup, this is sort of what launchy does on linux. Its a bit more
complicated, but something like this is the fall back.

enjoy,

-jeremy

···

On Fri, Dec 07, 2007 at 07:46:17AM +0900, ara.t.howard wrote:

On Dec 6, 2007, at 3:00 PM, Xavier Noria wrote:

Is it normally installed?

it's pretty common - but not universal. i would think something like

system "htmlview #{ uri } || firefox #{ uri } || mozilla #{ uri }"

etc would work. see what launchy does.

--

Jeremy Hinegardner jeremy@hinegardner.org