Debugging Radiant

Hey all,

I’m an old programmer that’s new to Ruby [on Rails] and Radiant and I’m
having debug trouble. I’m messing with the Back_Door extension and have
no
idea how to even output debug info to a log file. In other languages I
would use printf() or println() and I think there is a logger function
in
Ruby but I don’t know how to use it. The other thing I would like to do
is
breakpoint processing. Generally I like exploring a new language though
the
debugger and walking through object memory. Things like the “page”
object
in Radiant is a mystery to me right now. Are there debuggers
(graphical,
interactive) that would help me? How does everyone else (except Sean :slight_smile:
develop Radiant code? Surely not everyone has memorized the entire
object
model! :slight_smile:

Thanx!
Richard

Hi!,

A fast way to output debug info is to just use "puts" in your Ruby

code. The output will go to the console where you started the server
from.
Just put some markers in your output to distinguish it easily from all
the
output.

You can also write to Rails log directly using the @log object. Then
watch your output with something like “tail -f log/.log”. Or
create
your own log with http://www.ruby-doc.org/core/classes/Logger.html
(Rails
@log object is of this class).

For debugging, i recommend you http://www.datanoise.com/ruby-debug/ ,
it
works great with Rails. I don’t know if there is a GUI on top of that.
"rdebug script/server -e " is the magic command.

Regarding Radiant internals, you can refer to the source code. For
example, this is the Page class:
http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/models/page.rb
,
and the missing details are in the effective DB schema:
http://dev.radiantcms.org/radiant/browser/trunk/radiant/db/schema.rb .

I find myself looking at the standard tags model:
http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/models/standard_tags.rb.
It’s a great source of inspiration.

/AITOR

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs