"francisrammeloo / hotmail.com" <francisrammeloo / hotmail.com> writes:

> Hi all,
>
> I have a question about running Ruby code with emacs.
> I figured out how to run a simple program, but I wonder if I am doing
> it the right way
>
> First I start an IRB process like this:
>    M-x run-ruby
>
> Then I run the sourcefile:
>    M-x ruby-load-file
>    Load Ruby file: (default Test.rb) c:/Program Files/Gnu Emacs
> 21.3/bin/Test.rb
>
>
> Is this the way I should run ruby code?  Or is there a better way?
>

        Depends on how you want to code.  Running the irb inferior and
zapping lines and loading files into irb is very lisp/REPL- y.  You
can run ruby files via emacs compile command.  Without any
modification, you can issue the compile command( m-x compile is one 1)
and then replace the default make command with your ruby command,
i.e. ruby -w foo.rb.  It wil run the file in a *compilation* buffer
that among other things can allow you to jump to both compile and
runtime errors.  I've hacked up mode-compile.el to recognize ruby
(larging by cutting pasting the perl entries and replace perl w/ruby).
What compile mode does is try to intelligently look at the current
buffer and apply the right "compiler"

Forrest

> Thanks in advance for any helpful hints.
>
> Best regards,
> Francis