Sha256: 44609f7ee132c8edff7d5c95d62109fc0de01d769ddd331f4f5c46a4942f8ca9

Contents?: true

Size: 620 Bytes

Versions: 5

Compression:

Stored size: 620 Bytes

Contents

require 'sprockets'
require 'compass/sprite_importer'

module Compass
  class SpriteImporter < Sass::Importers::Base

    alias :old_find :find

    def find(uri, options)

      if old = old_find(uri, options)
        @_options = options
        self.class.files(uri).each do |file|
          if pathname = resolve(file)
            context.depend_on(pathname)
          end
        end
      end

      old
    end

  private

    def resolve(uri)
      resolver.resolve(Pathname.new(uri))
    end

    def context
     resolver.context
    end

    def resolver
      @_options[:custom][:resolver]
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
compass-rails-1.0.3 lib/compass-rails/patches/sprite_importer.rb
compass-rails-1.0.2 lib/compass-rails/patches/sprite_importer.rb
compass-rails-1.0.1 lib/compass-rails/patches/sprite_importer.rb
compass-rails-1.0.0 lib/compass-rails/patches/sprite_importer.rb
compass-rails-1.0.0.rc.4 lib/compass-rails/patches/sprite_importer.rb