require 'rubygems/commands/install_command' class Gem::Commands::InstallCommand unless respond_to? :execute_without_jars alias :execute_without_jars :execute def execute begin execute_without_jars rescue Gem::SystemExitException => e if e.exit_code == 0 puts "DO SOMETHING HERE WITH JARS" end raise e end end alias :_s_a_y_ :say def say( arg ) puts arg.sub( /.*\ /, '') _s_a_y_( arg ) end end end