lib/dassets/config.rb in dassets-0.15.0 vs lib/dassets/config.rb in dassets-0.15.1

- old
+ new

@@ -4,55 +4,56 @@ require "dassets/cache" require "dassets/file_store" require "dassets/source" module Dassets; end + class Dassets::Config attr_reader :sources, :combinations def initialize super - self.reset + reset @content_cache = Dassets::NoCache.new @fingerprint_cache = Dassets::NoCache.new @file_store = Dassets::NullFileStore.new end def reset @sources = [] - @combinations = Hash.new { |h, k| [k] } # digest pass-thru if none defined + @combinations = Hash.new{ |_h, k| [k] } # digest pass-thru if none defined @file_store = Dassets::NullFileStore.new end def base_url(value = nil) - set_base_url(value) if !value.nil? + set_base_url(value) unless value.nil? @base_url end def set_base_url(value) @base_url = value end def file_store(value = nil) - if !value.nil? + unless value.nil? @file_store = - if value.kind_of?(Dassets::FileStore) + if value.is_a?(Dassets::FileStore) value else Dassets::FileStore.new(value) end end @file_store end def content_cache(cache = nil) - @content_cache = cache if !cache.nil? + @content_cache = cache unless cache.nil? @content_cache end def fingerprint_cache(cache = nil) - @fingerprint_cache = cache if !cache.nil? + @fingerprint_cache = cache unless cache.nil? @fingerprint_cache end def source(path, &block) @sources << Dassets::Source.new(path).tap{ |s| block.call(s) if block }