Ruby CoughSyrup
Ruby CoughSyrup is a bridge to the official CoughSyrup compiler.
CoughSyrup.compile File.read("script.cough")
Installation
gem install cough-syrup
Dependencies
This library depends on the cough-syrup-source
gem which is
updated any time a new version of CoughSyrup is released. (The
cough-syrup-source
gem's version number is synced with each
official CoughSyrup release.) This way you can build against
different versions of CoughSyrup by requiring the correct version of
the cough-syrup-source
gem.
In addition, you can use this library with unreleased versions of
CoughSyrup by setting the COUGHSYRUP_SOURCE_PATH
environment
variable:
export COUGHSYRUP_SOURCE_PATH=/path/to/cough-syrup/extras/cough-syrup.js
JSON
The json
library is also required but is not explicitly stated as a
gem dependency. If you're on Ruby 1.8 you'll need to install the
json
or json_pure
gem. On Ruby 1.9, json
is included in the
standard library.
ExecJS
The ExecJS library is used to automatically choose the best JavaScript engine for your platform. Check out its README for a complete list of supported engines.