Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Use a laxer, more concise Ruby syntax.
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
test
README.rdoc
Rakefile
lax.gemspec

README.rdoc

Lax

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

Executable

Lax also includes an executable which lets you preprocess single .rbl files.

Example:

lax rbltest.rbl

Disclaimer

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 dos and ends in my code. Lax was derived from pyrb.rb at xtargets.com/snippets/posts/show/68.

Something went wrong with that request. Please try again.