Emacs commands for running Ruby code

Discussion in 'Ruby' started by francisrammeloo@hotmail.com, Aug 10, 2005.

  1. Guest

    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?

    Thanks in advance for any helpful hints.

    Best regards,
    Francis
     
    , Aug 10, 2005
    #1
    1. Advertising

  2. Jeffrey Moss Guest

    I use ruby GUD mode, M-x rubydb
    Then you need to type in the filename

    That way you can use GUD commands like insert breakpoint, although I haven't
    found a good way to restart the app.

    -Jeff

    ----- Original Message -----
    From: <>
    Newsgroups: comp.lang.ruby
    To: "ruby-talk ML" <>
    Sent: Wednesday, August 10, 2005 2:16 PM
    Subject: Emacs commands for running Ruby code


    > 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?
    >
    > Thanks in advance for any helpful hints.
    >
    > Best regards,
    > Francis
    >
    >
     
    Jeffrey Moss, Aug 10, 2005
    #2
    1. Advertising

  3. "" <> 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
     
    Forrest Chang, Aug 19, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Pfaff

    Re: man pages for C commands (GCC commands)

    Ben Pfaff, Jun 24, 2003, in forum: C Programming
    Replies:
    4
    Views:
    3,978
    Thomas Stegen
    Jun 28, 2003
  2. Replies:
    0
    Views:
    231
  3. Replies:
    0
    Views:
    93
  4. Adam Funk
    Replies:
    4
    Views:
    237
    Adam Funk
    Jan 29, 2007
  5. Replies:
    0
    Views:
    76
Loading...

Share This Page