Skip to content
This repository

RubyScriptWriter helps programatically create new ruby scripts:

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

will produce:

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

end

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: http://www.greenonblack.com

Something went wrong with that request. Please try again.