Merge branch 'master' of git://github.com/github/linguist

This commit is contained in:
marc hoffman
2013-04-27 22:57:33 +02:00
12 changed files with 1176 additions and 5 deletions

View File

@@ -158,6 +158,13 @@ module Linguist
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 File

@@ -56,7 +56,8 @@ module Linguist
compiled_coffeescript? ||
xcode_project_file? ||
generated_net_docfile? ||
generated_parser?
generated_parser? ||
generated_protocol_buffer?
end
# Internal: Is the blob an XCode project file?
@@ -158,5 +159,16 @@ module Linguist
false
end
# Internal: Is the blob a C++, Java or Python source file generated by the
# Protocol Buffer compiler?
#
# Returns true of false.
def generated_protocol_buffer?
return false unless ['.py', '.java', '.h', '.cc', '.cpp'].include?(extname)
return false unless lines.count > 1
return lines[0].include?("Generated by the protocol buffer compiler. DO NOT EDIT!")
end
end
end

View File

@@ -1291,6 +1291,14 @@ TypeScript:
- ts
primary_extension: .ts
Unified Parallel C:
type: programming
group: C
lexer: C
ace_mode: c_cpp
color: "#755223"
primary_extension: .upc
VHDL:
type: programming
lexer: vhdl

View File

@@ -32,7 +32,8 @@ module Linguist
['/*', '*/'], # C
['<!--', '-->'], # XML
['{-', '-}'], # Haskell
['(*', '*)'] # Coq
['(*', '*)'], # Coq
['"""', '"""'] # Python
]
START_SINGLE_LINE_COMMENT = Regexp.compile(SINGLE_LINE_COMMENTS.map { |c|