copiousfreetime/launchy — Issue #42: Do not raise exception of no launching program is found
Author: copiousfreetime
Created: 2012-02-01 18:02:38+00:00
State: open
Labels: bug

From @mfn comment on https://github.com/copiousfreetime/launchy/issues/29

While testing out https://github.com/gitlabhq/gitlabhq I came across this issue while playing around with it; this problem has nothing to do with gitlabhq, it's just that with latest launch due their Gemlock I can see this:

```
gitlab@vserv03:~/gitlabhq$ bundle exec launchy http://slashdot.org/
sh: xprop: not found
/home/gitlab/gitlabhq/vendor/bundle/ruby/1.9.1/gems/launchy-2.0.5/lib/launchy/detect/runner.rb:41:in `shell_commands': undefined method `shellsplit' for nil:NilClass (NoMethodError)
from /home/gitlab/gitlabhq/vendor/bundle/ruby/1.9.1/gems/launchy-2.0.5/lib/launchy/detect/runner.rb:104:in `block in wet_run'
from /home/gitlab/gitlabhq/vendor/bundle/ruby/1.9.1/gems/launchy-2.0.5/lib/launchy/detect/runner.rb:103:in `fork'
from /home/gitlab/gitlabhq/vendor/bundle/ruby/1.9.1/gems/launchy-2.0.5/lib/launchy/detect/runner.rb:103:in `wet_run'
from /home/gitlab/gitlabhq/vendor/bundle/ruby/1.9.1/gems/launchy-2.0.5/lib/launchy/detect/runner.rb:61:in `run'
from /home/gitlab/gitlabhq/vendor/bundle/ruby/1.9.1/gems/launchy-2.0.5/lib/launchy/application.rb:58:in `run'
from /home/gitlab/gitlabhq/vendor/bundle/ruby/1.9.1/gems/launchy-2.0.5/lib/launchy/applications/browser.rb:76:in `open'
from /home/gitlab/gitlabhq/vendor/bundle/ruby/1.9.1/gems/launchy-2.0.5/lib/launchy.rb:30:in `open'
from /home/gitlab/gitlabhq/vendor/bundle/ruby/1.9.1/gems/launchy-2.0.5/lib/launchy/cli.rb:72:in `good_run'
from /home/gitlab/gitlabhq/vendor/bundle/ruby/1.9.1/gems/launchy-2.0.5/lib/launchy/cli.rb:80:in `run'
from /home/gitlab/gitlabhq/vendor/bundle/ruby/1.9.1/gems/launchy-2.0.5/bin/launchy:4:in `'
from /home/gitlab/gitlabhq/vendor/bundle/ruby/1.9.1/bin/launchy:19:in `load'
from /home/gitlab/gitlabhq/vendor/bundle/ruby/1.9.1/bin/launchy:19:in `

'
```
It does not actually exhibit a real problem, it's just during e.g. loading the initial database there's seems to be something done using launchy which spams the screen full. After some searching I figured out it relates to launchy and did this simply test case.

I don't have cucumber installed, but I can give you the ruby output:

```
gitlab@vserv03:~/gitlabhq$ bundle exec ruby -rrbconfig -e "puts ::RbConfig::CONFIG['host_os']"
linux-gnu
```

This is a headless server so naturally there is no window manager installed thus no Xcfe and no xprop:

```
gitlab@vserv03:~/gitlabhq$ grep -r xprop *
vendor/bundle/ruby/1.9.1/gems/launchy-2.0.5/lib/launchy/detect/nix_desktop_environment.rb: %x[ xprop -root _DT_SAVE_MODE | grep ' = \"xfce\"$' ].strip.size > 0
```

hth