lib/dassets/config.rb in dassets-0.12.0 vs lib/dassets/config.rb in dassets-0.13.0
- old
+ new
@@ -8,26 +8,37 @@
class Config
include NsOptions::Proxy
option :file_store, FileStore, :default => proc{ FileStore::NullStore.new }
- option :cache, :default => proc{ Cache::NoCache.new }
attr_reader :sources, :combinations
def initialize
super
- @sources = []
- @combinations = Hash.new{ |h, k| [k] } # digest pass-thru if none defined
+ @sources = []
+ @combinations = Hash.new{ |h, k| [k] } # digest pass-thru if none defined
+ @content_cache = Dassets::Cache::NoCache.new
+ @fingerprint_cache = Dassets::Cache::NoCache.new
end
def base_url(value = nil)
set_base_url(value) if !value.nil?
@base_url
end
def set_base_url(value)
@base_url = value
+ end
+
+ def content_cache(cache = nil)
+ @content_cache = cache if !cache.nil?
+ @content_cache
+ end
+
+ def fingerprint_cache(cache = nil)
+ @fingerprint_cache = cache if !cache.nil?
+ @fingerprint_cache
end
def source(path, &block)
@sources << Source.new(path).tap{ |s| block.call(s) if block }
end