Class: Vitrine::SassImporter

Inherits:
Sass::Importers::Filesystem
  • Object
show all
Defined in:
lib/sourcemaps.rb

Overview

We need to override the Sass importer so that it gives us URLs relative to the server root for sourcemaps

Instance Method Summary collapse

Instance Method Details

#public_url(of_filesystem_path, unknown_arg) ⇒ Object

TODO: figure out what the second one does



9
10
11
12
13
# File 'lib/sourcemaps.rb', line 9

def public_url(of_filesystem_path, unknown_arg) # TODO: figure out what the second one does
  # Importer defines a basic attribute called "root" which we set when initializing
  # We have to return the server-relative URL of the path from here
  '/' + Pathname.new(of_filesystem_path).relative_path_from(Pathname.new(root)).to_s
end