Forum: Ruby on Rails Tracing the calls and classes

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
140c065a9604b5321768cbe02e91ef30?d=identicon&s=25 Anton Aylward (Guest)
on 2007-02-23 23:47
(Received via mailing list)
Is there any way, short of lot of log statements, to trace the execution
of
rails code?  Th reason I'm asking has to do with name space, inheritance
and
over-riding functions.

I'm preprocessing text before handing it to Redcloth so I have

     @text_to_render = MyRender.new( @text.to_s )

and

class MyRender

  ...
  def render(...)
     ...
  end
 ....
end

Not I know what

        @text_to_render.render

refers to :-)
but what is and isn't over-ridden?
If I use any of the depreciated Rails 'render_' family that eventually
calls
'render()' will this over-ride them?  Will it only NOT over-ride them if
I
invoke it with a MyRender class object

        @text_to_render.render( :action => ....
and
                        render( :action => ...


Or, to ask it another way. How can I override the Rails render and do a

       def render( @args )
     ... do my stuff ...
     optionally call the Rails 'render'
           ... do more of my stuff
       end

--
It is not wealth one asks for, but just enough to preserve one's
dignity, to
work unhampered, to be generous, frank and independent.
    W. Somerset Maugham, 'Of Human Bondage', 1915
D332266881d9f0c69f9277a483226739?d=identicon&s=25 Meech (Guest)
on 2007-02-24 00:00
(Received via mailing list)
You can use ruby-debug...

Gem install ruby-debug

rdebug script\server

help
140c065a9604b5321768cbe02e91ef30?d=identicon&s=25 Anton Aylward (Guest)
on 2007-02-24 00:40
(Received via mailing list)
Oh wow!

Yes, this makes it very clear what code is executed in the controller
and
what code is executed  in the view

Which begs the question - where's the best place for code?
Obviously there the app/controller and app/model but how should one
treat
app/helpers and /lib ??


Meech said the following on 02/23/2007 05:59 PM:
> You can use ruby-debug...
>
> Gem install ruby-debug
>
> rdebug script\server
>
> help
>
--
Five exclamation marks, the sure sign of an insane mind.
-- Terry Pratchett _Reaper Man_
8310c5a7c769345114597bcdef111488?d=identicon&s=25 Ben Munat (Guest)
on 2007-02-25 02:32
(Received via mailing list)
Meech wrote:
> You can use ruby-debug...
>
> Gem install ruby-debug
>
> rdebug script\server
>
> help

If I do this in my project directory, I get this output:

rdebug script/server
./script/server:2: require File.dirname(__FILE__) + '/../config/boot'
(rdb:1) help
ruby-debug help v.0.7.5
Available commands:
backtrace break catch cont delete display down eval exit finish frame
irb list method next p pp quit reload restart save script set step
tmate trace undisplay up var where

(rdb:1)

So, rdebug is running. But I don't get any response on localhost:3000.
I'm running mongrel if that makes a difference. A regular invocation of
script/server gives me:

=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready.  TERM => stop.  USR2 => restart.  INT => stop (no
restart).
** Rails signals registered.  HUP => reload (without restart).  It might
not work well.
** Mongrel available at 0.0.0.0:3000
** Use CTRL-C to stop.

Would really like to check out ruby-debug, but I'm kind of stumped on
this.

b
This topic is locked and can not be replied to.