The calendar is gone.
Click here to view posts


Ruby formatter 0-6-0
I have been busy with the ruby formatter. I made the formatter a class. By class I mean I took the code from simple_formatter.rb and created some methods. I did this so people can create their own interfaces for the formatter.
Example:
format_me = Formatter.new
ruby_code =<<-RUBY
def moo
p ouch
end
RUBY
puts format_me.format_string(ruby_code)
format_me.format_file("/x/y/z.rb")


I also added a test file that I will add code to if someone sends me a chunk of code that breaks the formatter

I also fixed a few thing:
Here docs are not formatted
while statements at the end of blocks work
checks for one-line rescue statements
better command line options
better debugging statments and use of profiler
I strip out all regex, strings and comments before checking ruby code


Next step? Find more code to break the formatter and improve performance.