Class: Crush::YUI::JavaScriptCompressor
- Inherits:
-
Engine
- Object
- Engine
- Crush::YUI::JavaScriptCompressor
show all
- Defined in:
- lib/crush/yui.rb
Instance Attribute Summary
Attributes inherited from Engine
#data, #file, #options
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Engine
#initialize, #render
Constructor Details
This class inherits a constructor from Crush::Engine
Class Method Details
.engine_initialized? ⇒ Boolean
8
9
10
|
# File 'lib/crush/yui.rb', line 8
def self.engine_initialized?
!!(defined? ::YUI) && !!(defined? ::YUI::JavaScriptCompressor)
end
|
.engine_name ⇒ Object
4
5
6
|
# File 'lib/crush/yui.rb', line 4
def self.engine_name
"yui_js"
end
|
Instance Method Details
#evaluate ⇒ Object
20
21
22
|
# File 'lib/crush/yui.rb', line 20
def evaluate
@engine.compress(data)
end
|
#initialize_engine ⇒ Object
12
13
14
|
# File 'lib/crush/yui.rb', line 12
def initialize_engine
require_template_library "yui/compressor"
end
|
#prepare ⇒ Object
16
17
18
|
# File 'lib/crush/yui.rb', line 16
def prepare
@engine = ::YUI::JavaScriptCompressor.new(options)
end
|