mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 20:38:47 +00:00
Start detecting CSS
This commit is contained in:
@@ -21,6 +21,13 @@ module Linguist
|
|||||||
# Valid Languages types
|
# Valid Languages types
|
||||||
TYPES = [:data, :markup, :programming]
|
TYPES = [:data, :markup, :programming]
|
||||||
|
|
||||||
|
# Names of non-programming languages that we will still detect
|
||||||
|
#
|
||||||
|
# Returns an array
|
||||||
|
def self.detectable_markup
|
||||||
|
["CSS", "Less", "Sass"]
|
||||||
|
end
|
||||||
|
|
||||||
# Internal: Create a new Language object
|
# Internal: Create a new Language object
|
||||||
#
|
#
|
||||||
# attributes - A hash of attributes
|
# attributes - A hash of attributes
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ module Linguist
|
|||||||
# Skip vendored or generated blobs
|
# Skip vendored or generated blobs
|
||||||
next if blob.vendored? || blob.generated? || blob.language.nil?
|
next if blob.vendored? || blob.generated? || blob.language.nil?
|
||||||
|
|
||||||
# Only include programming languages
|
# Only include programming languages and acceptable markup languages
|
||||||
if blob.language.type == :programming
|
if blob.language.type == :programming || Language.detectable_markup.include?(blob.language.name)
|
||||||
@sizes[blob.language.group] += blob.size
|
@sizes[blob.language.group] += blob.size
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -366,6 +366,7 @@
|
|||||||
".zprofile",
|
".zprofile",
|
||||||
".zshenv",
|
".zshenv",
|
||||||
".zshrc",
|
".zshrc",
|
||||||
|
"Dockerfile",
|
||||||
"PKGBUILD",
|
"PKGBUILD",
|
||||||
"bash_logout",
|
"bash_logout",
|
||||||
"bash_profile",
|
"bash_profile",
|
||||||
@@ -387,8 +388,8 @@
|
|||||||
".gemrc"
|
".gemrc"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"tokens_total": 363334,
|
"tokens_total": 363536,
|
||||||
"languages_total": 432,
|
"languages_total": 433,
|
||||||
"tokens": {
|
"tokens": {
|
||||||
"ABAP": {
|
"ABAP": {
|
||||||
"*/**": 1,
|
"*/**": 1,
|
||||||
@@ -35824,24 +35825,24 @@
|
|||||||
"Shell": {
|
"Shell": {
|
||||||
"SHEBANG#!bash": 8,
|
"SHEBANG#!bash": 8,
|
||||||
"typeset": 5,
|
"typeset": 5,
|
||||||
"-": 364,
|
"-": 391,
|
||||||
"i": 1,
|
"i": 2,
|
||||||
"n": 22,
|
"n": 22,
|
||||||
"bottles": 6,
|
"bottles": 6,
|
||||||
"no": 16,
|
"no": 16,
|
||||||
"while": 3,
|
"while": 3,
|
||||||
"[": 84,
|
"[": 85,
|
||||||
"]": 84,
|
"]": 85,
|
||||||
"do": 8,
|
"do": 8,
|
||||||
"echo": 69,
|
"echo": 71,
|
||||||
"case": 9,
|
"case": 9,
|
||||||
"{": 63,
|
"{": 63,
|
||||||
"}": 61,
|
"}": 61,
|
||||||
"in": 25,
|
"in": 25,
|
||||||
")": 154,
|
")": 154,
|
||||||
"%": 5,
|
"%": 5,
|
||||||
"s": 13,
|
"s": 14,
|
||||||
";": 135,
|
";": 138,
|
||||||
"esac": 7,
|
"esac": 7,
|
||||||
"done": 8,
|
"done": 8,
|
||||||
"exit": 10,
|
"exit": 10,
|
||||||
@@ -35853,12 +35854,12 @@
|
|||||||
"export": 25,
|
"export": 25,
|
||||||
"SCREENDIR": 2,
|
"SCREENDIR": 2,
|
||||||
"fi": 34,
|
"fi": 34,
|
||||||
"PATH": 12,
|
"PATH": 14,
|
||||||
"/usr/local/bin": 4,
|
"/usr/local/bin": 6,
|
||||||
"/usr/local/sbin": 4,
|
"/usr/local/sbin": 6,
|
||||||
"/usr/xpg4/bin": 4,
|
"/usr/xpg4/bin": 4,
|
||||||
"/usr/sbin": 4,
|
"/usr/sbin": 6,
|
||||||
"/usr/bin": 6,
|
"/usr/bin": 8,
|
||||||
"/usr/sfw/bin": 4,
|
"/usr/sfw/bin": 4,
|
||||||
"/usr/ccs/bin": 4,
|
"/usr/ccs/bin": 4,
|
||||||
"/usr/openwin/bin": 4,
|
"/usr/openwin/bin": 4,
|
||||||
@@ -35880,8 +35881,8 @@
|
|||||||
"actually": 2,
|
"actually": 2,
|
||||||
"DISPLAY": 2,
|
"DISPLAY": 2,
|
||||||
"r": 17,
|
"r": 17,
|
||||||
"&&": 56,
|
"&&": 65,
|
||||||
".": 4,
|
".": 5,
|
||||||
"function": 6,
|
"function": 6,
|
||||||
"ls": 6,
|
"ls": 6,
|
||||||
"command": 5,
|
"command": 5,
|
||||||
@@ -35891,7 +35892,7 @@
|
|||||||
"long": 2,
|
"long": 2,
|
||||||
"format...": 2,
|
"format...": 2,
|
||||||
"ll": 2,
|
"ll": 2,
|
||||||
"|": 16,
|
"|": 17,
|
||||||
"less": 2,
|
"less": 2,
|
||||||
"XF": 2,
|
"XF": 2,
|
||||||
"pipe": 2,
|
"pipe": 2,
|
||||||
@@ -35905,7 +35906,7 @@
|
|||||||
"extglob": 2,
|
"extglob": 2,
|
||||||
"progcomp": 2,
|
"progcomp": 2,
|
||||||
"complete": 82,
|
"complete": 82,
|
||||||
"f": 65,
|
"f": 68,
|
||||||
"X": 54,
|
"X": 54,
|
||||||
"bunzip2": 2,
|
"bunzip2": 2,
|
||||||
"bzcat": 2,
|
"bzcat": 2,
|
||||||
@@ -35981,7 +35982,7 @@
|
|||||||
"opera": 2,
|
"opera": 2,
|
||||||
"w3m": 2,
|
"w3m": 2,
|
||||||
"galeon": 2,
|
"galeon": 2,
|
||||||
"curl": 6,
|
"curl": 8,
|
||||||
"dillo": 2,
|
"dillo": 2,
|
||||||
"elinks": 2,
|
"elinks": 2,
|
||||||
"links": 2,
|
"links": 2,
|
||||||
@@ -36006,7 +36007,7 @@
|
|||||||
"disown": 2,
|
"disown": 2,
|
||||||
"other": 2,
|
"other": 2,
|
||||||
"job": 3,
|
"job": 3,
|
||||||
"v": 9,
|
"v": 11,
|
||||||
"readonly": 4,
|
"readonly": 4,
|
||||||
"unset": 10,
|
"unset": 10,
|
||||||
"and": 5,
|
"and": 5,
|
||||||
@@ -36017,7 +36018,7 @@
|
|||||||
"helptopic": 2,
|
"helptopic": 2,
|
||||||
"help": 5,
|
"help": 5,
|
||||||
"helptopics": 2,
|
"helptopics": 2,
|
||||||
"a": 11,
|
"a": 12,
|
||||||
"unalias": 4,
|
"unalias": 4,
|
||||||
"aliases": 2,
|
"aliases": 2,
|
||||||
"binding": 2,
|
"binding": 2,
|
||||||
@@ -36037,7 +36038,7 @@
|
|||||||
"on": 4,
|
"on": 4,
|
||||||
"d": 9,
|
"d": 9,
|
||||||
"pushd": 2,
|
"pushd": 2,
|
||||||
"cd": 6,
|
"cd": 11,
|
||||||
"rmdir": 2,
|
"rmdir": 2,
|
||||||
"Make": 2,
|
"Make": 2,
|
||||||
"directory": 5,
|
"directory": 5,
|
||||||
@@ -36056,7 +36057,7 @@
|
|||||||
"as": 2,
|
"as": 2,
|
||||||
"bash...": 2,
|
"bash...": 2,
|
||||||
"quit": 2,
|
"quit": 2,
|
||||||
"q": 6,
|
"q": 8,
|
||||||
"even": 3,
|
"even": 3,
|
||||||
"shorter": 2,
|
"shorter": 2,
|
||||||
"D": 2,
|
"D": 2,
|
||||||
@@ -36083,7 +36084,7 @@
|
|||||||
"path": 13,
|
"path": 13,
|
||||||
"/opt/local/bin": 2,
|
"/opt/local/bin": 2,
|
||||||
"/opt/local/sbin": 2,
|
"/opt/local/sbin": 2,
|
||||||
"/bin": 2,
|
"/bin": 4,
|
||||||
"prompt": 2,
|
"prompt": 2,
|
||||||
"history": 18,
|
"history": 18,
|
||||||
"endif": 2,
|
"endif": 2,
|
||||||
@@ -36144,9 +36145,64 @@
|
|||||||
"fpath": 6,
|
"fpath": 6,
|
||||||
"HOME/.zsh/func": 2,
|
"HOME/.zsh/func": 2,
|
||||||
"U": 2,
|
"U": 2,
|
||||||
|
"docker": 1,
|
||||||
|
"version": 12,
|
||||||
|
"from": 1,
|
||||||
|
"ubuntu": 1,
|
||||||
|
"maintainer": 1,
|
||||||
|
"Solomon": 1,
|
||||||
|
"Hykes": 1,
|
||||||
|
"<solomon@dotcloud.com>": 1,
|
||||||
|
"run": 13,
|
||||||
|
"apt": 6,
|
||||||
|
"get": 6,
|
||||||
|
"install": 8,
|
||||||
|
"y": 5,
|
||||||
|
"git": 16,
|
||||||
|
"https": 2,
|
||||||
|
"//go.googlecode.com/files/go1.1.1.linux": 1,
|
||||||
|
"amd64.tar.gz": 1,
|
||||||
|
"tar": 1,
|
||||||
|
"C": 1,
|
||||||
|
"/usr/local": 1,
|
||||||
|
"xz": 1,
|
||||||
|
"env": 4,
|
||||||
|
"/usr/local/go/bin": 2,
|
||||||
|
"/sbin": 2,
|
||||||
|
"GOPATH": 1,
|
||||||
|
"/go": 1,
|
||||||
|
"CGO_ENABLED": 1,
|
||||||
|
"/tmp": 1,
|
||||||
|
"t.go": 1,
|
||||||
|
"go": 2,
|
||||||
|
"test": 1,
|
||||||
|
"PKG": 12,
|
||||||
|
"github.com/kr/pty": 1,
|
||||||
|
"REV": 6,
|
||||||
|
"c699": 1,
|
||||||
|
"clone": 5,
|
||||||
|
"http": 3,
|
||||||
|
"//": 3,
|
||||||
|
"/go/src/": 6,
|
||||||
|
"checkout": 3,
|
||||||
|
"github.com/gorilla/context/": 1,
|
||||||
|
"d61e5": 1,
|
||||||
|
"github.com/gorilla/mux/": 1,
|
||||||
|
"b36453141c": 1,
|
||||||
|
"iptables": 1,
|
||||||
|
"/etc/apt/sources.list": 1,
|
||||||
|
"update": 2,
|
||||||
|
"lxc": 1,
|
||||||
|
"aufs": 1,
|
||||||
|
"tools": 1,
|
||||||
|
"add": 1,
|
||||||
|
"/go/src/github.com/dotcloud/docker": 1,
|
||||||
|
"/go/src/github.com/dotcloud/docker/docker": 1,
|
||||||
|
"ldflags": 1,
|
||||||
|
"/go/bin": 1,
|
||||||
|
"cmd": 1,
|
||||||
"pkgname": 1,
|
"pkgname": 1,
|
||||||
"stud": 4,
|
"stud": 4,
|
||||||
"git": 9,
|
|
||||||
"pkgver": 1,
|
"pkgver": 1,
|
||||||
"pkgrel": 1,
|
"pkgrel": 1,
|
||||||
"pkgdesc": 1,
|
"pkgdesc": 1,
|
||||||
@@ -36162,7 +36218,6 @@
|
|||||||
"provides": 1,
|
"provides": 1,
|
||||||
"conflicts": 1,
|
"conflicts": 1,
|
||||||
"_gitroot": 1,
|
"_gitroot": 1,
|
||||||
"https": 1,
|
|
||||||
"//github.com/bumptech/stud.git": 1,
|
"//github.com/bumptech/stud.git": 1,
|
||||||
"_gitname": 1,
|
"_gitname": 1,
|
||||||
"build": 2,
|
"build": 2,
|
||||||
@@ -36170,14 +36225,12 @@
|
|||||||
"pull": 3,
|
"pull": 3,
|
||||||
"origin": 1,
|
"origin": 1,
|
||||||
"else": 10,
|
"else": 10,
|
||||||
"clone": 2,
|
|
||||||
"rm": 2,
|
"rm": 2,
|
||||||
"rf": 1,
|
"rf": 1,
|
||||||
"package": 1,
|
"package": 1,
|
||||||
"PREFIX": 1,
|
"PREFIX": 1,
|
||||||
"/usr": 1,
|
"/usr": 1,
|
||||||
"DESTDIR": 1,
|
"DESTDIR": 1,
|
||||||
"install": 2,
|
|
||||||
"Dm755": 1,
|
"Dm755": 1,
|
||||||
"init.stud": 1,
|
"init.stud": 1,
|
||||||
"mkdir": 2,
|
"mkdir": 2,
|
||||||
@@ -36246,7 +36299,6 @@
|
|||||||
"rbenv": 2,
|
"rbenv": 2,
|
||||||
"versions": 1,
|
"versions": 1,
|
||||||
"bare": 1,
|
"bare": 1,
|
||||||
"version": 11,
|
|
||||||
"&": 5,
|
"&": 5,
|
||||||
"prefix": 1,
|
"prefix": 1,
|
||||||
"/dev/null": 6,
|
"/dev/null": 6,
|
||||||
@@ -36428,7 +36480,6 @@
|
|||||||
"build.properties": 1,
|
"build.properties": 1,
|
||||||
"an": 1,
|
"an": 1,
|
||||||
"property": 1,
|
"property": 1,
|
||||||
"update": 1,
|
|
||||||
"disk.": 1,
|
"disk.": 1,
|
||||||
"That": 1,
|
"That": 1,
|
||||||
"scalacOptions": 3,
|
"scalacOptions": 3,
|
||||||
@@ -39431,7 +39482,7 @@
|
|||||||
"Scheme": 3478,
|
"Scheme": 3478,
|
||||||
"Scilab": 69,
|
"Scilab": 69,
|
||||||
"SCSS": 39,
|
"SCSS": 39,
|
||||||
"Shell": 3542,
|
"Shell": 3744,
|
||||||
"Slash": 187,
|
"Slash": 187,
|
||||||
"Standard ML": 243,
|
"Standard ML": 243,
|
||||||
"SuperCollider": 268,
|
"SuperCollider": 268,
|
||||||
@@ -39533,7 +39584,7 @@
|
|||||||
"Scheme": 1,
|
"Scheme": 1,
|
||||||
"Scilab": 3,
|
"Scilab": 3,
|
||||||
"SCSS": 1,
|
"SCSS": 1,
|
||||||
"Shell": 36,
|
"Shell": 37,
|
||||||
"Slash": 1,
|
"Slash": 1,
|
||||||
"Standard ML": 2,
|
"Standard ML": 2,
|
||||||
"SuperCollider": 2,
|
"SuperCollider": 2,
|
||||||
@@ -39555,5 +39606,5 @@
|
|||||||
"Xtend": 2,
|
"Xtend": 2,
|
||||||
"YAML": 1
|
"YAML": 1
|
||||||
},
|
},
|
||||||
"md5": "23dbdcbc5407d2cd14bbb5926d29774c"
|
"md5": "748cee37cde5be6ab7d9349db78010df"
|
||||||
}
|
}
|
||||||
@@ -266,10 +266,6 @@ class TestBlob < Test::Unit::TestCase
|
|||||||
assert blob("public/javascripts/yahoo-min.js").vendored?
|
assert blob("public/javascripts/yahoo-min.js").vendored?
|
||||||
assert blob("public/javascripts/yuiloader-dom-event.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
|
# WYS editors
|
||||||
assert blob("public/javascripts/ckeditor.js").vendored?
|
assert blob("public/javascripts/ckeditor.js").vendored?
|
||||||
assert blob("public/javascripts/tiny_mce.js").vendored?
|
assert blob("public/javascripts/tiny_mce.js").vendored?
|
||||||
|
|||||||
Reference in New Issue
Block a user