Class: Gem::Commands::MateCommand

Inherits:
Gem::Command
  • Object
show all
Defined in:
lib/rubygems/commands/mate_command.rb

Instance Method Summary collapse

Constructor Details

#initializeMateCommand

Returns a new instance of MateCommand.



4
5
6
# File 'lib/rubygems/commands/mate_command.rb', line 4

def initialize
  super 'mate', 'Open gem source in TextMate'
end

Instance Method Details

#executeObject



8
9
10
11
12
# File 'lib/rubygems/commands/mate_command.rb', line 8

def execute
  index = Gem::SourceIndex.from_installed_gems
  spec = index.find_name(get_one_gem_name, Gem::Requirement.default).last
  exec 'mate', spec.full_gem_path
end

#usageObject



14
15
16
# File 'lib/rubygems/commands/mate_command.rb', line 14

def usage
  "#{program_name} GEMNAME"
end