Module: JsminFFI

Extended by:
FFI::Library, JsminFFI
Included in:
JsminFFI
Defined in:
lib/jsmin_ffi.rb

Defined Under Namespace

Classes: ParseError

Instance Method Summary collapse

Instance Method Details

#minify!(buf) ⇒ String

Minify the provided javascript

Parameters:

  • buf (String)

    Javascript text

Returns:

  • (String)

    minified Javascript text

Raises:



16
17
18
19
20
21
22
# File 'lib/jsmin_ffi.rb', line 16

def minify!(buf)
  res = minify(buf)
  if res[0..0] == '!'
    raise ParseError.new(res.tr('!', ''))
  end
  res
end