Demo entry 2680468

a,rb

   

Submitted by anonymous on Sep 14, 2015 at 05:05
Language: Ruby. Code size: 614 Bytes.

set_trace_func(lambda do |event, file, line, id, binding, classname|
    puts("--> tracking (%8s) %s:%-2d %s#%s\n" % [event, file, line, classname, id])
end)

`echo ruby, is this a method?`


# disable code walker inspection
set_trace_func(nil)

module Kernel
  alias_method :__original_shell, :`

  define_method(:`) do |*args|
    puts "--> Shell Inspecting: arguments = #{args.inspect}"
    puts "--> Shell Inspecting: caller = #{caller.join("\n")}"
    ret = __original_shell(*args)
    puts "--> Shell Inspecting: return value =\n#{ret}"
    ret
  end
end

`echo ruby, is this a method?`

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).