Module: Sass

Defined in:
lib/sass.rb,
lib/sass/util.rb,
lib/sass/error.rb,
lib/sass/version.rb,
lib/sass/embedded.rb,
lib/sass/platform.rb,
lib/sass/transport.rb,
ext/extconf.rb

Defined Under Namespace

Modules: Platform, Util Classes: BaseError, CompilationError, Embedded, Extconf, InvalidStyleError, NotRenderedError, ProtocolError, Transport, UnsupportedValue

Constant Summary collapse

VERSION =
'0.2.4'

Class Method Summary collapse

Class Method Details

.include_pathsArray<String, Pathname>

The global include_paths for Sass files. This is meant for plugins and libraries to register the paths to their Sass stylesheets to that they may be ‘@imported`. This include path is used by every instance of Embedded. They are lower-precedence than any include paths passed in via the `:include_paths` option.

If the ‘SASS_PATH` environment variable is set, the initial value of `include_paths` will be initialized based on that. The variable should be a colon-separated list of path names (semicolon-separated on Windows).

Examples:

Sass.include_paths << File.dirname(__FILE__) + '/sass'

Returns:

  • (Array<String, Pathname>)


18
19
20
21
22
23
24
# File 'lib/sass.rb', line 18

def self.include_paths
  @include_paths ||= if ENV['SASS_PATH']
                       ENV['SASS_PATH'].split(File::PATH_SEPARATOR)
                     else
                       []
                     end
end

.render(options) ⇒ Object



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

def self.render(options)
  unless defined? @embedded
    @embedded = Sass::Embedded.new
    at_exit do
      @embedded.close
    end
  end
  @embedded.render options
end