Sha256: dc1ac1c09a626512c0dfe2f16f2246b0a2c1bc16844f11cd26b0862cb9e38319
Contents?: true
Size: 547 Bytes
Versions: 10
Compression:
Stored size: 547 Bytes
Contents
module WebFont module LocalCache class << self attr_accessor :cache, :cache_path def path(filename) path = File.join(cache_path, filename) File.exist?(path) ? path : nil end def save(font) return nil unless cache_path filename = File.basename(font) path = File.join(cache_path, filename) FileUtils.copy(font, path) unless font == path path end def enable? cache && !!cache_path && Dir.exist?(cache_path) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems