Class: Gem::Commands::EitCommand
- Inherits:
-
Gem::Command
- Object
- Gem::Command
- Gem::Commands::EitCommand
- Defined in:
- lib/rubygems/commands/eit_command.rb
Instance Method Summary collapse
- #description ⇒ Object
- #eit ⇒ Object
- #exec(*args) ⇒ Object
- #execute ⇒ Object
-
#initialize ⇒ EitCommand
constructor
A new instance of EitCommand.
Constructor Details
#initialize ⇒ EitCommand
15 16 17 |
# File 'lib/rubygems/commands/eit_command.rb', line 15 def initialize super('eit', description) end |
Instance Method Details
#description ⇒ Object
11 12 13 |
# File 'lib/rubygems/commands/eit_command.rb', line 11 def description 'Edit the gem for a given name or edit the file for a given require path' end |
#eit ⇒ Object
32 33 34 |
# File 'lib/rubygems/commands/eit_command.rb', line 32 def eit ENV['GEM_EDITOR'] || ENV['EDITOR'] || 'vim' end |
#exec(*args) ⇒ Object
27 28 29 30 |
# File 'lib/rubygems/commands/eit_command.rb', line 27 def exec *args say(args.join(' ')) super end |
#execute ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/rubygems/commands/eit_command.rb', line 19 def execute ui = CapturedUI.new Gem::DefaultUserInteraction.use_ui(ui) do Gem::GemRunner.new.run(['path'] + [:args]) end exec(eit, ui.outs.string.strip) end |