Module: Compass::ImportOnce::Engine

Defined in:
lib/compass/import-once/engine.rb

Overview

All sass engines will be extended with this module to manage the lifecycle around each

Instance Method Summary collapse

Instance Method Details

#renderObject


15
16
17
18
19
# File 'lib/compass/import-once/engine.rb', line 15

def render
  with_import_scope(options[:css_filename]) do
    super
  end
end

#render_with_sourcemap(sourcemap_uri) ⇒ Object


21
22
23
24
25
# File 'lib/compass/import-once/engine.rb', line 21

def render_with_sourcemap(sourcemap_uri)
  with_import_scope(options[:css_filename]) do
    super
  end
end

#to_cssObject


9
10
11
12
13
# File 'lib/compass/import-once/engine.rb', line 9

def to_css
  with_import_scope(options[:css_filename]) do
    super
  end
end

#with_import_scope(css_filename) ⇒ Object


27
28
29
30
31
32
# File 'lib/compass/import-once/engine.rb', line 27

def with_import_scope(css_filename)
  Compass::ImportOnce.import_tracker[css_filename] = Set.new
  yield
ensure
  Compass::ImportOnce.import_tracker.delete(css_filename)
end