diff --git a/lib/linguist/blob_helper.rb b/lib/linguist/blob_helper.rb index 559c593b..aa81aee1 100644 --- a/lib/linguist/blob_helper.rb +++ b/lib/linguist/blob_helper.rb @@ -171,6 +171,7 @@ module Linguist # # Includes: # - XCode project XML files + # - Visual Studio project XNL files # - Minified JavaScript # # Please add additional test coverage to @@ -178,7 +179,7 @@ module Linguist # # Return true or false def generated? - if ['.xib', '.nib', '.pbxproj', '.xcworkspacedata', '.xcuserstate'].include?(extname) + if xcode_project_file? || visual_studio_project_file? true elsif generated_coffeescript? || minified_javascript? true @@ -187,6 +188,36 @@ module Linguist end end + # Internal: Is the blob an XCode project file? + # + # Generated if the file extension is an XCode project + # file extension. + # + # Returns true of false. + + def xcode_project_file? + if ['.xib', '.nib', '.pbxproj', '.xcworkspacedata', '.xcuserstate'].include?(extname) + true + else + false + end + end + + # Internal: Is the blob a Visual Studio project file? + # + # Generated if the file extension is a Visual Studio project + # file extension. + # + # Returns true of false. + + def visual_studio_project_file? + if ['.csproj', '.dbproj', '.fsproj', '.pyproj', '.rbproj', '.vbproj', '.vcxproj', '.wixproj', '.resx', '.sln', '.vdproj', '.isproj'].include?(extname) + true + else + false + end + end + # Internal: Is the blob minified JS? # # Consider JS minified if the average line length is diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 4a068309..ac4178d4 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -937,7 +937,11 @@ XML: - .rdf - .rss - .svg + - .wxi + - .wxl + - .wxs - .wsdl + - .xaml - .xml - .xsd - .xsl diff --git a/test/test_blob.rb b/test/test_blob.rb index dbef035d..ced1e6dd 100644 --- a/test/test_blob.rb +++ b/test/test_blob.rb @@ -123,6 +123,19 @@ class TestBlob < Test::Unit::TestCase assert blob("MainMenu.nib").generated? assert blob("project.pbxproj").generated? + # Visual Studio Files + assert blob("project.csproj").generated? + assert blob("project.dbproj").generated? + assert blob("project.isproj").generated? + assert blob("project.pyproj").generated? + assert blob("project.rbproj").generated? + assert blob("project.vbproj").generated? + assert blob("project.vdproj").generated? + assert blob("project.vcxproj").generated? + assert blob("project.wixproj").generated? + assert blob("project.resx").generated? + assert blob("project.sln").generated? + # Long line assert !blob("uglify.js").generated?