Class: Dassets::Sass::Engine

Inherits:
Engine
  • Object
show all
Defined in:
lib/dassets-sass.rb

Instance Method Summary collapse

Instance Method Details

#compile(input_content) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/dassets-sass.rb', line 26

def compile(input_content)
  ::Sass.compile(input_content, {
    :syntax => self.syntax.to_sym,
    :style  => self.output_style.to_sym,
    :load_paths => self.load_paths
  })
end

#ext(input_ext) ⇒ Object



22
23
24
# File 'lib/dassets-sass.rb', line 22

def ext(input_ext)
  'css'
end

#load_pathsObject



17
18
19
20
# File 'lib/dassets-sass.rb', line 17

def load_paths
  @load_paths ||= ([self.opts['source_path']] +
                   [*(self.opts[:load_paths] || self.opts['load_paths'] || [])])
end

#output_styleObject



13
14
15
# File 'lib/dassets-sass.rb', line 13

def output_style
  (self.opts[:output_style] || self.opts['output_style'] || 'nested').to_s
end

#syntaxObject



9
10
11
# File 'lib/dassets-sass.rb', line 9

def syntax
  (self.opts[:syntax] || self.opts['syntax'] || 'scss').to_s
end