Module: Deadfire

Defined in:
lib/deadfire.rb,
lib/deadfire/spec.rb,
lib/deadfire/errors.rb,
lib/deadfire/railtie.rb,
lib/deadfire/version.rb,
lib/deadfire/ast_printer.rb,
lib/deadfire/interpreter.rb,
lib/deadfire/asset_loader.rb,
lib/deadfire/mixin_parser.rb,
lib/deadfire/configuration.rb,
lib/deadfire/css_generator.rb,
lib/deadfire/parser_engine.rb,
lib/deadfire/asset_registry.rb,
lib/deadfire/error_reporter.rb,
lib/deadfire/filename_helper.rb,
lib/deadfire/front_end/token.rb,
lib/deadfire/front_end/parser.rb,
lib/deadfire/front_end/scanner.rb,
lib/deadfire/front_end/base_node.rb,
lib/deadfire/front_end/apply_node.rb,
lib/deadfire/front_end/block_node.rb,
lib/deadfire/front_end/at_rule_node.rb,
lib/deadfire/front_end/comment_node.rb,
lib/deadfire/front_end/newline_node.rb,
lib/deadfire/front_end/ruleset_node.rb,
lib/deadfire/front_end/selector_node.rb,
lib/deadfire/front_end/stylesheet_node.rb

Defined Under Namespace

Modules: FrontEnd Classes: ApplyNode, AssetLoader, AssetRegistry, AstPrinter, Configuration, CssGenerator, DirectoryNotFoundError, DuplicateImportException, ErrorReporter, FilenameHelper, ImportException, Interpreter, MixinParser, ParserEngine, Railties, Spec

Constant Summary collapse

PERMISSIBLE_FILE_EXTENSIONS =
[".css", ".scss"].freeze
VERSION =
"0.6.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject (readonly)

Returns the value of attribute config.



33
34
35
# File 'lib/deadfire.rb', line 33

def config
  @config
end

Class Method Details

.configurationObject



35
36
37
# File 'lib/deadfire.rb', line 35

def configuration
  @config ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



43
44
45
# File 'lib/deadfire.rb', line 43

def configure
  yield(configuration)
end

.parse(content, options = {}) ⇒ Object



47
48
49
50
51
52
53
54
55
# File 'lib/deadfire.rb', line 47

def parse(content, options = {})
  configure do |config|
    config.root_path = options[:root_path]
    config.compressed = options[:compressed]
  end

  parser = ParserEngine.new(content, filename: options[:filename])
  parser.parse
end

.resetObject



39
40
41
# File 'lib/deadfire.rb', line 39

def reset
  @config = Configuration.new
end