Sha256: ca6a0498c7eb96e7d5a703163315c53ed246fd0b477ded9566e318265832387b

Contents?: true

Size: 686 Bytes

Versions: 7

Compression:

Stored size: 686 Bytes

Contents

# frozen_string_literal: true

module Handlebarsjs
  # API for interacting with Handlebars.js while providing native Ruby helpers
  class Handlebars < Handlebarsjs::Javascript
    def initialize
      super
      # Handlebars 4.7.7
      handlebars_snapshot.add_library('handlebars', path: Handlebarsjs::HANDLEBARS_LIBRARY_PATH)

      # Support functions for working with
      handlebars_snapshot.add_library('handlebars-api', path: Handlebarsjs::HANDLEBARS_API_PATH)
    end

    def process_template(template, options = {})
      # TODO: process template function may be improved with some type of caching
      context.call('process_template', template, options)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
handlebarsjs-0.5.4 lib/handlebarsjs/handlebars.rb
handlebarsjs-0.5.3 lib/handlebarsjs/handlebars.rb
handlebarsjs-0.5.2 lib/handlebarsjs/handlebars.rb
handlebarsjs-0.5.1 lib/handlebarsjs/handlebars.rb
handlebarsjs-0.5.0 lib/handlebarsjs/handlebars.rb
handlebarsjs-0.4.0 lib/handlebarsjs/handlebars.rb
handlebarsjs-0.3.0 lib/handlebarsjs/handlebars.rb