Cuts - Cut-based AOP for Ruby
Homepage | Source Code | Issue Tracker
<img src=“http://travis-ci.org/rubyworks/cuts.png” />
Description
Cuts is an expiremental pure-Ruby implimentation of cut-base AOP. Cuts are a failry low-level system, so implementing them in pure-Ruby is no simple accomplishment, even for a language as reflective and metaprogrammable as Ruby.
History
Cuts started it’s life as a discussion about AOP on Ruby-talk, which led to a in-depth discussion between Trans and Peter Vanbroekhoven. The outcome of those talks were three projects. Suby an early expiremental branch of Ruby; the RCRFoundry, a section of the Ruby Garden Wiki dedicated to jointly developing RCRs; and the Cut-based AOP RCR. The RCR of course, ultimately led to this project, as well as an expiremental Ruby 1.8.3 core implementation (see the Suby homepage). We continue to touch up the RCR but on the whole it is now complete.
Please read Cut-based AOP for Ruby RCR.
This Cuts library comes by way of Ruby Facets, where the implementation was orginally housed. Becuase of it’s expiremental nature, it was deemd best to move it into it’s own project as part of the ongoing work to make Facets a rock solid library. Despite being expiremental, this implementation does pass it’s unit test. However, it has had litte trial in integrated tests. It will be interesting to see if this library, as it matures, can prove robust enough for production use. In either case, clearly it would be preferable to have a Ruby-core implementation instead, but that potential is completely in other persons hands.
Usage
Here is a quick and dirty example:
require 'cuts'
class C
def f ; "f" ; end
end
cut :G < C do
def f; '<'+super+'>' ; end
end
c = C.new
c.f #=> "<f>"
For detailed usage documentation, please refer to the API Documentation.
Install
Install via RubyGems:
$ gem install cuts
Special Thanks
Special thanks to Peter Van Broekhoven. The man is a genius!
Legal
(FreeBSD License)
Cuts, Copyright © 2007 Thomas Sawyer & Peter Van Broekhoven
See NOTICE.rdoc for details.