lib/hanami/assets/compressors/sass_stylesheet.rb in hanami-assets-1.3.1 vs lib/hanami/assets/compressors/sass_stylesheet.rb in hanami-assets-1.3.2
- old
+ new
@@ -1,37 +1,35 @@
require 'hanami/assets/compressors/stylesheet'
-require 'sass'
+require 'sassc'
module Hanami
module Assets
module Compressors
# Sass compressor for stylesheet
#
- # It depends on <tt>sass</tt> gem.
+ # 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
- #
- # FIXME This is the same logic that we have for Hanami::Assets::Compiler
- SASS_CACHE_LOCATION = Pathname(Hanami.respond_to?(:root) ? # rubocop:disable Style/MultilineTernaryOperator
- Hanami.root : Dir.pwd).join('tmp', 'sass-cache')
- # @since 0.1.0
- # @api private
def initialize
- @compressor = Sass::Engine
+ @compressor = SassC::Engine
end
# @since 0.1.0
# @api private
def compress(filename)
- compressor.new(read(filename), filename: filename, syntax: :scss,
- style: :compressed, cache_location: SASS_CACHE_LOCATION).render
+ compressor.new(
+ read(filename),
+ filename: filename,
+ syntax: :scss,
+ style: :compressed
+ ).render
end
end
end
end
end