From ca74c876ed4aa2c4cc30e41f5eabd6cf5aadc05a Mon Sep 17 00:00:00 2001 From: Kyrylo Silin Date: Wed, 20 Feb 2013 13:06:17 +0200 Subject: [PATCH] Command::InstallCommand: print explanation when a command is not found Don't raise `NoMethodError`. --- lib/pry/commands/install_command.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/pry/commands/install_command.rb b/lib/pry/commands/install_command.rb index 5350c7ef..acafe7b3 100644 --- a/lib/pry/commands/install_command.rb +++ b/lib/pry/commands/install_command.rb @@ -15,6 +15,11 @@ class Pry require 'rubygems/dependency_installer' unless defined? Gem::DependencyInstaller command = find_command(name) + unless command + output.puts "Command #{ text.green(name) } is not found" + return + end + if command_dependencies_met?(command.options) output.puts "Dependencies for #{ text.green(name) } are met. Nothing to do" return