mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
XCode and Visual Studio project detection in seperate methods
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user