LXL README
LXL (Like Excel) is a mini-language that mimics Microsoft Excel formulas and is easily extended with new constants and functions.
Usage
formulas = %{
This is some text;
="This is some ""quoted"" text"
=((1+2)*(10-6))/2
=datetime("2004-11-22 11:11:00")=DATE(2004,11,22)+TIME(11,11,00)
=IN(" is ", "this is a string")
=LIST(1, "two", 3.0)
=IN("b", LIST("a", "b", "c"))
=AND(TRUE, NULL)
=OR(TRUE, FALSE)
=IF(1+1=2, "yes", "no")
="this" & " and " & "that"
=2^3
=25%+25.2%
}
# single formula
puts LXL.eval('=5+5').inspect # => 10
# multiple formulas separated by semi-colon
puts LXL.eval(formulas).inspect
# => ["This is some text", "This is some \"quoted\" text", 6, true, true, [1, "two", 3.0], true, false, true, "yes", "this and that", 8, 0.502]
See API docs for more information.
Requirements
* Ruby 1.8.2
Install
GEM file
gem install lxl (remote)
gem install lxl-x.x.x.gem (local)
Tarball (setup.rb)
De-Compress archive and enter its top directory.
Then type:
$ ruby setup.rb config
$ ruby setup.rb setup
($ su)
# ruby setup.rb install
You can also install files into your favorite directory
by supplying setup.rb some options. Try "ruby setup.rb --help".
License
LXL incorporates John Carter's LittleLexer for parsing.
Distributes under the same terms as LittleLexer.
http://www.rubyforge.org/projects/littlelexer/
Kevin Howe <[email protected]>