Class: Massimo::Javascript
- Defined in:
- lib/massimo/javascript.rb
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
Methods inherited from Resource
all, #extensions, #filename, find, #initialize, #output_path, path, #process, processable?, resource_name, url, #url
Constructor Details
This class inherits a constructor from Massimo::Resource
Instance Method Details
#extension ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/massimo/javascript.rb', line 6 def extension if Tilt.registered?(super[1..-1]) '.js' else super end end |
#render ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/massimo/javascript.rb', line 14 def render if source_path.extname == '.js' = Massimo.config.(:sprockets).merge( :assert_root => Massimo.config.output_path, :source_files => [ source_path.to_s ] ) secretary = Sprockets::Secretary.new() secretary.install_assets @content = secretary.concatenation.to_s end super end |