github-gem icon indicating copy to clipboard operation
github-gem copied to clipboard

'gh browse' checks for launchy & fails if launchy installed, but not through gems

Open huitseeker opened this issue 15 years ago • 3 comments

The 'browse' command determines if I have launchy installed in the following fashion:

helper :has_launchy? do |blk|
  begin
    gem 'launchy'
    require 'launchy'
    blk.call
  rescue Gem::LoadError
    STDERR.puts "Sorry, you need to install launchy: `gem install launchy`"
  end  
end

Except that in some cases, I may have installed launchy through other means, such as using a package (e.g. the Debian/Ubuntu policy favors packages over gems, so this will apply when launchy is eventually packaged, or even right now using the most excellent thwarted/gem2deb ). In those cases, commenting gem 'launchy' above suffices to get 'gh browse' running.

huitseeker avatar Dec 10 '10 21:12 huitseeker

We could attempt to load it directly first, without gems, then failover to gems, then show the error?

drnic avatar Jan 31 '11 00:01 drnic

Yes, along the lines of something defunkt himself mentioned.

huitseeker avatar Feb 11 '11 15:02 huitseeker