lib/dassets/source_file.rb in dassets-0.14.0 vs lib/dassets/source_file.rb in dassets-0.14.1
- old
+ new
@@ -6,22 +6,17 @@
module Dassets
class SourceFile
def self.find_by_digest_path(path, options = nil)
- # look in the configured source list
- source_files = Dassets.source_list.map{ |p| self.new(p) }
-
- # get the last matching one (in case two source files have the same digest
- # path the last one *should* be correct since it was last to be configured)
- source_files.select{ |s| s.digest_path == path }.last || NullSourceFile.new(path, options)
+ Dassets.source_files[path] || NullSourceFile.new(path, options)
end
attr_reader :file_path
def initialize(file_path)
@file_path = file_path.to_s
- @ext_list = File.basename(@file_path).split('.').reverse
+ @ext_list = File.basename(@file_path).split('.').reverse
end
# get the last matching one (in the case two sources with the same path are
# configured) since we select the last matching source file (from the last
# configured source) in `find_by_digest_path` above.