lib/roda/plugins/assets.rb in roda-3.1.0 vs lib/roda/plugins/assets.rb in roda-3.2.0
- old
+ new
@@ -618,10 +618,16 @@
asset_dir = o[ltype]
if dirs && !dirs.empty?
dirs.each{|f| asset_dir = asset_dir[f]}
prefix = "#{dirs.join('/')}/" if o[:group_subdirs]
end
- Array(asset_dir).map{|f| "#{url_prefix}/#{o[:"#{stype}_prefix"]}#{"#{asset_last_modified(File.join(o[:"#{stype}_path"], *[prefix, f].compact)).to_i}/" if o[:timestamp_paths]}#{prefix}#{f}#{o[:"#{stype}_suffix"]}"}
+ Array(asset_dir).map do |f|
+ if o[:timestamp_paths]
+ mtime = asset_last_modified(File.join(o[:"#{stype}_path"], *[prefix, f].compact))
+ mtime = "#{sprintf("%i%06i", mtime.to_i, mtime.usec)}/"
+ end
+ "#{url_prefix}/#{o[:"#{stype}_prefix"]}#{mtime}#{prefix}#{f}#{o[:"#{stype}_suffix"]}"
+ end
end
end
# Return a string containing html tags for the given asset type.
# This will use a script tag for the :js type and a link tag for