This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Kaoru Kobo edited this page Dec 1, 2010
·
6 revisions
require "rhook"
# Trace TCPSocket output data.
TCPSocket._rhook.hack(:write) { |inv|
STDERR.print("> ", inv.args[0].inspect, "\n")
inv.call
}
- 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.
(Now under construction)
- Getting Started
- Basic Usage - AOP (Providing hook-point & adding hook)
- Basic Usage - Hack (Injecting hook-point from outside)
-
Learn More
- Hook procedure & invocation object.
{ |inv| ... }
- Binding to a paticular instance or a class.
- Multiple hooks and execution order.
- Hook procedure & invocation object.
-
Advanced Usage
- Enable / Disable hook.
- Hook group.
- Performance Note
- 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.