diff --git a/lib/linguist/blob_helper.rb b/lib/linguist/blob_helper.rb index 85080b2b..5ca2b8b0 100644 --- a/lib/linguist/blob_helper.rb +++ b/lib/linguist/blob_helper.rb @@ -158,6 +158,13 @@ module Linguist extname.downcase == '.stl' end + # Public: Is the blob a PDF? + # + # Return true or false + def pdf? + extname.downcase == '.pdf' + end + MEGABYTE = 1024 * 1024 # Public: Is the blob too big to load? diff --git a/test/test_blob.rb b/test/test_blob.rb index 098ba748..836eb72f 100644 --- a/test/test_blob.rb +++ b/test/test_blob.rb @@ -137,6 +137,10 @@ class TestBlob < Test::Unit::TestCase assert blob("Text/cube.stl").solid? end + def test_pdf + assert blob("Binary/foo.pdf").pdf? + end + def test_viewable assert blob("Text/README").viewable? assert blob("Ruby/foo.rb").viewable?