chanded spritemap instance to use quick cache
This commit is contained in:
parent
b0bfb63bb7
commit
b395552db3
@ -7,7 +7,7 @@ GIT
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
compass (0.11.beta.4.a2200b1)
|
compass (0.11.beta.4.b0bfb63)
|
||||||
chunky_png (~> 1.1.0)
|
chunky_png (~> 1.1.0)
|
||||||
sass (>= 3.1.0.alpha.249)
|
sass (>= 3.1.0.alpha.249)
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
module Compass
|
module Compass
|
||||||
class Sprites < Sass::Importers::Base
|
class Sprites < Sass::Importers::Base
|
||||||
attr_accessor :name, :path
|
attr_accessor :name, :path
|
||||||
@maps = {}
|
|
||||||
|
|
||||||
def self.path_and_name(uri)
|
def self.path_and_name(uri)
|
||||||
if uri =~ %r{((.+/)?(.+))/(.+?)\.png}
|
if uri =~ %r{((.+/)?(.+))/(.+?)\.png}
|
||||||
@ -18,8 +17,9 @@ module Compass
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.load_map(uri, options)
|
def self.load_map(uri, options)
|
||||||
key = self.key(uri, options)
|
Compass.quick_cache("spritemap:#{uri}", 50) do
|
||||||
@maps[key] ||= SpriteMap.new(uri, options)
|
SpriteMap.new(uri, options)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user