Class: Lotus::Assets::Compressors::SassStylesheet Private

Inherits:
Stylesheet show all
Defined in:
lib/lotus/assets/compressors/sass_stylesheet.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Sass compressor for stylesheet

It depends on sass gem.

Constant Summary collapse

SASS_CACHE_LOCATION =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

FIXME This is the same logic that we have for Lotus::Assets::Compiler

Since:

  • 0.1.0

Pathname(Lotus.respond_to?(:root) ?
Lotus.root : Dir.pwd).join('tmp', 'sass-cache')

Instance Method Summary collapse

Methods inherited from Stylesheet

for

Constructor Details

#initializeSassStylesheet

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of SassStylesheet.

Since:

  • 0.1.0


25
26
27
# File 'lib/lotus/assets/compressors/sass_stylesheet.rb', line 25

def initialize
  @compressor = Sass::Engine
end

Instance Method Details

#compress(filename) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0


31
32
33
34
# File 'lib/lotus/assets/compressors/sass_stylesheet.rb', line 31

def compress(filename)
  compressor.new(read(filename), filename: filename, syntax: :scss,
    style: :compressed, cache_location: SASS_CACHE_LOCATION).render
end