Class: Sprockets::EcoTemplate

### Home Classes Methods

### In Files

- lib/sprockets/eco_template.rb

### Parent

Tilt::Template

### Methods

- ::engine_initialized?
- #evaluate
- #initialize_engine
- #prepare

### Class/Module Index

Quicksearch

- Sprockets
- Sprockets::ArgumentError
- Sprockets::Asset
- Sprockets::AssetAttributes
- Sprockets::Base
- Sprockets::BundledAsset
- Sprockets::Cache
- Sprockets::Cache::FileStore
- Sprockets::Caching
- Sprockets::CharsetNormalizer
- Sprockets::CircularDependencyError
- Sprockets::ContentTypeMismatch
- Sprockets::Context
- Sprockets::DirectiveProcessor
- Sprockets::EcoTemplate
- Sprockets::EjsTemplate
- Sprockets::EncodingError
- Sprockets::EngineError
- Sprockets::Engines
- Sprockets::Environment
- Sprockets::Error
- Sprockets::FileNotFound
- Sprockets::FileOutsidePaths
- Sprockets::Index
- Sprockets::JstProcessor
- Sprockets::Manifest
- Sprockets::Mime
- Sprockets::ProcessedAsset
- Sprockets::ProcessedAsset::DependencyFile
- Sprockets::Processing
- Sprockets::Processor
- Sprockets::SafetyColons
- Sprockets::Server
- Sprockets::StaticAsset
- Sprockets::Trail
- Sprockets::UnserializeError
- Sprockets::Utils
- Rake
- Rake::SprocketsTask

No matching classes.

# Sprockets::EcoTemplate

Tilt engine class for the Eco compiler. Depends on the `eco` gem.

For more infomation see:

    https://github.com/sstephenson/ruby-eco
    https://github.com/sstephenson/eco

### Public Class Methods

engine_initialized?() click to toggle source

Check to see if Eco is loaded

    # File lib/sprockets/eco_template.rb, line 13
    def self.engine_initialized?
      defined? ::Eco
    end

### Public Instance Methods

evaluate(scope, locals, &block) click to toggle source

Compile template data with Eco compiler.

Returns a JS function definition String. The result should be assigned to a JS variable.

    # => "function(...) {...}"

    # File lib/sprockets/eco_template.rb, line 34
    def evaluate(scope, locals, &block)
      Eco.compile(data)
    end

initialize_engine() click to toggle source

Autoload eco library. If the library isn't loaded, Tilt will produce a thread safetly warning. If you intend to use `.eco` files, you should explicitly require it.

    # File lib/sprockets/eco_template.rb, line 20
    def initialize_engine
      require_template_library 'eco'
    end

prepare() click to toggle source

    # File lib/sprockets/eco_template.rb, line 24
    def prepare
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.