Class: Sinatra::AssetPack::Engine
- Inherits:
-
Object
- Object
- Sinatra::AssetPack::Engine
- Defined in:
- lib/sinatra/assetpack/engine.rb
Overview
The base class for all CSS/JS compression engines.
Direct Known Subclasses
ClosureEngine, JsminEngine, SassEngine, SimpleEngine, SqwishEngine, UglifyEngine, YuiEngine
Instance Method Summary collapse
-
#sys(type, str, cmd) ⇒ Object
Helper for system files.
Instance Method Details
#sys(type, str, cmd) ⇒ Object
Helper for system files. Usage: sys(‘css’, string, “sqwish %f”) Returns stdout.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/sinatra/assetpack/engine.rb', line 8 def sys(type, str, cmd) t = Tempfile.new ['', ".#{type}"] t.write(str) t.close output = `#{cmd.gsub('%f', t.path)}` FileUtils.rm t [output, t.path] end |