system
del módulo Kernel:
~/rubytesting/programmingRuby/src_of_programming_ruby_by_dave_thomas$ cat -n ex0678.rb 1 module Kernel 2 alias_method :old_system, :system 3 def system(*args) 4 result = old_system(*args) 5 puts "system(#{args.join(', ')}) returned #{result}" 6 result 7 end 8 end 9 10 system("date") 11 system("kangaroo", "-hop 10", "skippy")
~/rubytesting/programmingRuby/src_of_programming_ruby_by_dave_thomas$ ruby ex0678.rb domingo, 20 de noviembre de 2011, 11:21:19 GMT system(date) returned true system(kangaroo, -hop 10, skippy) returned false