On Feb 15, 2005, at 6:04 AM, Michael Gebhart wrote:

> currently I am doing my first steps with ruby. It's really great, but
> sometimes I'm doing some very stupid mistakes :) I only realize this, 
> when
> running the program and starting the function, where I have done the
> mistake. Is there any possibility to check the code before running it?
> Because if I do not run the function, I'll never see, that there is a
> error, which is followed by a crash. The problem is, that
> ruby doesn't know the types, the variables have. When I do:
>
> @variable.function
>
> ruby does not know, if the method "function" is avaibable or not. But
> nevertheless, is it possible to find out some errors without running 
> the
> program and starting the function?

As others have mentioned, unit testing is by far your best way to go. 
Not only will it help you write more ruby code in general (increasing 
your ruby-fu), but it'll prevent any problems you identify from coming 
back. It is still a runtime solution, but you get to control the 
environment and context. I suggest you check out ZenTest (below) to 
help get you jumpstarted.

--
ryand-ruby / zenspider.com - http://blog.zenspider.com/
http://rubyforge.org/projects/zentest/
http://www.zenspider.com/seattle.rb