Sha256: bb49be0bf9981615bcde84b83fca4e84ca7a830f32dc4f96d8bac75371a06346

Contents?: true

Size: 843 Bytes

Versions: 1

Compression:

Stored size: 843 Bytes

Contents

require 'lotus/assets/compressors/javascript'
require_relative './jsmin'

module Lotus
  module Assets
    module Compressors
      # Builtin compressor for stylesheet
      #
      # This is a port of jsmin
      # Copyright (c) 2002 Douglas Crockford  (www.crockford.com)
      #
      # This Ruby port was implemented by Ryan Grove (@rgrove) as work for
      # <tt>jsmin</tt> gem.
      #
      # Copyright (c) 2008-2012 Ryan Grove
      #
      # @since 0.1.0
      # @api private
      #
      # @see https://github.com/sbecker/asset_packager
      class BuiltinJavascript < Javascript
        def initialize
          @compressor = JSMin
        end

        # @since 0.1.0
        # @api private
        def compress(filename)
          compressor.minify(
            read(filename)
          )
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lotus-assets-0.1.0 lib/lotus/assets/compressors/builtin_javascript.rb