lib/handlebarsjs/handlebars.rb in handlebarsjs-0.1.2 vs lib/handlebarsjs/handlebars.rb in handlebarsjs-0.2.0
- old
+ new
@@ -1,15 +1,19 @@
# frozen_string_literal: true
module Handlebarsjs
- class Handlebars
- # @helpers = {}
- # @partials = {}
- # @partial_missing = nil
- # @precompile = nil
- # @template_cache = {}
+ # API for interacting with Handlebars.js while providing native Ruby helpers
+ class Handlebars < Handlebarsjs::Javascript
+ def initialize
+ super
+ # Handlebars 4.7.7
+ snapshot_builder.add_library('handlebars', path: Handlebarsjs::HANDLEBARS_LIBRARY_PATH)
- attr_reader :snapshot
+ # Support functions for working with
+ snapshot_builder.add_library('handlebars-api', path: Handlebarsjs::HANDLEBARS_API_PATH)
+ end
- # def initialize
+ def process_template(template, options = {})
+ context.call('process_template', template, options)
+ end
end
end