h1. contextr h2. What ContextR is a library supporting "context-oriented programming (COP)":http://www.swa.hpi.uni-potsdam.de/cop/. h3. Version 1.0.1 This version includes the latest changes, that were introduced when finishing the thesis. Nothing, that changes the usage, performance or API, just minor refactorings inside the library. h3. Version 1.0.0 Along with my Master's thesis ending and my lightning talk at "euruko 2008":http://www.euruko2008.org, the first stable release of ContextR will be published. To reflect its status the version number reaches *1.0*. You may find documentation and examples in the @test@ directory or "on in your Browser on this website":test/introduction.html.
h3. Version 0.1.9 This is a review release. Again, lots of things changed, but I think to the better. There will be more coverage with the 0.2.0. Until then, have a look at the shiny new online "documentation":test/introduction.html h3. Version 0.1.1 In this release we have added code examples, that also act as tests. See "this blog article":http://www.contextr.org/2007/9/13/executable-code-in-usage-examples for more information. This brought vast feature coverage with test. An RSpec was added to allow even more test coverage. @Object#extend@ allows definition of class side context dependent behaviour. There have been minor changes to the reflection API. To fetch the currently active layers use @ContextR::active_layers@ and you will get an array of symbols representing them. @ContextR::layers@ gives all already defined layers, but they are not necessarily active or have been. h3. Version 0.1.0 This is the first release of ContextR after the 0.0.3 release. Since then a full redesign took place. The API changed entirely so make sure to not use this release with older code. We think, that the new API is more powerful and allows better code to be written with ContextR. Unfortunately it has some issues as well, but we consider them as less relevant than the other way around. If you have any problems or question concerning these changes, feel free to use the new "mailing list":http://groups.google.com/group/contextr - any hint is appreciated
h2. Installing
sudo gem install contextr
h2. The basics In your code use
require 'rubygems' 
require 'contextr'
and ContextR will be ready to use. ContextR should work on Ruby 1.8 and JRuby. h2. Prerequisites *To get ContextR running, you won't need anything but @rubygems@ and the @contextr@ gem* To run all *tests* and *documentation* generation you will need the following gems: * @rake@ * @hoe@ * @rspec@ * @maruku@ * @markaby@ * @literate_maruku@ h2. Demonstration of usage See the "online documentation":test/introduction.html for usage examples and some meta information or have a look at the other resources below. h2. Forum "http://groups.google.com/group/contextr":http://groups.google.com/group/contextr h2. Other resources h3. COP related * "COP at SWA at the HPI":http://www.swa.hpi.uni-potsdam.de/cop/ More information on other context-oriented programming libraries as well as papers and theoretical work can be found at the COP page of Prof. Hirschfeld's software architecture group at the HPI h3. ContextR related * "ContextR API documentation":http://contextr.rubyforge.org/rdoc * "RubyForge Project Page":http://rubyforge.org/projects/contextr * "Lightning Talk about ContextR at euruko 2008":ContextR_euruko_2008.pdf h3. Miscellaneous * "Author's Development Blog - The Ruby Ahead":http://www.nach-vorne.de * "ContextR Statistics on ohloh":http://www.ohloh.net/projects/5037 If context-oriented programming does not fit your needs to handle your cross-cutting concerns, have a look at aspect-oriented programming. There is a feature rich implementation for Ruby named "aquarium":http://aquarium.rubyforge.org. Alternatively you may find interest in feature-oriented programming. If all that does not help, feel free to drop me a note and tell me, what you are trying to achieve. h2. How to submit patches Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8z: Email the project owner":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8z-email, use the e-mail address below. The repository is "browseable via github":http://github.com/schmidt/contextr/tree/master. To get a copy to your machine use:
git clone git://github.com/schmidt/contextr.git
h2. License This code is free to use under the terms of the "Ruby license":http://www.ruby-lang.org/en/LICENSE.txt. h2. Contact Comments are welcome. Send an email to "Gregor Schmidt":mailto:ruby@schmidtwisser.de.