I like Ruby. I like it more than Python. It's my PERL replacement. I
used to use PERL for automated file management but I have switched to Ruby
because it is awesome and PERL blows. To be fair, I thought PERL was
awesome at the time but it's old news, now...
So, here I come, Ruby!
I'm starting to think that I can use Ruby for some serious software
development. I think a hardcore application can be written in a careful
combination of Ruby and C++ (and some other stuff, too!). So, I did a bit
of looking around which has only caused me to develop some questions...
Can anyone recommend a good IDE? Ah, the tired IDE question... I did a
search on groups.google on this subject and, yes, it is a common question.
However, every instance of it seems to have the same theme. Vi(m) is the
greatest text editor out there (I found Emacs too hard to learn). Syntax
highlighting is highly overrated and auto-completion is useless. What I
need from an IDE is a debugger! Even if it were as simple as the ability to
place breakpoints, step into and over lines of code, display evaluation
results (like what IRB does), and list variables in scope. It would also be
nice if it would let me evaluate methods of variables in scope, so I can try
to get the state of various objects. Seriously, I'm tired of printf
debugging (not that anyone uses printf in Ruby)...
Can anyone recommend a good... I don't know the proper term for this
but... a GUI toolkit? A widget toolkit? Something that allows me to create
and manage windows and widgets to put in those windows. I'll need the
ability to create new (custom) widgets and it would be nice if it were cross
platform...
Well, those are my questions, for now. I'll certainly be back if I have
any more and I will, of course, continue to lurk here as well as answer the
few questions I think I can answer competently! I'm really excited about
doing some serious Ruby development and I look forward to whatever
suggestions I get!
Thank you for your help...
What I need from an IDE is a debugger! Even if it were as simple as the
ability to place breakpoints, step into and over lines of code, display
evaluation results (like what IRB does), and list variables in scope.
You don't say if you have Visual Studio. If so, you can try out our Ruby In
Steel IDE. This has breakpoints, watch variables, locals, autos, step
into/over, run to, evaluate in a command window, syntax error location plus
code colouring/collapsing, Rails development tools etc. Not yet IntelliSense
but we are working on that at the moment...
Just to take things in a whole different direction, are you using test driven development? I've found that TDD has eliminated a lot of my need for debugging. It's a little like that printf debugging except that the printf's become asserts and you don't have to throw them away. They stay useful.
That being said, Eclipse's RDT is supposed to handle debugging, but I haven't had much luck with it so far.
-Mat
···
On Jul 11, 2006, at 5:55 AM, Just Another Victim of the Ambient Morality wrote:
Can anyone recommend a good IDE? Ah, the tired IDE question... I did a
search on groups.google on this subject and, yes, it is a common question.
However, every instance of it seems to have the same theme. Vi(m) is the
greatest text editor out there (I found Emacs too hard to learn). Syntax
highlighting is highly overrated and auto-completion is useless. What I
need from an IDE is a debugger! Even if it were as simple as the ability to
place breakpoints, step into and over lines of code, display evaluation
results (like what IRB does), and list variables in scope. It would also be
nice if it would let me evaluate methods of variables in scope, so I can try
to get the state of various objects. Seriously, I'm tired of printf
debugging (not that anyone uses printf in Ruby)...
Syntax highlighting is highly overrated and auto-completion is useless.
What I need from an IDE is a debugger! Even if it were as simple as the ability to
place breakpoints, step into and over lines of code, display evaluation
results (like what IRB does), and list variables in scope. It would also be
nice if it would let me evaluate methods of variables in scope, so I can try
to get the state of various objects. Seriously, I'm tired of printf
debugging (not that anyone uses printf in Ruby)...
Two suggestions, check out the breakpoint gem -- it is pretty much
what you say you want from a debugger. If what you really want is a
full IDE with a good integrated debugger, then you should check out
ArachnoEdit (ruby-ide.com). It is a commercial product, still in beta
that seems to get developed in a series of sprints. It has a custom
version of Ruby with a C extension for much faster debugging/stepping.
Can anyone recommend a good... I don't know the proper term for this
but... a GUI toolkit?
Check the archive, we _just_ had this discussion: FXRuby, QtRuby,
wxRuby seem to be the primary choices.
pth
···
On 7/11/06, Just Another Victim of the Ambient Morality <ihatespam@rogers.com> wrote:
Just Another Victim of the Ambient Morality wrote:
display evaluation results (like what IRB does)
I use the following method to do that:
<ruby>
def describe code
# takes a string to be eval'ed and prints it along with showing the
return value
sep = ' => '
begin
result = eval(code)
puts code + sep + result.inspect
return result
rescue Exception => e
puts code + sep + e.to_s
return nil
end
end
</ruby>
I then can issue the following to get a nice printout, and also get the
returned value of the statement. Example:
On Jul 11, 2006, at 2:45 PM, Daniel Schierbeck wrote:
Daniel Schierbeck wrote:
John wrote:
def describe code
# takes a string to be eval'ed and prints it along
> # with showing the return value
sep = ' => '
begin
result = eval(code)
puts code + sep + result.inspect
return result
rescue Exception => e
puts code + sep + e.to_s
return nil
end
end
Hi John,
You can write than method even more terse:
def describe code
sep = ' => '
result = eval(code)
puts code + sep + result.inspect
return result
rescue Exception => e
puts code + sep + e.to_s
# puts already returns nil
end
or perhaps even
def describe code
out = eval(code).inspect
rescue Exception => e
out = e.to_s; nil
ensure
puts code + " => " + out
end