Sha256: 0366942302dcf8c87ba024c4b89bfec3d5a9c01f67f067a87793c76fbc302f76

Contents?: true

Size: 845 Bytes

Versions: 26

Compression:

Stored size: 845 Bytes

Contents

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

module Hanami
  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

26 entries across 26 versions & 1 rubygems

Version Path
hanami-assets-1.3.5 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.3.4 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.3.3 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.3.2 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.3.1 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.3.0 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.3.0.beta1 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.2.0 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.2.0.rc2 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.2.0.rc1 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.2.0.beta2 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.2.0.beta1 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.1.1 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.1.0 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.1.0.rc1 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.1.0.beta3 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.1.0.beta2 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.1.0.beta1 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.0.0 lib/hanami/assets/compressors/builtin_javascript.rb
hanami-assets-1.0.0.rc1 lib/hanami/assets/compressors/builtin_javascript.rb