Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add detection for CSV

  • Loading branch information...
commit b68732f0c7bd3c9a005230aa6bc4bc84a60fd31b 1 parent b99abba
@sshirokov sshirokov authored
View
7 lib/linguist/blob_helper.rb
@@ -158,6 +158,13 @@ def solid?
extname.downcase == '.stl'
end
+ # Public: Is this blob a CSV file?
+ #
+ # Return true or false
+ def csv?
+ text? && extname.downcase == '.csv'
+ end
+
# Public: Is the blob a PDF?
#
# Return true or false
View
3  samples/Text/cars.csv
@@ -0,0 +1,3 @@
+Year,Make,Model,Length
+1997,Ford,E350,2.34
+2000,Mercury,Cougar,2.38
View
4 test/test_blob.rb
@@ -137,6 +137,10 @@ def test_solid
assert blob("Text/cube.stl").solid?
end
+ def test_csv
+ assert blob("Text/cars.csv").csv?
+ end
+
def test_pdf
assert blob("Binary/foo.pdf").pdf?
end
Please sign in to comment.
Something went wrong with that request. Please try again.