Lax is a Ruby preprocessor for enabling a relaxed and more concise syntax: You can omit the keywords do
and end
. To get Lax to work in your code, you have to require
Lax and then load your .rbl
code.
Example: test.rb
require 'rubygems' require 'lax' require 'rbltest' # or: load 'rbltest.rbl'
rbltest.rbl
lines = <<END one two three END lines.each |line| if line.match /t/ puts line else puts "-" + line
Lax also includes an executable which lets you preprocess single .rbl
files.
Example:
lax rbltest.rbl
This project is not meant to propagate pythonic syntax or spark another “indentation as syntax” war. It was born out of pure laziness, as I got tired of searching missing do
s and end
s in my code. Lax was derived from pyrb.rb
at xtargets.com/snippets/posts/show/68.