indent.rb <- does such a beast exist?

Discussion in 'Ruby' started by Ben Giddings, Mar 4, 2005.

  1. Ben Giddings

    Ben Giddings Guest

    Does anybody have a standalone Ruby app and/or library that will
    properly indent a chunk of Ruby code? I'm looking for something that
    does the equivalent of "indent-region" in ruby-mode for Emacs.

    I know something like this exists in a few libraries -- I've heard talk
    about it from the ParseTree / RubyToC folks. I just wonder if anybody
    has packaged one up as a standalone app and/or library.

    I think it would be really useful to fix formatting issues if you don't
    have emacs handy. It could also be something you point newbies too who
    are copying and pasting code from websites and emails, which may or may
    not keep the formatting properly preserved. The added smugness factor
    is that you could never do it with Python. ;)

    Ben
    Ben Giddings, Mar 4, 2005
    #1
    1. Advertising

  2. Ben Giddings wrote:

    > Does anybody have a standalone Ruby app and/or library that will
    > properly indent a chunk of Ruby code? I'm looking for something that
    > does the equivalent of "indent-region" in ruby-mode for Emacs.
    >
    > I know something like this exists in a few libraries -- I've heard
    > talk about it from the ParseTree / RubyToC folks. I just wonder if
    > anybody has packaged one up as a standalone app and/or library.


    This is not a ruby solution, but vim will reformat ruby code if emacs
    isn't handy.

    vim -c "normal ggVG=" test.rb

    -ryan
    Ryan Phillips, Mar 4, 2005
    #2
    1. Advertising

  3. Ben Giddings wrote:

    > Does anybody have a standalone Ruby app and/or library that will
    > properly indent a chunk of Ruby code? I'm looking for something that
    > does the equivalent of "indent-region" in ruby-mode for Emacs.
    >
    > I know something like this exists in a few libraries -- I've heard
    > talk about it from the ParseTree / RubyToC folks. I just wonder if
    > anybody has packaged one up as a standalone app and/or library.


    This is not a ruby solution, but vim will reformat ruby code if emacs
    isn't handy.

    vim -c "normal ggVG=" test.rb

    -ryan
    Ryan Phillips, Mar 4, 2005
    #3
  4. * Ben Giddings (Mar 04, 2005 18:20):
    > Does anybody have a standalone Ruby app and/or library that will
    > properly indent a chunk of Ruby code? I'm looking for something that
    > does the equivalent of "indent-region" in ruby-mode for Emacs.


    I'm going to write a indent.rb one of these days. I've had some
    experience in this area, as I wrote indent/ruby.vim for Vim, but haven't
    gotten around to writing a stand-alone application just yet...,
    nikolai

    --
    ::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka :::
    ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
    ::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 :::
    main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
    Nikolai Weibull, Mar 4, 2005
    #4
  5. Ben Giddings

    llothar Guest

    Ben Giddings wrote:
    > Does anybody have a standalone Ruby app and/or library that will
    > properly indent a chunk of Ruby code? I'm looking for something that


    > does the equivalent of "indent-region" in ruby-mode for Emacs.


    You can use ArachnoRuby IDE it's bound to the Shift-Tab key.
    llothar, Mar 6, 2005
    #5
    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. Craig
    Replies:
    8
    Views:
    4,148
    John C. Bollinger
    May 25, 2004
  2. GG
    Replies:
    8
    Views:
    299
    Tim Jowers
    Aug 23, 2004
  3. Replies:
    3
    Views:
    310
    fijal
    Sep 14, 2006
  4. dt
    Replies:
    4
    Views:
    481
    CBFalconer
    Dec 31, 2006
  5. Helmut Jarausch

    module finalizer - is there such a beast?

    Helmut Jarausch, Jan 11, 2008, in forum: Python
    Replies:
    2
    Views:
    240
    Peter Otten
    Jan 11, 2008
Loading...

Share This Page