Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Ruby wrapper for the Sweet.js JavaScript macro library

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 sweetjs.gemspec
README.md

Sweet Javascript Macros from Ruby

This is a Ruby wrapper around the Sweet.js macro processor.

Go to sweetjs.org for more information.

Installation

gem install sweetjs

Ensure that your environment has a JavaScript interpreter supported by ExecJS. Using the therubyracer gem is a good option.

In your Gemfile:

gem "sweetjs"
gem "therubyracer"

Usage

require 'sweetjs'

SweetJS.new.compile(File.read("source.sjs"))
# => processed JavaScript source

# Or alternatively:
SweetJS.compile(File.read("source.sjs"))

Acknowledgements

Thanks to Ville Lautanala who unwittingly wrote most of the code and the README.

Copyright

© Garry Hill, Magnetised Ltd. Released under MIT license, see LICENSE.txt for more details.

Something went wrong with that request. Please try again.