Sha256: 14bc33d28a89d318bf1518dc4dc0761956597c6e7a68b9720a6301b91d9abfbf

Contents?: true

Size: 358 Bytes

Versions: 4

Compression:

Stored size: 358 Bytes

Contents

require "execjs"

MINIFIER_PATH = File.expand_path("../../csso/csso.js", __FILE__)
MINIFIER_FUNCTION = "csso.minify"

module Csscompress
  class Error < StandardError; end

  def self.minify(filename)
    context.call(MINIFIER_FUNCTION, File.read(filename))["css"]
  end

  def self.context
    @context ||= ExecJS.compile File.read(MINIFIER_PATH)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
csscompress-0.2.2 lib/csscompress/csscompress.rb
csscompress-0.2.1 lib/csscompress/csscompress.rb
csscompress-0.2.0 lib/csscompress/csscompress.rb
csscompress-0.1.0 lib/csscompress/csscompress.rb