Created
April 3, 2013 10:36
-
-
Save AlexanderEkdahl/5300123 to your computer and use it in GitHub Desktop.
Check whether or not a file is gzipped
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gzipped? file | |
File.read(path(file), 2) == [0x1F,0x8B].pack('c*').freeze | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment