Skip to content

Instantly share code, notes, and snippets.

@code-later
Created November 17, 2010 17:16
Show Gist options
  • Save code-later/703671 to your computer and use it in GitHub Desktop.
Save code-later/703671 to your computer and use it in GitHub Desktop.
#!/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