sonic-pi
https://github.com/sonic-pi-net/sonic-pi
C++
Code. Music. Live.
Rugged::Blob#binary?
Determine if the blob content is most certainly binary or not. The heuristic used to guess if a file is binary is taken from core git: Searching for NUL bytes and looking for a reasonable ratio of printable to non-printable characters among the first 4000 bytes.
Edit
git clone [email protected]:sonic-pi-net/sonic-pi.git
cd sonic-pi
open app/server/ruby/vendor/rugged-1.7.1/ext/rugged/rugged_blob.c
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Rugged--Blob-binary--for-pr
# Commit to gitgit add app/server/ruby/vendor/rugged-1.7.1/ext/rugged/rugged_blob.cgit commit -m "better docs for Rugged::Blob#binary?"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Rugged--Blob-binary--for-pr
hub pull-request
# Celebrate!