Merge github.com:github/linguist

Conflicts:
	lib/linguist/vendor.yml
This commit is contained in:
Chris Kuehl
2013-11-04 20:32:52 -08:00
53 changed files with 13498 additions and 470 deletions

View File

@@ -197,6 +197,13 @@ class TestBlob < Test::Unit::TestCase
assert blob("C++/protocol-buffer.pb.cc").generated?
assert blob("Java/ProtocolBuffer.java").generated?
assert blob("Python/protocol_buffer_pb2.py").generated?
# Generated JNI
assert blob("C/jni_layer.h").generated?
# Minified CSS
assert !blob("CSS/bootstrap.css").generated?
assert blob("CSS/bootstrap.min.css").generated?
end
def test_vendored
@@ -209,6 +216,9 @@ class TestBlob < Test::Unit::TestCase
# Rails vendor/
assert blob("vendor/plugins/will_paginate/lib/will_paginate.rb").vendored?
# 'thirdparty' directory
assert blob("thirdparty/lib/main.c").vendored?
# C deps
assert blob("deps/http_parser/http_parser.c").vendored?
assert blob("deps/v8/src/v8.h").vendored?
@@ -232,8 +242,27 @@ class TestBlob < Test::Unit::TestCase
assert blob("public/javascripts/jquery-1.5.2.js").vendored?
assert blob("public/javascripts/jquery-1.6.1.js").vendored?
assert blob("public/javascripts/jquery-1.6.1.min.js").vendored?
assert blob("public/javascripts/jquery-1.10.1.js").vendored?
assert blob("public/javascripts/jquery-1.10.1.min.js").vendored?
assert !blob("public/javascripts/jquery.github.menu.js").vendored?
# jQuery UI
assert blob("themes/ui-lightness/jquery-ui.css").vendored?
assert blob("themes/ui-lightness/jquery-ui-1.8.22.custom.css").vendored?
assert blob("themes/ui-lightness/jquery.ui.accordion.css").vendored?
assert blob("ui/i18n/jquery.ui.datepicker-ar.js").vendored?
assert blob("ui/i18n/jquery-ui-i18n.js").vendored?
assert blob("ui/jquery.effects.blind.js").vendored?
assert blob("ui/jquery-ui-1.8.22.custom.js").vendored?
assert blob("ui/jquery-ui-1.8.22.custom.min.js").vendored?
assert blob("ui/jquery-ui-1.8.22.js").vendored?
assert blob("ui/jquery-ui-1.8.js").vendored?
assert blob("ui/jquery-ui.min.js").vendored?
assert blob("ui/jquery.ui.accordion.js").vendored?
assert blob("ui/minified/jquery.effects.blind.min.js").vendored?
assert blob("ui/minified/jquery.ui.accordion.min.js").vendored?
# MooTools
assert blob("public/javascripts/mootools-core-1.3.2-full-compat.js").vendored?
assert blob("public/javascripts/mootools-core-1.3.2-full-compat-yc.js").vendored?
@@ -249,10 +278,6 @@ class TestBlob < Test::Unit::TestCase
assert blob("public/javascripts/yahoo-min.js").vendored?
assert blob("public/javascripts/yuiloader-dom-event.js").vendored?
# LESS
assert blob("public/javascripts/less-1.1.0.js").vendored?
assert blob("public/javascripts/less-1.1.0.min.js").vendored?
# WYS editors
assert blob("public/javascripts/ckeditor.js").vendored?
assert blob("public/javascripts/tiny_mce.js").vendored?
@@ -278,6 +303,11 @@ class TestBlob < Test::Unit::TestCase
# jQuery validation plugin (MS bundles this with asp.net mvc)
assert blob("Scripts/jquery.validate.js").vendored?
assert blob("Scripts/jquery.validate.min.js").vendored?
assert blob("Scripts/jquery.validate.unobtrusive.js").vendored?
assert blob("Scripts/jquery.validate.unobtrusive.min.js").vendored?
assert blob("Scripts/jquery.unobtrusive-ajax.js").vendored?
assert blob("Scripts/jquery.unobtrusive-ajax.min.js").vendored?
# NuGet Packages
assert blob("packages/Modernizr.2.0.6/Content/Scripts/modernizr-2.0.6-development-only.js").vendored?
@@ -293,20 +323,6 @@ class TestBlob < Test::Unit::TestCase
assert blob("cordova-2.1.0.min.js").vendored?
end
def test_indexable
assert blob("Ruby/foo.rb").indexable?
assert !blob("Text/defu.nkt").indexable?
assert !blob("Text/dump.sql").indexable?
assert !blob("Binary/github.po").indexable?
assert !blob("Binary/linguist.gem").indexable?
# large binary blobs should fail on size check first, not call
# into charlock_holmes and alloc big buffers for testing encoding
b = blob("Binary/octocat.ai")
b.expects(:binary?).never
assert !b.indexable?
end
def test_language
Samples.each do |sample|
blob = blob(sample[:path])
@@ -327,13 +343,6 @@ class TestBlob < Test::Unit::TestCase
HTML
end
def test_colorize_without_wrapper
assert_equal <<-HTML, blob("Ruby/foo.rb").colorize_without_wrapper
<span class="k">module</span> <span class="nn">Foo</span>
<span class="k">end</span>
HTML
end
def test_colorize_does_skip_minified_files
assert_nil blob("JavaScript/jquery-1.6.1.min.js").colorize
end