Merge pull request #2392 from vighnesh1987/apache-thrift

Add Apache thrift support to generated? check
This commit is contained in:
Arfon Smith
2015-05-20 12:43:55 -05:00
9 changed files with 766 additions and 0 deletions

View File

@@ -67,6 +67,7 @@ module Linguist
compiled_cython_file? ||
generated_protocol_buffer_go? ||
generated_protocol_buffer? ||
generated_apache_thrift? ||
generated_jni_header? ||
generated_unity3d_meta? ||
vcr_cassette?
@@ -249,6 +250,16 @@ module Linguist
return lines[0].include?("Generated by the protocol buffer compiler. DO NOT EDIT!")
end
# Internal: Is the blob generated by Apache Thrift compiler?
#
# Returns true or false
def generated_apache_thrift?
return false unless ['.rb', '.py', '.go', '.js', '.m', '.java', '.h', '.cc', '.cpp'].include?(extname)
return false unless lines.count > 1
return lines[0].include?("Autogenerated by Thrift Compiler") || lines[1].include?("Autogenerated by Thrift Compiler")
end
# Internal: Is the blob a C/C++ header generated by the Java JNI tool javah?
#