Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Cut-based AOP for Ruby

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 try
Octocat-spinner-32 var
Octocat-spinner-32 work
Octocat-spinner-32 .gemspec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .ruby
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 Assembly
Octocat-spinner-32 Gemfile
Octocat-spinner-32 HISTORY.rdoc
Octocat-spinner-32 MANIFEST
Octocat-spinner-32 NOTICE.rdoc
Octocat-spinner-32 RCR.textile
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile

Cuts - Cut-based AOP for Ruby

Homepage | Source Code | Issue Tracker


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.


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.


Here is a quick and dirty example:

require 'cuts'

class C
  def f ; "f" ; end

cut :G < C do
  def f; '<'+super+'>' ; end

c =

c.f  #=> "&lt;f&gt;"

For detailed usage documentation, please refer to the API Documentation.


Install via RubyGems:

$ gem install cuts

Special Thanks

Special thanks to Peter Van Broekhoven. The man is a genius!


Cuts, Copyright © 2007 Thomas Sawyer & Peter Van Broekhoven

Cuts is distributable in accrodance with the FreeBSD License.

See NOTICE.rdoc for details.

Something went wrong with that request. Please try again.