Sha256: 44021654fff65f412f49f4ff3c22cc320d4cc867c58335efd0e072d51644ebfc

Contents?: true

Size: 997 Bytes

Versions: 2

Compression:

Stored size: 997 Bytes

Contents

require 'pathname'
require 'singleton'

class Sass::CssImporter::Importer < Sass::Importers::Filesystem

  def initialize(root)
    super(root)
  end

  # Enable watching of css files in Sass 3.3+
  def watched_directories
    [root]
  end

  # Enable watching of css files in Sass 3.3+
  def watched_file?(file)
    file.start_with?(root+File::SEPARATOR) && File.extname(file) == ".css"
  end

  def extensions
    {'css' => :scss}
  end

  def find_relative(name, base, options)
    super(strip_prefix(name), base, options)
  end


  def find(name, options)
    super(strip_prefix(name), options)
  end
  

  def mtime(name, options)
    super(strip_prefix(name), options)
  end

  def key(name, options)
    super(strip_prefix(name), options)
  end

  def to_s
    "Sass::CssImporter::Importer(#{root})"
  end

  def eql?(other)
    other.class == self.class && other.root == self.root
  end

  protected

  def strip_prefix(name)
    name.start_with?("CSS:") ? name[4..-1] : name
  end
  
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
sass-css-importer-load-paths-1.0.0.beta.0 lib/sass/css_importer/importer.rb
sass-css-importer-1.0.0.beta.0 lib/sass/css_importer/importer.rb