Skip to content


tamc edited this page · 4 revisions
Clone this wiki locally

RubyScriptWriter helps programatically create new ruby scripts:

r =
r.put_class "One" do
  r.put_method "a", "arg1","arg2" do
    r.puts "return arg1 + arg2"
puts r

will produce:

class One
  def a(arg1,arg2)
    return arg1 + arg2


The key (only?) benefit is that the resulting code will be more or less correctly indented.

It can be installed as a gem:

gem install rubyscriptwriter

This software is © 2010 Green on Black Ltd and distributed under the open source MIT licence. (See LICENCE for the wording).

If you like this code, employ us:

Something went wrong with that request. Please try again.