sprockets
https://github.com/rails/sprockets
Ruby
Rack-based asset packaging system
Sprockets::Utils::Gzip#can_compress?
Private: Returns whether or not an asset can be compressed. We want to compress any file that is text based. You do not want to compress binary files as they may already be compressed and running them through a compression algorithm would make them larger. Return Boolean.
Edit
git clone [email protected]:rails/sprockets.git
cd sprockets
open lib/sprockets/utils/gzip.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Sprockets--Utils--Gzip-can_compress--for-pr
# Commit to gitgit add lib/sprockets/utils/gzip.rbgit commit -m "better docs for Sprockets::Utils::Gzip#can_compress?"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Sprockets--Utils--Gzip-can_compress--for-pr
hub pull-request
# Celebrate!