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:
parent
c253a1f405
commit
33b8f07661
1 changed files with 1 additions and 26 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue