Sha256: e862a8c39438e6cb7a72865eba702f26151c221bd40c622418e8ff0f9ca9778e
Contents?: true
Size: 723 Bytes
Versions: 2
Compression:
Stored size: 723 Bytes
Contents
module Massimo class Javascript < Massimo::Resource def render case source_path.extname.to_s when '.coffee' require 'coffee-script' unless defined?(CoffeeScript) CoffeeScript.compile(content, Massimo.config.options_for(:coffee_script)) else require 'sprockets' unless defined?(Sprockets) options = Massimo.config.options_for(:sprockets).merge( :assert_root => Massimo.config.output_path, :source_files => [ source_path.to_s ] ) secretary = Sprockets::Secretary.new(options) secretary.install_assets secretary.concatenation.to_s end end def extension @extension ||= '.js' end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
massimo-0.6.2 | lib/massimo/javascript.rb |
massimo-0.6.1 | lib/massimo/javascript.rb |