Kaoru Kobo edited this page Dec 1, 2010 · 6 revisions
Clone this wiki locally


require "rhook"

# Trace TCPSocket output data.
TCPSocket._rhook.hack(:write) { |inv|
  STDERR.print("> ", inv.args[0].inspect, "\n")


  • You can do AOP(Aspect-Oriented Programming) with simple code.
  • You can provide hook-points in your app/library, and allows users to adding/customize the behavior from outside, without changing the code.
  • The 'hack' feature allows you to customize any existing methods in Ruby core/libraries/products.

User's Guide

(Now under construction)


  • At first, try to search Issue Tracker.
  • Any questions, suggestions, and patches are welcome.
    • Please post them to the Issue Tracker.
    • I cannot understand English so well, so it's helpful you post with RSpec code that it satisfies your intention.
    • ( For Japanese user ) Also I can accept any issues in Japanese. Post them to the Google Group.