Sha256: e18c51add7e9cf69c03fac5a7ff5bcb73fabf25ea45bc75dad07910e62e44e2e

Contents?: true

Size: 651 Bytes

Versions: 10

Compression:

Stored size: 651 Bytes

Contents

require 'erb'

module RunLoop

  # @!visibility private
  # Class to break up javascript templates in to reusable chunks
  class UIAScriptTemplate < ERB

    # @!visibility private
    def initialize(template_root, template_relative_path)
      @template_root = template_root
      @template = File.read(File.join(@template_root, template_relative_path)).force_encoding("utf-8")
      super(@template)
    end

    # @!visibility private
    def render_template(template_relative_path)
      UIAScriptTemplate.new(@template_root, template_relative_path).result
    end

    # @!visibility private
    def result
      super(binding)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
run_loop-2.1.1.pre1 lib/run_loop/template.rb
run_loop-2.1.0 lib/run_loop/template.rb
run_loop-2.1.0.pre1 lib/run_loop/template.rb
run_loop-2.0.10.pre1 lib/run_loop/template.rb
run_loop-2.0.9 lib/run_loop/template.rb
run_loop-2.0.8 lib/run_loop/template.rb
run_loop-2.0.7 lib/run_loop/template.rb
run_loop-2.0.6 lib/run_loop/template.rb
run_loop-2.0.5 lib/run_loop/template.rb
run_loop-2.0.4 lib/run_loop/template.rb