mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
installing a command now requires the necessary gems; also improved installation instruction formatting
This commit is contained in:
parent
6eba6f7a03
commit
a074208e87
1 changed files with 12 additions and 2 deletions
|
@ -112,8 +112,8 @@ class Pry
|
||||||
gems_not_installed = gems_needed.select { |g| !gem_installed?(g) }
|
gems_not_installed = gems_needed.select { |g| !gem_installed?(g) }
|
||||||
|
|
||||||
options[:stub_info] = proc do
|
options[:stub_info] = proc do
|
||||||
output.puts "\n#{name} requires the following gems to be installed: #{(gems_needed.join(", "))}"
|
output.puts "\nThe command '#{name}' is unavailable because it requires the following gems to be installed: #{(gems_not_installed.join(", "))}"
|
||||||
output.puts "Command not available due to dependency on gems: `#{gems_not_installed.join(", ")}` not being met."
|
output.puts "-"
|
||||||
output.puts "Type `install #{name}` to install the required gems and activate this command."
|
output.puts "Type `install #{name}` to install the required gems and activate this command."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -257,6 +257,16 @@ class Pry
|
||||||
next if gem_install_failed
|
next if gem_install_failed
|
||||||
|
|
||||||
Gem.refresh
|
Gem.refresh
|
||||||
|
gems_to_install.each do |g|
|
||||||
|
begin
|
||||||
|
require g
|
||||||
|
rescue LoadError
|
||||||
|
output.puts "Required Gem: `#{g}` installed but not found?!. Aborting command installation."
|
||||||
|
gem_install_failed = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
next if gem_install_failed
|
||||||
|
|
||||||
command.options.delete :stub_info
|
command.options.delete :stub_info
|
||||||
output.puts "Installation of `#{name}` successful! Type `help #{name}` for information"
|
output.puts "Installation of `#{name}` successful! Type `help #{name}` for information"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue