Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > indent.rb <- does such a beast exist?

Reply
Thread Tools

indent.rb <- does such a beast exist?

 
 
Ben Giddings
Guest
Posts: n/a
 
      03-04-2005
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


 
Reply With Quote
 
 
 
 
Ryan Phillips
Guest
Posts: n/a
 
      03-04-2005
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


 
Reply With Quote
 
 
 
 
Ryan Phillips
Guest
Posts: n/a
 
      03-04-2005
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



 
Reply With Quote
 
Nikolai Weibull
Guest
Posts: n/a
 
      03-04-2005
* 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);}


 
Reply With Quote
 
llothar
Guest
Posts: n/a
 
      03-06-2005

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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
module finalizer - is there such a beast? Helmut Jarausch Python 2 01-11-2008 12:22 PM
Python to JavaScript Compiler? Anyone written such a beast? kenneth.m.mcdonald@sbcglobal.net Python 3 09-14-2006 03:35 PM
Req Canon S1 that records video in mpeg4, any such beast? No Body Digital Photography 6 11-04-2004 04:26 PM
is there such a beast? Gordon Burgess-Parker Computer Support 4 09-17-2003 07:41 AM



Advertisments