copiousfreetime / launchy

A helper for launching cross-platform applications in a fire and forget manner.
https://github.com/copiousfreetime/launchy
ISC License
777 stars 60 forks source link

Do not complain about desktop environment if $BROWSER is set #33

Closed joliss closed 13 years ago

joliss commented 13 years ago

I am running launchy 2.0.4 on a Linux server. My $BROWSER points to a script that SSHes into a desktop machine and opens the URL (using a network mount if necessary).

This used to work fine in launchy 0.x, but now I get an error saying

 Failure in opening /home/ubuntu/src/mercury/tmp/capybara/capybara-201107252328479878930330.html with options {}: Current Desktop environment not found. Please file a bug at https://github.com/copiousfreetime/launchy/issues/new

I wish launchy would just Trust Me if it sees the $BROWSER variable and call it, even if it hasn't detected a desktop environment.

copiousfreetime commented 13 years ago

hrm, launchy should use $BROWSER if it is set over anything else

Can you set the environment variable LAUNCHY_DEBUG=true, run the command you are doing and then paste the output here?

joliss commented 13 years ago

Sure thing.

LAUNCHY_DEBUG: Checking if class Launchy::Application::Browser is the one for handles?(/home/ubuntu/src/mercury/tmp/capybara/capybara-20110730005618947432436.html)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFamily::Windows is the one for matches?(linux-gnu)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFamily::Darwin is the one for matches?(linux-gnu)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFamily::Nix is the one for matches?(linux-gnu)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::RubyEngine::Mri is the one for is_current_engine?(ruby)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFamily::Windows is the one for matches?(linux-gnu)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFamily::Darwin is the one for matches?(linux-gnu)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::HostOsFamily::Nix is the one for matches?(linux-gnu)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::RubyEngine::Mri is the one for is_current_engine?(ruby)}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::NixDesktopEnvironment::Kde is the one for is_current_desktop_environment?()}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::NixDesktopEnvironment::Gnome is the one for is_current_desktop_environment?()}
LAUNCHY_DEBUG: Checking if class Launchy::Detect::NixDesktopEnvironment::Xfce is the one for is_current_desktop_environment?()}
LAUNCHY_DEBUG: Launchy : Failure in opening /home/ubuntu/src/mercury/tmp/capybara/capybara-20110730005618947432436.html with options {}: Current Desktop environment not found. Please file a bug at https://github.com/copiousfreetime/launchy/issues/new
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/launchy-2.0.4/lib/launchy/detect/nix_desktop_environment.rb:18:in `detect'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/launchy-2.0.4/lib/launchy/applications/browser.rb:28:in `nix_app_list'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/launchy-2.0.4/lib/launchy/detect/host_os_family.rb:61:in `app_list'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/launchy-2.0.4/lib/launchy/applications/browser.rb:40:in `app_list'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/launchy-2.0.4/lib/launchy/applications/browser.rb:53:in `browser_cmdline'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/launchy-2.0.4/lib/launchy/applications/browser.rb:63:in `cmd_and_args'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/launchy-2.0.4/lib/launchy/applications/browser.rb:74:in `open'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/launchy-2.0.4/lib/launchy.rb:30:in `open'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/launchy-2.0.4/lib/launchy/deprecated.rb:14:in `visit'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/launchy-2.0.4/lib/launchy/deprecated.rb:7:in `run'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/capybara-1.0.0/lib/capybara/util/save_and_open_page.rb:26:in `open_in_browser'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/capybara-1.0.0/lib/capybara/util/save_and_open_page.rb:19:in `save_and_open_page'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/capybara-1.0.0/lib/capybara/session.rb:283:in `save_and_open_page'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/capybara-1.0.0/lib/capybara/dsl.rb:139:in `save_and_open_page'
LAUNCHY_DEBUG: /home/ubuntu/src/mercury/spec/integration/election_editor_spec.rb:10:in `block (3 levels) in <top (required)>'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example.rb:48:in `instance_eval'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example.rb:48:in `block in run'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example.rb:107:in `with_around_hooks'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example.rb:45:in `run'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:294:in `block in run_examples'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:290:in `map'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:290:in `run_examples'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:262:in `run'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:263:in `block in run'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:263:in `map'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:263:in `run'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:24:in `block (2 levels) in run'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:24:in `map'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:24:in `block in run'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/reporter.rb:12:in `report'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:21:in `run'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:80:in `run_in_process'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:69:in `run'
LAUNCHY_DEBUG: /var/lib/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:11:in `block in autorun'
Failure in opening /home/ubuntu/src/mercury/tmp/capybara/capybara-20110730005618947432436.html with options {}: Current Desktop environment not found. Please file a bug at https://github.com/copiousfreetime/launchy/issues/new
joliss commented 13 years ago

$BROWSER is set to host-open, and I verified that

"$BROWSER" /home/ubuntu/src/mercury/tmp/capybara/capybara-20110730005618947432436.html

works fine.

copiousfreetime commented 13 years ago

I just pushed version 2.0.5 which should be available in rubygems.org now. You can either do a gem update or directly download it https://rubygems.org/downloads/launchy-2.0.5.gem

Let me know if this works or not, and thanks again for the bug report.

joliss commented 13 years ago

Oh, that's so sweet of you to push out a bugfix release! I just tried it and it's working great indeed.

I'll close this issue -- thanks a lot!

copiousfreetime commented 13 years ago

No problem. I'm here to help. Let me know when you find more bugs :-).

And thanks for using launchy!