Created
November 17, 2010 17:16
-
-
Save code-later/703671 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes.rb" | |
require "#{ENV['TM_SUPPORT_PATH']}/lib/ui.rb" | |
result = TextMate::UI.request_string( | |
:title => 'Open Rubygem', | |
:prompt => 'Name of the gem to open', | |
:default => ENV['TM_CURRENT_WORD'] || "", | |
:button1 => 'Open' | |
) | |
TextMate.exit_discard if result.nil? | |
result.strip! | |
# Let TM_GEM point to your RVM gem command | |
system("#{(ENV['TM_GEM'] || "gem")} edit -e mate #{result}") | |
puts "Gem not found" unless $? == 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment