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.

Source | Google | Stack overflow

Edit

git clone [email protected]:rails/sprockets.git

cd sprockets

open lib/sprockets/utils/gzip.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Sprockets--Utils--Gzip-can_compress--for-pr


# Commit to git

git add lib/sprockets/utils/gzip.rbgit commit -m "better docs for Sprockets::Utils::Gzip#can_compress?"


# Open pull request

gem 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!