1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Remove "req" command.

This commit is contained in:
Rob Gleeson 2011-05-18 02:03:28 +01:00
parent c253a1f405
commit 33b8f07661

View file

@ -26,7 +26,7 @@ class Pry
command "gem-list", "List/search installed gems. (Optional parameter: a regexp to limit the search)" do |pattern|
pattern = Regexp.new pattern.to_s, Regexp::IGNORECASE
gems = Gem.source_index.find_name(pattern).group_by(&:name)
gems = Gem.source_index.find_name(pattern).group_by(&:name)
gems.each do |gem, specs|
specs.sort! do |a,b|
@ -41,31 +41,6 @@ class Pry
end
end
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
if require gem
output.puts "#{text.bright_yellow(gem)} loaded"
else
output.puts "#{text.bright_white(gem)} already loaded"
end
rescue LoadError => e
if gem_installed? gem
output.puts e.inspect
else
output.puts "#{text.bright_red(gem)} not found"
if prompt("Install the gem?") == "y"
run "gem-install", gem
end
end
end # rescue
end # gems.each
end
end
end
end