Yea, use as you wish. Be good to get an official version sorted if it's useful but happy for it to be integrated regardless..

I am using it here, mainly for unobtrusive logging but also for some observed / observer style behaviour. For the logger I introduce a class that configures itself dependent upon browser and applies an Around Advice to do method entry / exit stamping for debugging. If it's Firefox + Firebug it uses the console, else it just writes to a simple div.

Be good to see the code getting a going over in other contexts though to really test it out..

Matt

Ryan Gahl wrote:

Thanks, Matt. I downloaded the zip with plans to integrate your work into my current project when time permits. I didn't look at the zip yet, but I'm assuming from your words that the license for this permits that, correct?

On 8/30/06, Matt Spendlove <[EMAIL PROTECTED]> wrote:
All

As prompted by the actsAsDecorator() [1] thread I thought I'd post up
the library that I worked on for AOP. It's based on a lib from
dotvoid.com [2] that I had to hack to get it going cross browser (tested
IE6 + FF 1.5.0.6). The original script crashed IE but I am grateful for
the original work regardless.

The attached zip includes jsunit test so you can fire up the
testRunner.html and run AspectsTest.html to get and idea of usage. The
Aspects lib itself is only dependent on prototype.js

Any feedback etc welcome.

If it's deemed to be useful I am happy to tidy this stuff up for
inclusion in scriptaculous.

I see AspectsTest.html as _the_ doc for this lib but to give you a quick
idea of usage :

/*
* Add a around advice to an object INSTANCE.]
*
* //An Example advice :
* function myAroundAdvice() {
* alert('doing something before method execution');
* this.proceed();
* alert('doing something before method execution');
* }
*
* //Example usage :
* Aspects.addAround(myAroundAdvice, testClass, /test/);
*
* Where testClass is an instance of some object and we want to apply
* the advice to all methods from testClass
* whose name matches the regex /test/
*/

Best

Matt Spendlove

[1]
<http://groups.google.com/group/rubyonrails-spinoffs/browse_frm/thread/b63463c5e12ba29b/ffe6ce78bfef6d7c#ffe6ce78bfef6d7c>

[2] <http://www.dotvoid.com/view.php?id=43>

 









--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---

Reply via email to