Agilefreaks / Aquarium

An AOP library for Ruby
https://rubygems.org/gems/aquarium/
148 stars 24 forks source link

[#13395] Can't advice string or symbol objects. #2

Open hedgehog opened 14 years ago

hedgehog commented 14 years ago

Date: 2007-08-26 19:49
Priority: 2 Submitted By: Dean Wampler (deanwampler)
Assigned To: Dean Wampler (deanwampler) Category: Pointcut Handling State: Open

Summary: Can't advice string or symbol objects.

Detailed description

If you specify a string or symbol object with :object[s] => .... specifiers, when you actually want to match on that object, they are misinterpreted as the names of types.

The fix is to better disambiguate the handling of :type[s] vs. :object[s].

deanwampler commented 14 years ago

I need to move the list of issues from rubyforge to here. This is a known problem: http://rubyforge.org/tracker/index.php?func=detail&aid=13395&group_id=4281&atid=16494. Using :types would affect all strings. When using :objects, I have no way of knowing if you are referring to something else or the string/symbol itself. I should probably add a special case :string(s) option to work around. Other suggestions are welcome.

hedgehog commented 14 years ago

OK, I think you misunderstood... I'm about to start porting those RF issues over to Github. I just wanted your input on whether you wanted more info. If the above looks good I'll use that format. One change is that I'll change '[#13395]' to '[Rubyforge-13395]'.

The remark on :types vs :objects was from the original rubyforge entry :)

deanwampler commented 14 years ago

Yea, I wasn't clear; I got your point ;) Sorry. I'm fine with your recommendations for transferring the issues.