|
This post originated from an RSS feed registered with Ruby Buzz
by Eigen Class.
|
Original Post: evil.rb wants love
Feed Title: Eigenclass
Feed URL: http://feeds.feedburner.com/eigenclass
Feed Description: Ruby stuff --- trying to stay away from triviality.
|
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Eigen Class
Latest Posts From Eigenclass
|
|
evil.rb is an experimental library that
makes it possible to manipulate internal structures from the Ruby
interpreter.
If you're interested in the internals of the interpreter, evil.rb can prove an
excellent educational tool, since it allows you to peek into the object model,
method dispatching...
In the past, some people have been using evil.rb to
- change the class of an object
- manipulate the inheritance chain for fun and profit
- grab instance variables or singleton methods
- swap objects (ever heard of Object#become?)
- change the self context of a Proc (the way 1.9's instance_exec does)
- mess with the flags of an object (frozen, tainted...)
Here's a list of articles where evil.rb is used to extend Ruby or illustrate how the interpreter works (please drop a comment if you have additional pointers of interest):
Read more...
Read: evil.rb wants love