Sha256: 4440abda7b5d9b0e8ea47b169cfccbd1b45c32a9657f0076fcfefc4ffe829f50
Contents?: true
Size: 855 Bytes
Versions: 1
Compression:
Stored size: 855 Bytes
Contents
require 'frozen/template/base' require 'uglifier' require 'coffee-script' module Frozen module Template class Javascript < Base attr_accessor :options attr_accessor :file_load_path def initialize(options={}) @options = { :style => :compressed, :format => nil, :load_path => nil }.merge(options) end def read_from_file(file) self.file_load_path = File.dirname(file) super(file) end def contents read_from_file(file_path) end def build_extension ".js" end def build_path "js" end def render js = "" js = CoffeeScript.compile(contents) if file_type == "coffee" js = contents if file_type == "js" Uglifier.new.compile(js) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
frozen-0.0.1 | lib/frozen/template/javascript.rb |