Commit Graph

140 Commits

Author SHA1 Message Date
Brandon Keepers
d7fd12cb32 Remove deprecated method 2014-11-18 15:19:23 -05:00
Brandon Keepers
850ab6dedb #all_extensions already includes primary extension 2014-11-18 15:10:07 -05:00
Brandon Keepers
757801e32f Merge remote-tracking branch 'origin/master' into filename-matches-multiple-langages
* origin/master:
  Allow mime-types 2.x to be used with Linguist
  Upgrade to rugged 0.22.0b1
  Mention that languages need to be quite popular
  fix vendor/cache
  Gemfile.lock is nolonger considered generated
  Tests for BlobHelper#empty?
  remove reference to empty.js
  Remove more empty samples
  Bail earlier if the file is empty.
  Moving comments
  Use heuristics earlier to inform the rest of the classification process
  Removing inconsistency of `find_by_heuristics` (was sometimes returning nil and sometimes returning and empty array)
  Removing unused array of candidate languages.
  Reworking most heuristics to only return one match
2014-11-18 14:09:15 -05:00
Arfon Smith
0443c4db2d Merge pull request #1674 from github/rework-heuristics
Rework heuristics
2014-11-18 10:43:01 -06:00
Brandon Keepers
cd7549390e Extensions aren't actually required 2014-11-17 20:00:09 -05:00
Vicent Marti
4a10b27611 Remove Pygments 2014-11-14 17:37:12 +01:00
Adam Roben
160598b9ef Make it safe to pass nil to Language.find_by_name/alias again
This restores compatibility with v3.4.x.
2014-11-10 15:12:29 -05:00
Adam Roben
de188126fb Merge pull request #1683 from github/find-by-ext
Extract Language.find_by_extension
2014-11-10 14:37:45 -05:00
Adam Roben
97a1adcef1 Allow extensions without a leading dot
This makes the API a little easier to use.
2014-11-10 14:30:37 -05:00
Adam Roben
ffbe95d6e5 Fix docs 2014-11-10 14:15:21 -05:00
Brandon Keepers
228d89649a Add Language.find_by_extension 2014-11-07 10:27:07 -05:00
Adam Roben
751360ecf1 Make Language.[] and Language.find_by(alias|name) ignore case
This makes it easier to find a Linguist::Language for a fenced code
block in Markdown, where language names are often specified in
lowercase.
2014-11-07 10:09:55 -05:00
Brandon Keepers
df55043500 Bail earlier if the file is empty.
This will change behavior for empty files with unique extensions, returning nil instead of the language.
2014-11-06 14:49:24 -06:00
Arfon Smith
1831390429 Use heuristics earlier to inform the rest of the classification process 2014-11-06 14:09:19 -06:00
Brandon Keepers
cd743332f4 Use yajl since it is already a dependency
Both JSON and Yajl were listed as dependencies. Pygments.rb already requires yajl, so let's just use that instead of using both.
2014-10-17 14:45:28 -04:00
Vicent Marti
6e872c11b6 Pass tm_scope overrides 2014-10-13 17:19:38 +02:00
Vicent Marti
e5b6001759 Add support for TextMate scopes 2014-10-13 17:19:38 +02:00
Brandon Keepers
015af19eaf Move Samples::DATA constant to Samples.cache method 2014-09-16 10:25:30 -04:00
Max Horn
54a7cf6785 Fix typos 2014-09-15 13:24:39 +02:00
Arfon Smith
fae6dbfebd Taking Heuristics for a spin. 2014-09-04 13:49:30 -05:00
Arfon Smith
43923976c2 Adding test to check that languages.yml includes all extensions represented in samples folder 2014-08-11 14:16:25 -07:00
Arfon Smith
8c7b54d6e3 Fixing BlobHelper loading issue 2014-07-22 12:26:21 -05:00
Arfon Smith
529d3faaf8 Explictly load FileBlob 2014-07-18 20:40:14 -05:00
Arfon Smith
6af5adaac1 blob.mode 2014-07-09 12:56:50 -05:00
Arfon Smith
17a28f2e91 Merge branch 'master' into 1285-local
Conflicts:
	lib/linguist/language.rb
	lib/linguist/samples.json
2014-07-09 12:46:18 -05:00
Arfon Smith
bc7596a8b5 Removing second binary? check 2014-07-07 15:24:22 -05:00
Arfon Smith
986611ac36 Ask Charlock earlier 2014-07-04 21:12:46 -05:00
Vicent Marti
f5e4789ccb Properly handle detection of binary files 2014-07-03 18:29:19 +02:00
Vicent Marti
65eaf98d0b docs 2014-06-26 21:26:26 +02:00
Vicent Marti
ea1fc90cf5 Handle nil blob names 2014-06-24 17:43:01 +02:00
Vicent Marti
463f48f04f Mode must always be a String 2014-06-24 17:41:16 +02:00
Vicent Marti
c4260ae681 Use Rugged when computing Repository stats 2014-06-24 17:41:16 +02:00
Paul Chaignon
4f1a5cd456 Remove stylistic yet useless parentheses 2014-06-20 23:30:01 +02:00
Paul Chaignon
bd694c60e1 Custom File.extname method which returns the filename if it is an extension 2014-06-19 13:25:27 +02:00
Anthony Ramine
2d82071103 Delete primary_extension from language data
The language attribute is still maintained as the first extension found.

This allows Mercury to be properly detected by Linguist, as per #748.
2014-05-01 21:35:49 +02:00
Arfon Smith
152e3ace99 Adding all_extensions method to Language 2014-04-22 16:56:27 -05:00
Daniel van Hoesel
83a742621f Do not reset options when calling highlight 2013-12-31 13:44:19 +01:00
Ted Nyman
b7d23efc1b Include SCSS as detectable markup 2013-12-23 10:05:36 -08:00
Ted Nyman
3bc17e822d Start on basic heuristic approach 2013-12-14 23:33:21 -08:00
Ted Nyman
6bd97c7fc7 Bit of docs 2013-12-14 18:51:34 -08:00
Ted Nyman
6a8de63d2d Nicer debug factoring 2013-12-14 15:24:26 -08:00
Adam Krebs
fc9bc8b9e1 Add stylus support 2013-12-09 22:42:57 -05:00
Garen Torikian
ee519aeb4b Add helper method to retrieve languages by type 2013-12-08 16:12:03 -08:00
Ted Nyman
7e178cc416 Place guards, checks for multiline shell hacks 2013-12-06 22:04:40 -08:00
Ted Nyman
8603760ebe Merge branch 'master' into more-687 2013-12-06 20:32:22 -08:00
Charlie Somerville
bf11900bc9 prefer to load from languages.json if it exists 2013-12-04 15:58:34 +11:00
Eric Schulte
7a6202a8c3 language interpreters and shebang lines
Add an interpreter array to each language, and match interpreters found
in the shebang lines of scripts to this array to identify the language
of scripts.

With suggestions from tnm. https://github.com/github/linguist/pull/687
2013-11-09 11:44:17 -07:00
Ted Nyman
8b8123a3c1 Add TeX as detectable markup 2013-11-06 20:17:47 -08:00
Ted Nyman
9f00b5478d Revert "Merge pull request #695 from github/detect-prose"
This reverts commit 80321272b1, reversing
changes made to 02500d3830.
2013-10-28 11:21:56 -07:00
Charlie Somerville
a00967ddc4 Merge pull request #728 from github/fix-dup-primary-extension-for-mumps
Ensure no two languages have the same primary extension
2013-10-16 09:58:52 -07:00