https://github.com/contiamo/ruby-eco
sstephenson's eco gem modified to create smaller files by moving the code shared by all templates into a separate file.
https://github.com/contiamo/ruby-eco
Last synced: 2 months ago
JSON representation
sstephenson's eco gem modified to create smaller files by moving the code shared by all templates into a separate file.
- Host: GitHub
- URL: https://github.com/contiamo/ruby-eco
- Owner: contiamo
- License: mit
- Created: 2012-08-21T10:35:11.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2015-07-16T10:35:19.000Z (almost 10 years ago)
- Last Synced: 2024-12-27T20:37:44.021Z (4 months ago)
- Language: Ruby
- Size: 141 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Ruby Eco
========Ruby Eco is a bridge to the official
[Eco](https://github.com/sstephenson/eco) compiler for embedded
CoffeeScript templates.```ruby
require "eco"Eco.compile(File.read("template.eco"))
# => "function(...) {...}"context = Eco.context_for("Hello <%= @name %>")
context.call("render", :name => "Sam")
# => "Hello Sam"Eco.render("Hello <%= @name %>", :name => "world")
# => "Hello world"
```Installation
------------$ gem install eco
Dependencies
------------This library depends on the `eco-source` gem which is updated any time
a new version of Eco is released. (The `eco-source` gem's version
number is synced with each official Eco release.) This way you can
build against different versions of Eco by requiring the correct
version of the `eco-source` gem.In addition, you can use this library with unreleased versions of Eco
by setting the `ECO_SOURCE_PATH` environment variable:export ECO_SOURCE_PATH=/path/to/eco/dist/eco.js
### Ruby CoffeeScript
The [Ruby CoffeeScript](https://github.com/josh/ruby-coffee-script)
library is used to load the CoffeeScript compiler source. See the
[README](https://github.com/josh/ruby-coffee-script/blob/master/README.md)
for information on loading a specific version of the CoffeeScript
compiler.### ExecJS
The [ExecJS](https://github.com/sstephenson/execjs) library is used to
automatically choose the best JavaScript engine for your
platform. Check out its
[README](https://github.com/sstephenson/execjs/blob/master/README.md)
for a complete list of supported engines.