defunkt / github-gem

`github` command line helper for simplifying your GitHub experience.
http://github.com
MIT License
1.12k stars 188 forks source link

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

Open huitseeker opened 13 years ago

huitseeker commented 13 years ago

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.

drnic commented 13 years ago

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

huitseeker commented 13 years ago

Yes, along the lines of something defunkt himself mentioned.

zaidaldossary30 commented 4 years ago

تم مسحه ضوئيًا_20181122-1119.pdf