Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Log the full path, including variant, that the digestor is trying to …
…find
  • Loading branch information
dhh committed Mar 21, 2014
1 parent 06b4f01 commit 4bca347
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions actionview/lib/action_view/digestor.rb
Expand Up @@ -75,20 +75,21 @@ def compute_and_store_digest(cache_key, options) # called under @@digest_monitor
end
end

attr_reader :name, :format, :variant, :finder, :options
attr_reader :name, :format, :variant, :path, :finder, :options

def initialize(options_or_deprecated_name, *deprecated_args)
options = self.class._options_for_digest(options_or_deprecated_name, *deprecated_args)
@options = options.except(:name, :format, :variant, :finder)
@name, @format, @variant, @finder = options.values_at(:name, :format, :variant, :finder)
@path = "#{@name}.#{format}".tap { |path| path << "+#{@variant}" if @variant }
end

def digest
Digest::MD5.hexdigest("#{source}-#{dependency_digest}").tap do |digest|
logger.try :info, "Cache digest for #{name}.#{format}: #{digest}"
logger.try :info, "Cache digest for #{path}: #{digest}"
end
rescue ActionView::MissingTemplate
logger.try :error, "Couldn't find template for digesting: #{name}.#{format}"
logger.try :error, "Couldn't find template for digesting: #{path}"
''
end

Expand Down

0 comments on commit 4bca347

Please sign in to comment.