Convert Object#returning to Object#tap
Reported by Ben Klang | October 8th, 2010 @ 09:04 AM | in 1.0.0
ActiveSupport is very noisy about the fact that Object#returning is deprecated. The deprecation messages seem to appear starting in version ActiveSupport 2.3.9 and #returning is gone as of 3.0.0.
From what I can tell Object#tap is in Ruby 1.8.7, but not in
Ruby 1.8.6.
Before committing this support, please note any objections to this proposal in this ticket.
Comments and changes to this ticket
-
botp October 8th, 2010 @ 10:45 AM
Yes, pls use tap.
for ruby 1.8.6, you can simply do
class Object
def tap yield self self end
end
best regards -botp
-
Ludovic Gasc October 9th, 2010 @ 11:14 AM
We use Adhearsion with Debian Lenny and Squeeze.
This distribution provides Ruby 1.8.7.72 at least: http://packages.debian.org/lenny/ruby1.8From my point of view, you can change this dependency.
Yours.
-
Ben Klang October 9th, 2010 @ 02:03 PM
- State changed from new to fixcommitted
botp: Thanks for the reminder; your suggestion makes sense.
I have committed a fix which monkeypatches Object to provide #tap if it does not exist.
http://github.com/adhearsion/adhearsion/commit/9231b2346306722b6bed...
This commit looks pretty safe but testing would be appreciated. I have tested it with Ruby 1.8.6 and 1.8.7.
-
Ben Klang October 21st, 2010 @ 06:57 PM
- Tag set to activesupport, dependencies
-
Ben Klang October 28th, 2010 @ 10:43 AM
- State changed from fixcommitted to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป