Sha256: 11b6746ffe680ea1746b88ae27929d83c27159e9cedfae000285c5fe2d65847a

Contents?: true

Size: 619 Bytes

Versions: 1

Compression:

Stored size: 619 Bytes

Contents

require 'sass'
require 'yui/compressor'

Pakyow::Assets.preprocessor :scss, :sass, output: :css, fingerprint: true, fingerprint_contents: true do |path|
  content = Sass::Engine.for_file(path, {}).render

  if Pakyow::Config.assets.minify
    begin
      YUI::CssCompressor.new.compress(content)
    rescue YUI::Compressor::RuntimeError
      Pakyow.logger.warn "Unable to minify #{path}; using raw content"
      content
    end
  else
    content
  end
end

Pakyow::Assets.dependencies :scss, :sass do |path|
  Sass::Engine.for_file(path, {}).dependencies.map { |dependency|
    dependency.options[:filename]
  }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pakyow-assets-0.1.2 lib/preprocessors/sass-preprocessor.rb