Sha256: b8a0fe12f58f2852afbd87ceaf8a9500d0b6de664337f50b27a52996e705c9f7

Contents?: true

Size: 794 Bytes

Versions: 3

Compression:

Stored size: 794 Bytes

Contents

require 'hanami/assets/compressors/stylesheet'

module Hanami
  module Assets
    module Compressors
      # Sass compressor for stylesheet
      #
      # It depends on <tt>sassc</tt> gem.
      #
      # @since 0.1.0
      # @api private
      #
      # @see http://sass-lang.com
      # @see https://rubygems.org/gems/sass
      class SassStylesheet < Stylesheet
        # @since 0.1.0
        # @api private
        def initialize
          require 'sassc'
          @compressor = ::SassC::Engine
        end

        # @since 0.1.0
        # @api private
        def compress(filename)
          compressor.new(
            read(filename),
            filename: filename,
            syntax: :scss,
            style: :compressed
          ).render
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hanami-assets-1.3.5 lib/hanami/assets/compressors/sass_stylesheet.rb
hanami-assets-1.3.4 lib/hanami/assets/compressors/sass_stylesheet.rb
hanami-assets-1.3.3 lib/hanami/assets/compressors/sass_stylesheet.rb