Class: DevSystem::ScssConverterShell

Inherits:
ConverterShell show all
Defined in:
lib/dev_system/sub/shell/converter_shells/scss_converter_shell.rb

Class Method Summary collapse

Methods inherited from ConverterShell

call

Methods inherited from Shell

all, cruby?, engine, jruby?, linux?, mac?, os, ruby_version, unix?, windows?

Methods inherited from Liza::Controller

color, inherited, on_connected

Methods inherited from Liza::Unit

const_missing, division, part, system, #system, test_class

Class Method Details

.convert(string, options = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/dev_system/sub/shell/converter_shells/scss_converter_shell.rb', line 9

def self.convert string, options = {}
  log :lower, "default_options = #{default_options.inspect} | options = #{options.inspect}"

  options = default_options.merge options if options.any? && default_options.any?
  
  log :lower, "#{string.size} chars (options: #{options.inspect})"

  require "sassc"
  # output = SassC::Engine.new(scss, line_comments: true).render
  # output = SassC::Engine.new(scss, style: :sass_style_nested).render
  # output = SassC::Engine.new(scss, style: :sass_style_compact).render
  # output = SassC::Engine.new(scss, style: :compressed).render
  # output = SassC::Engine.new(scss).render
  SassC::Engine.new(string, line_comments: true, style: :sass_style_expanded).render
end

.default_optionsObject



3
4
5
# File 'lib/dev_system/sub/shell/converter_shells/scss_converter_shell.rb', line 3

def self.default_options
  DevBox[:shell].converters[:scss][:options]
end