Class: Sinatra::AssetPack::YuiEngine
- Defined in:
- lib/sinatra/assetpack/engines/yui.rb
Instance Method Summary collapse
- #css(str, options = {}) ⇒ Object
-
#initialize ⇒ YuiEngine
constructor
A new instance of YuiEngine.
- #js(str, options = {}) ⇒ Object
Methods inherited from Engine
Constructor Details
#initialize ⇒ YuiEngine
Returns a new instance of YuiEngine.
3 4 5 |
# File 'lib/sinatra/assetpack/engines/yui.rb', line 3 def initialize require 'yui/compressor' end |
Instance Method Details
#css(str, options = {}) ⇒ Object
13 14 15 16 17 |
# File 'lib/sinatra/assetpack/engines/yui.rb', line 13 def css(str, ={}) YUI::CssCompressor.new.compress(str) rescue Errno::ENOENT nil end |
#js(str, options = {}) ⇒ Object
7 8 9 10 11 |
# File 'lib/sinatra/assetpack/engines/yui.rb', line 7 def js(str, ={}) YUI::JavaScriptCompressor.new().compress(str) rescue LoadError nil end |