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

- old
+ new

@@ -11,29 +11,29 @@ def self.config @config ||= Config.new end def self.configure(&block) - block.call(self.config) + block.call(config) end def self.init @asset_files ||= {} - @source_files = SourceFiles.new(self.config.sources) + @source_files = SourceFiles.new(config.sources) end def self.reset @asset_files = {} - self.config.reset + config.reset end def self.asset_file(digest_path) @asset_files[digest_path] ||= AssetFile.new(digest_path) end def self.[](digest_path) - self.asset_file(digest_path).tap do |af| + asset_file(digest_path).tap do |af| if af.fingerprint.nil? msg = +"error digesting `#{digest_path}`.\n\nMake sure Dassets has " \ "either a combination or source file for this digest path. If " \ "this path is for a combination, make sure Dassets has either " \ @@ -45,11 +45,11 @@ Dassets.combinations.keys.sort.each do |key| bullet = "#{key} => " values = Dassets.combinations[key].sort msg << ( ["#{bullet}#{values.first}"] + - (values[1..-1] || []).map{ |v| "#{" "*bullet.size}#{v}" } + (values[1..-1] || []).map{ |v| "#{" " * bullet.size}#{v}" } ).join("\n") msg << "\n\n" end msg << "\nSource file digest paths:" @@ -64,10 +64,10 @@ def self.source_files @source_files end def self.combinations - self.config.combinations + config.combinations end module SourceFiles def self.new(sources) # use a hash to store the source files so in the case two source files