Permalink
Browse files

Work with RVM gem paths.

  • Loading branch information...
1 parent 340d1b4 commit 4fb0b3c37d361a8a7617f17e3a63aa0fb12ea32a @nirvdrum committed Nov 22, 2010
Showing with 5 additions and 6 deletions.
  1. +2 −2 bin/edit_gem
  2. +3 −4 bin/gem_doc
View
@@ -5,6 +5,6 @@ if ARGV.first == '-l' || ARGV.first == '--list'
puts Gem.cache.map{ |s| s[1].name }.uniq.sort.join( "\n" )
else
gem_name = ARGV.first
- gem_info = Gem.cache.search( gem_name ).first
+ gem_info = Gem.cache.find_name(gem_name).first
system "mate #{gem_info.full_gem_path}"
-end
+end
View
@@ -1,12 +1,11 @@
#!/usr/bin/env ruby
require 'rubygems'
-
if ARGV.first == '-l' || ARGV.first == '--list'
puts Gem.cache.map{ |s| s[1].name }.uniq.sort.join( "\n" )
else
gem_name = ARGV.first
- gem_info = Gem.cache.search( gem_name ).first
- doc_file = File.join( gem_info.full_gem_path.gsub(/1\.8\/gems/, "1.8/doc"), 'rdoc/index.html' )
+ gem_info = Gem.cache.find_name(gem_name).first
+ doc_file = File.join(gem_info.full_gem_path.gsub("/gems/#{gem_name}", "/doc/#{gem_name}"), 'rdoc/index.html' )
system "open #{doc_file}"
-end
+end

0 comments on commit 4fb0b3c

Please sign in to comment.