-
Notifications
You must be signed in to change notification settings - Fork 344
Closed
Description
Thank you for this excellent gem! I've been using it extensively and find it very helpful.
I've noticed an issue in the upload_file method:
asset_sync/lib/asset_sync/storage.rb
Lines 264 to 273 in 34ea7b3
| if config.compression | |
| compressed_name = "#{path}/#{f}.#{config.compression}" | |
| # `File.extname` returns value with `.` prefix, `config.compression` contains value without `.` | |
| if File.extname(f)[1..-1] == config.compression | |
| # Don't bother uploading compressed assets if we are in compression mode | |
| # as we will overwrite file.css with file.css.gz if it exists. | |
| log "Ignoring: #{f}" | |
| ignore = true | |
| elsif File.exist?(compressed_name) |
When config.compression is defined and the file doesn't satisfy the first if or elsif conditions, there's no log output for the upload.
Current behavior:
- Files that don't have corresponding compressed versions (like PNG files) are uploaded silently
- This makes it difficult to track which files are being processed during log analysis
Expected behavior:
- To maintain consistency with the case when compression is not configured, it would be helpful to always output log "Uploading: #{f}" for files that are actually uploaded.
Suggested fix:
- Add an else clause to ensure logging occurs for all uploaded files:
if config.compression
# existing logic...
if File.extname(f)[1..-1] == config.compression
# existing logic...
elsif File.exist?(compressed_name)
# existing logic...
else
log "Uploading: #{f}" # Add this line
end
end
This would greatly improve log analysis capabilities.
Thank you for your consideration!
Metadata
Metadata
Assignees
Labels
No labels