RidiculousPower / sender

Adds :sender and :caller as well as other object-oriented backtrace methods to the built-in :callee and :method methods in Ruby 1.9.1.
https://rubygems.org/gems/sender
16 stars 4 forks source link

API #3

Open trans opened 13 years ago

trans commented 13 years ago

Looking at this API I can't help but think it could go a lot further if backtrace returned a type of Backtrace object which was Enumerable and then...

backtrace.each
backtrace.include?
backtrace.any?

etc.

Asher- commented 13 years ago

That does sound like a nice idea. I'm not going to implement it right now (as I have some other things going on atm), but I would be happy to merge it if you did it, and I will do so "later" if it doesn't get done before I get there - but I can't promise a time! :)

trans commented 13 years ago

If it were Ruby code I could whip it up in short order, but being C --sadly it's out of my league. But when you finally get too it, I think it will be a great lib. I've always felt Ruby needed a better way of working with backtraces. Maybe Matz will even consider it for inclusion in Ruby 1.9 proper.

ddebernardy commented 13 years ago

Including it in ruby 1.9 proper would be very sweet, yeah. I added a reference to this gem in two related tickets in the ruby-lang bug tracker. Maybe one of the core devs will take a look and find it compelling enough to include part or all of it.