removed class variable

This commit is contained in:
Scott Davis 2011-03-26 13:53:50 -04:00
parent a2200b1d83
commit b0bfb63bb7
2 changed files with 13 additions and 15 deletions

View File

@ -7,7 +7,7 @@ GIT
PATH PATH
remote: . remote: .
specs: specs:
compass (0.11.beta.4.27735a9) compass (0.11.beta.4.a2200b1)
chunky_png (~> 1.1.0) chunky_png (~> 1.1.0)
sass (>= 3.1.0.alpha.249) sass (>= 3.1.0.alpha.249)

View File

@ -1,27 +1,25 @@
module Compass module Compass
class Sprites < Sass::Importers::Base class Sprites < Sass::Importers::Base
attr_accessor :name, :path attr_accessor :name, :path
@@maps = {} @maps = {}
class << self
def path_and_name(uri) def self.path_and_name(uri)
if uri =~ %r{((.+/)?(.+))/(.+?)\.png} if uri =~ %r{((.+/)?(.+))/(.+?)\.png}
[$1, $3, $4] [$1, $3, $4]
end end
end end
def discover_sprites(uri) def self.discover_sprites(uri)
self.load_map(uri, options).files self.load_map(uri, options).files
end end
def sprite_name(file) def self.sprite_name(file)
File.basename(file, '.png') File.basename(file, '.png')
end end
end
def self.load_map(uri, options) def self.load_map(uri, options)
key = self.key(uri, options) key = self.key(uri, options)
@@maps[key] ||= SpriteMap.new(uri, options) @maps[key] ||= SpriteMap.new(uri, options)
end end