Module: Vimgem
Constant Summary collapse
- VERSION =
"0.2.0"
Instance Method Summary collapse
Instance Method Details
#browse(gem) ⇒ Object
4 5 6 7 8 |
# File 'lib/vimgem.rb', line 4 def browse(gem) return unless gem spec = get_gemspec(gem) exec_vim spec.full_gem_path if spec end |
#exec_vim(path) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/vimgem.rb', line 15 def exec_vim(path) case RUBY_PLATFORM when /linux/, /mswin/ `gvim #{path}` when /darwin/ `open -a macvim #{path}` end end |
#get_gemspec(gem) ⇒ Object
10 11 12 13 |
# File 'lib/vimgem.rb', line 10 def get_gemspec(gem) matches = Gem.source_index.find_name(gem) matches.first end |