diff --git a/lib/linguist/blob_helper.rb b/lib/linguist/blob_helper.rb index e98d6323..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', '.csproj', '.dbproj', '.fsproj', '.pyproj', '.rbproj', '.vbproj', '.vcxproj', '.wixproj', '.resx', '.sln', '.vdproj', '.isproj'].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