Class: Webgen::ContentProcessor::Sass::NodeTreeImporter

Inherits:
Sass::Importers::Base
  • Object
show all
Defined in:
lib/webgen/content_processor/sass.rb

Overview

Custom importer for Sass to load files by resolving them in the node tree.

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ NodeTreeImporter

Creates a new importer that imports files from the node tree relative to the given node alcn.



33
34
35
# File 'lib/webgen/content_processor/sass.rb', line 33

def initialize(context)
  @context = context
end

Instance Method Details

#find(name, options) ⇒ Object

See Also:

  • Base#find


49
50
51
# File 'lib/webgen/content_processor/sass.rb', line 49

def find(name, options)
  _find(@context.ref_node.alcn, name, options)
end

#find_relative(name, base, options) ⇒ Object

See Also:

  • Base#find_relative


44
45
46
# File 'lib/webgen/content_processor/sass.rb', line 44

def find_relative(name, base, options)
  _find(base, name, options)
end

#key(name, options) ⇒ Object

:nodoc:



58
59
60
# File 'lib/webgen/content_processor/sass.rb', line 58

def key(name, options) #:nodoc:
  ["webgen:", name]
end

#marshal_dumpObject

:nodoc:



37
38
# File 'lib/webgen/content_processor/sass.rb', line 37

def marshal_dump #:nodoc:
end

#marshal_load(data) ⇒ Object

:nodoc:



40
41
# File 'lib/webgen/content_processor/sass.rb', line 40

def marshal_load(data) #:nodoc:
end

#mtime(name, options) ⇒ Object

:nodoc:



53
54
55
56
# File 'lib/webgen/content_processor/sass.rb', line 53

def mtime(name, options) #:nodoc:
  node = resolve_node(@context.ref_node.alcn, name)
  node['modified_at'] if node
end

#to_sObject

:nodoc:



62
63
64
# File 'lib/webgen/content_processor/sass.rb', line 62

def to_s #:nodoc:
  "webgen: #{@context.ref_node.alcn}"
end