From c70bc1d8e931460698730652ec45b7611e18b785 Mon Sep 17 00:00:00 2001 From: epitron Date: Tue, 19 Apr 2011 02:19:57 -0400 Subject: [PATCH] 'gem' removed; 'require' renamed to 'req' --- lib/pry/commands.rb | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/lib/pry/commands.rb b/lib/pry/commands.rb index 5bfa86e5..4d5c2227 100644 --- a/lib/pry/commands.rb +++ b/lib/pry/commands.rb @@ -59,22 +59,22 @@ class Pry alias_command "quit-program", "exit-program", "" alias_command "!!!", "exit-program", "" - command "gem", "rrrrrrrrrubygems!" do |*args| - gem_home = Gem.instance_variable_get(:@gem_home) + #command "gem", "rrrrrrrrrubygems!" do |*args| + # gem_home = Gem.instance_variable_get(:@gem_home) + # + # command = ["gem"] + args + # command.unshift "sudo" unless File.writable?(gem_home) + # + # output.puts "Executing: #{bright_yellow command.join(' ')}" + # if system(*command) + # Gem.refresh + # output.puts "Refreshed gem cache." + # else + # output.puts "Gem failed." + # end + #end - command = ["gem"] + args - command.unshift "sudo" unless File.writable?(gem_home) - - output.puts "Executing: #{bright_yellow command.join(' ')}" - if system(*command) - Gem.refresh - output.puts "Refreshed gem cache." - else - output.puts "Gem failed." - end - end - - command "gem-install", "gem stuff" do |gem_name| + command "gem-install", "Install a gem" do |gem_name| gem_home = Gem.instance_variable_get(:@gem_home) output.puts "Attempting to install gem: #{bold(gem_name)}" @@ -259,7 +259,7 @@ e.g: gist -d my_method end - command "require", "Requires gem(s). No need for quotes! (If the gem isn't installed, it will ask if you want to install it.)" do |*gems| + command "req", "Requires gem(s). No need for quotes! (If the gem isn't installed, it will ask if you want to install it.)" do |*gems| gems = gems.join(' ').gsub(',', '').split(/\s+/) gems.each do |gem| begin @@ -284,9 +284,6 @@ e.g: gist -d my_method end # gems end - alias_command "req", "require", "" - - command "whereami", "Show the code context for the session. Shows AROUND lines around the invocation line. AROUND defaults to 5 lines. " do |num| file = target.eval('__FILE__') line_num = target.eval('__LINE__')