Ruby LiveScript
Ruby LiveScript compiler.
It uses execjs to run LiveScript javascript compiler.
Depends on livescript-source.
Installation
gem install livescript
If you are using Bundler, add the following to your Gemfile
:
gem 'livescript'
Usage
require 'livescript'
options = {bare: true, header: false}
result = LiveScript.compile(source_code, options)
# get default options
options = LiveScript.default_options
# set default options
LiveScript.default_options = options
Available options:
- bare: Default true. If true, compile without the top-level function wrapper
- header: Default true. If true, add the "Generated by" header
- const: Default false. If true, compile all variables as constants
- filename: An optional filename used for compilation errors
- map: Source map type
See Programmatic API
section at livescript.net for more.
License
MIT