Skip to content
This repository was archived by the owner on Apr 27, 2021. It is now read-only.
/ sweetjs Public archive

Ruby wrapper for the Sweet.js JavaScript macro library

License

Notifications You must be signed in to change notification settings

magnetised/sweetjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Ruby wrapper for the Sweet.js JavaScript macro library

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors