Gentoo Archives: gentoo-commits

From: "Diego Petteno (flameeyes)" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-ruby/shotgun/files: shotgun-0.5-optional-launchy.patch
Date: Mon, 25 Jan 2010 18:55:59
Message-Id: E1NZU6P-0007Ad-Sx@stork.gentoo.org
1 flameeyes 10/01/25 18:55:57
2
3 Added: shotgun-0.5-optional-launchy.patch
4 Log:
5 Initial import of shotgun, a way to auto-relaod rackup servers.
6 (Portage version: 2.2_rc61/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 dev-ruby/shotgun/files/shotgun-0.5-optional-launchy.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-ruby/shotgun/files/shotgun-0.5-optional-launchy.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-ruby/shotgun/files/shotgun-0.5-optional-launchy.patch?rev=1.1&content-type=text/plain
13
14 Index: shotgun-0.5-optional-launchy.patch
15 ===================================================================
16 From 7d571983f5794f88c92560f1fc5061aa4ac12bac Mon Sep 17 00:00:00 2001
17 From: =?UTF-8?q?Diego=20Elio=20'Flameeyes'=20Petten=C3=B2?= <flameeyes@×××××.com>
18 Date: Mon, 25 Jan 2010 19:09:53 +0100
19 Subject: [PATCH] Don't fail away if launchy could not be loaded.
20
21 Since it's just a minor feature, make launchy optional this way.
22 ---
23 bin/shotgun | 8 ++++++--
24 1 files changed, 6 insertions(+), 2 deletions(-)
25
26 diff --git a/bin/shotgun b/bin/shotgun
27 index d618d29..e12c4d8 100755
28 --- a/bin/shotgun
29 +++ b/bin/shotgun
30 @@ -137,7 +137,11 @@ server.run app, options do |inst|
31 puts "== Shotgun starting #{server.to_s} on http://#{options[:Host]}:#{options[:Port]}"
32
33 if browse
34 - require 'launchy'
35 - Launchy.open("http://#{options[:Host]}:#{options[:Port]}#{options[:Path]}")
36 + begin
37 + require 'launchy'
38 + Launchy.open("http://#{options[:Host]}:#{options[:Port]}#{options[:Path]}")
39 + rescue LoadError
40 + $stderr.puts "Unable to load 'launchy', the browser won't be launched."
41 + end
42 end
43 end
44 --
45 1.6.6.1