Class: Hanami::Assets::Compressors::BuiltinJavascript Private
- Inherits:
-
Javascript
- Object
- Abstract
- Javascript
- Hanami::Assets::Compressors::BuiltinJavascript
- Defined in:
- lib/hanami/assets/compressors/builtin_javascript.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Builtin compressor for stylesheet
This is a port of jsmin Copyright © 2002 Douglas Crockford (www.crockford.com)
This Ruby port was implemented by Ryan Grove (@rgrove) as work for jsmin
gem.
Copyright © 2008-2012 Ryan Grove
Instance Method Summary collapse
- #compress(filename) ⇒ Object private
-
#initialize ⇒ BuiltinJavascript
constructor
private
A new instance of BuiltinJavascript.
Methods inherited from Javascript
Constructor Details
#initialize ⇒ BuiltinJavascript
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of BuiltinJavascript.
22 23 24 |
# File 'lib/hanami/assets/compressors/builtin_javascript.rb', line 22 def initialize @compressor = JSMin end |
Instance Method Details
#compress(filename) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
28 29 30 31 32 |
# File 'lib/hanami/assets/compressors/builtin_javascript.rb', line 28 def compress(filename) compressor.minify( read(filename) ) end |