Detect minified JS

This commit is contained in:
Joshua Peek
2011-05-24 14:16:05 -05:00
parent 045a50dda8
commit d889887440
4 changed files with 8966 additions and 1 deletions

View File

@@ -63,7 +63,14 @@ module Linguist
end
def generated?
['.xib', '.nib', '.pbxproj'].include?(pathname.extname)
if ['.xib', '.nib', '.pbxproj'].include?(pathname.extname)
true
elsif pathname.extname == '.js'
# JS is minified if any lines are longer than 1000c
lines.any? { |l| l.length > 1000 }
else
false
end
end
vendored_paths = YAML.load_file(File.expand_path("../vendor.yml", __FILE__))