debian-mirror-gitlab/debian/gems-compat/sassc-rails-2.1.2/lib/sassc/rails/compressor.rb
2019-08-03 14:34:24 +05:30

34 lines
606 B
Ruby

# frozen_string_literal: true
require 'sprockets/sass_compressor'
require 'securerandom'
class Sprockets::SassCompressor
def initialize(options = {})
@options = {
syntax: :scss,
cache: false,
read_cache: false,
style: :compressed
}.merge(options).freeze
@cache_key = SecureRandom.uuid
end
def call(*args)
input = if defined?(data)
data # sprockets 2.x
else
args[0][:data] #sprockets 3.x
end
SassC::Engine.new(
input,
{
style: :compressed
}
).render
end
# sprockets 2.x
alias :evaluate :call
end