'gem' removed; 'require' renamed to 'req'

This commit is contained in:
epitron 2011-04-19 02:19:57 -04:00
parent 0395da7e93
commit c70bc1d8e9
1 changed files with 16 additions and 19 deletions

View File

@ -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__')