Ruby on Rails Friday, August 29, 2014

alias_method_chain seems very interesting. I will have a look at it, thanks.

On Tuesday, August 5, 2014 5:14:07 PM UTC+2, Matt Jones wrote:


On Monday, 4 August 2014 08:57:19 UTC-4, Martin Ennemoser wrote:
I have a ruby script which instruments Net::HTTP requests in Rails applications. This works as follows: When Ruby loads the Net::HTTP class, I alias the request method. At every http request, my instrumented method gets executed. So that this works, I need to execute my script BEFORE ruby loads the standard library and BEFORE Rails gets loaded.

Why do you need to load *before* Net::HTTP? If you use something like alias_method_chain, you can inject your wrapper after-the-fact.

Hard to troubleshoot much farther without seeing how you're hooking into Net::HTTP.

--Matt Jones

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7e1bfa92-a4f3-43d0-8caf-2d9c0638eb91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment