indent.rb <- does such a beast exist?

B

Ben Giddings

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
 
R

Ryan Phillips

Ben said:
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
 
R

Ryan Phillips

Ben said:
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
 
N

Nikolai Weibull

* 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
 
L

llothar

Ben said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top