Skip to content

Instantly share code, notes, and snippets.

@AlexanderEkdahl
Created April 3, 2013 10:36
Show Gist options
  • Save AlexanderEkdahl/5300123 to your computer and use it in GitHub Desktop.
Save AlexanderEkdahl/5300123 to your computer and use it in GitHub Desktop.
Check whether or not a file is gzipped
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