From 1bd935b2b47db75e89e357ba8e344b4dd3308cf6 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 10 Nov 2014 11:43:30 +0100 Subject: [PATCH 01/31] Set 'lexer: GAP' for GAP My Pygments patch adding support for GAP was merged in April, and I verified that it is live on GitHub. --- lib/linguist/languages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 4d36d8d0..44ce9e64 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -817,6 +817,7 @@ GAMS: GAP: type: programming + lexer: GAP extensions: - .g - .gap From 6072a63f9952f8cada8e538ece4aac83d0692b0c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 10 Nov 2014 11:43:30 +0100 Subject: [PATCH 02/31] Add GAP .tst extension plus two sample files --- lib/linguist/languages.yml | 1 + samples/GAP/bugfix.tst | 161 +++++++++++++++++++++++++++++++++++++ samples/GAP/factor.tst | 21 +++++ 3 files changed, 183 insertions(+) create mode 100644 samples/GAP/bugfix.tst create mode 100644 samples/GAP/factor.tst diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 44ce9e64..b8192c26 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -823,6 +823,7 @@ GAP: - .gap - .gd - .gi + - .tst GAS: type: programming diff --git a/samples/GAP/bugfix.tst b/samples/GAP/bugfix.tst new file mode 100644 index 00000000..be4bd975 --- /dev/null +++ b/samples/GAP/bugfix.tst @@ -0,0 +1,161 @@ +gap> START_TEST("Test for various former bugs"); + + +gap> # The following used to trigger an error starting with: +gap> # "SolutionMat: matrix and vector incompatible called from" +gap> K:=AbelianPcpGroup([3,3,3]);; +gap> A:=Subgroup(K,[K.1]);; +gap> cr:=CRRecordBySubgroup(K,A);; +gap> ExtensionsCR(cr);; + + +# Comparing homomorphisms used to be broken +gap> K:=AbelianPcpGroup(1,[3]);; +gap> hom1:=GroupHomomorphismByImages(K,K,[K.1],[K.1]);; +gap> hom2:=GroupHomomorphismByImages(K,K,[K.1^2],[K.1^2]);; +gap> hom1=hom2; +true +gap> hom1=IdentityMapping(K); +true +gap> hom2=IdentityMapping(K); +true + + +gap> # The following incorrectly triggered an error at some point +gap> IsTorsionFree(ExamplesOfSomePcpGroups(5)); +true + + +gap> # Verify IsGeneratorsOfMagmaWithInverses warnings are silenced +gap> IsGeneratorsOfMagmaWithInverses(GeneratorsOfGroup(ExamplesOfSomePcpGroups(5))); +true + + +gap> # Check for a bug reported 2012-01-19 by Robert Morse +gap> g := PcGroupToPcpGroup(SmallGroup(48,1)); +Pcp-group with orders [ 2, 2, 2, 2, 3 ] +gap> # The next two commands used to trigger errors +gap> NonAbelianTensorSquare(Centre(g)); +Pcp-group with orders [ 8 ] +gap> NonAbelianExteriorSquare(Centre(g)); +Pcp-group with orders [ ] + + +gap> # Check for a bug reported 2012-01-19 by Robert Morse +gap> F := FreeGroup("x","y"); + +gap> x := F.1;; y := F.2;; +gap> G := F/[x^2/y^24, y^24, y^x/y^23]; + +gap> iso := IsomorphismPcGroup(G); +[ x, y ] -> [ f1, f2*f5 ] +gap> iso1 := IsomorphismPcpGroup(Image(iso)); +[ f1, f2, f3, f4, f5 ] -> [ g1, g2, g3, g4, g5 ] +gap> G := Image(iso*iso1); +Pcp-group with orders [ 2, 2, 2, 2, 3 ] +gap> # The next command used to trigger an error +gap> NonAbelianTensorSquare(Image(iso*iso1)); +Pcp-group with orders [ 2, 2, 3, 2, 2, 2, 2 ] + + +gap> # The problem with the previous example is/was that Igs(G) +gap> # is set to a non-standard value: +gap> Igs(G); +[ g1, g2*g5, g3*g4*g5^2, g4*g5, g5 ] +gap> # Unfortunately, it seems that a lot of code that +gap> # really should be using Ngs or Cgs is using Igs incorrectly. +gap> # For example, direct products could return *invalid* embeddings: +gap> D := DirectProduct(G, G); +Pcp-group with orders [ 2, 2, 2, 2, 3, 2, 2, 2, 2, 3 ] +gap> hom:=Embedding(D,1);; +gap> mapi:=MappingGeneratorsImages(hom);; +gap> GroupHomomorphismByImages(Source(hom),Range(hom),mapi[1],mapi[2]) <> fail; +true +gap> hom:=Projection(D,1);; +gap> mapi:=MappingGeneratorsImages(hom);; +gap> GroupHomomorphismByImages(Source(hom),Range(hom),mapi[1],mapi[2]) <> fail; +true + + +gap> # Check for bug computing Schur extension of infinite cyclic groups, +gap> # found by Max Horn 2012-05-25 +gap> G:=AbelianPcpGroup(1,[0]); +Pcp-group with orders [ 0 ] +gap> # The next command used to trigger an error +gap> SchurExtension(G); +Pcp-group with orders [ 0 ] + + +gap> # Check for bug computing Schur extensions of subgroups, found by MH 2012-05-25. +gap> G:=HeisenbergPcpGroup(2); +Pcp-group with orders [ 0, 0, 0, 0, 0 ] +gap> H:=Subgroup(G,[G.2^3*G.3^2, G.1^9]); +Pcp-group with orders [ 0, 0, 0 ] +gap> # The next command used to trigger an error +gap> SchurExtension(H); +Pcp-group with orders [ 0, 0, 0, 0, 0, 0 ] + + +gap> # Check for bug computing Schur extensions of subgroups, found by MH 2012-05-25. +gap> G:=HeisenbergPcpGroup(2); +Pcp-group with orders [ 0, 0, 0, 0, 0 ] +gap> H:=Subgroup(G,[G.1, G.2]); +Pcp-group with orders [ 0, 0 ] +gap> # The next command used to trigger an error +gap> SchurExtension(H); +Pcp-group with orders [ 0, 0, 0 ] + + +gap> # Check for bug computing normalizer of two subgroups, found by MH 2012-05-30. +gap> # The problem was caused by incorrect resp. overly restrictive use of Parent(). +gap> G:=HeisenbergPcpGroup(2); +Pcp-group with orders [ 0, 0, 0, 0, 0 ] +gap> A:=Subgroup(Subgroup(G,[G.2,G.3,G.4,G.5]), [G.3]); +Pcp-group with orders [ 0 ] +gap> B:=Subgroup(Subgroup(G,[G.1,G.4,G.5]), [G.4]); +Pcp-group with orders [ 0 ] +gap> Normalizer(A,B); +Pcp-group with orders [ 0 ] +gap> # The following used to trigger the error "arguments must have a common parent group" +gap> Normalizer(B,A); +Pcp-group with orders [ 0 ] + + +gap> # In polycyclic 2.9 and 2.10, the code for 2-cohomology computations was broken. +gap> G := UnitriangularPcpGroup(3,0); +Pcp-group with orders [ 0, 0, 0 ] +gap> mats := G!.mats; +[ [ [ 1, 1, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ], + [ [ 1, 0, 0 ], [ 0, 1, 1 ], [ 0, 0, 1 ] ], + [ [ 1, 0, 1 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ] ] +gap> C := CRRecordByMats(G,mats);; +gap> cc := TwoCohomologyCR(C);; +gap> cc.factor.rels; +[ 2, 0, 0 ] +gap> c := cc.factor.prei[2]; +[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 1 ] +gap> cc.gcb; +[ [ 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], + [ 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0 ], + [ 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1 ], + [ -1, 0, 1, 1, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 ], + [ 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 1 ] ] +gap> cc.gcc; +[ [ 1, 0, 0, 0, 0, -2, -1, 0, 1, 1, -1, -1, 0, 0, 0, 0, 0, 0 ], + [ 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0 ], + [ 0, 0, 1, 0, 0, -2, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0 ], + [ 0, 0, 0, 1, 0, 0, -1, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 ], + [ 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], + [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 1 ], + [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1 ] ] + + +gap> # LowerCentralSeriesOfGroup for non-nilpotent pcp-groups used to trigger +gap> # an infinite recursion +gap> G := PcGroupToPcpGroup(SmallGroup(6,1)); +Pcp-group with orders [ 2, 3 ] +gap> LowerCentralSeriesOfGroup(G); +[ Pcp-group with orders [ 2, 3 ], Pcp-group with orders [ 3 ] ] + + +gap> STOP_TEST( "bugfix.tst", 10000000); diff --git a/samples/GAP/factor.tst b/samples/GAP/factor.tst new file mode 100644 index 00000000..115fe921 --- /dev/null +++ b/samples/GAP/factor.tst @@ -0,0 +1,21 @@ +gap> START_TEST("Test of factor groups and natural homomorphisms"); + +gap> G:=HeisenbergPcpGroup(2); +Pcp-group with orders [ 0, 0, 0, 0, 0 ] + +gap> H:=Subgroup(G,[G.2,G.3,G.4,G.5]); +gap> K:=G/H; +gap> NaturalHomomorphism(K); + +gap> A:=Subgroup(H, [G.3]); +Pcp-group with orders [ 0 ] +gap> B:=Subgroup(Subgroup(G,[G.1,G.4,G.5]), [G.4]); +Pcp-group with orders [ 0 ] +gap> Normalizer(A,B); +Pcp-group with orders [ 0 ] +gap> # The following used to trigger the error "arguments must have a common parent group" +gap> Normalizer(B,A); +Pcp-group with orders [ 0 ] + + +gap> STOP_TEST( "factor.tst", 10000000); From ff6a10698ea5026f92285673c9761311a2d4c449 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 10 Nov 2014 11:43:30 +0100 Subject: [PATCH 03/31] Pass name of file being analyzed to find_by_heuristics Some languages are sensitive to file names in the sense that different kinds of files contain somewhat different data. Example: GAP .tst files contain test cases, which add some extra data compared to regular code, and as a consequence are not directly interchangeable with regular source code. Heuristics may need to take this into account, thus may need to know the name of the file being analyzed. --- lib/linguist/heuristics.rb | 3 ++- lib/linguist/language.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index 13f0173f..53bb10a9 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -7,11 +7,12 @@ module Linguist # apply heuristics against the given data and return an array # of matching languages, or nil. # + # name - Name of the file the data is coming from. # data - Array of tokens or String data to analyze. # languages - Array of language name Strings to restrict to. # # Returns an array of Languages or [] - def self.find_by_heuristics(data, languages) + def self.find_by_heuristics(name, data, languages) if active? result = [] diff --git a/lib/linguist/language.rb b/lib/linguist/language.rb index f4c7a62e..444c925c 100644 --- a/lib/linguist/language.rb +++ b/lib/linguist/language.rb @@ -120,7 +120,7 @@ module Linguist if possible_languages.length > 1 data = blob.data possible_language_names = possible_languages.map(&:name) - heuristic_languages = Heuristics.find_by_heuristics(data, possible_language_names) + heuristic_languages = Heuristics.find_by_heuristics(name, data, possible_language_names) if heuristic_languages.size > 1 possible_language_names = heuristic_languages.map(&:name) From f9ad5dda568ba2f476008de6f8fb0ba25622e3d5 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 10 Nov 2014 11:43:30 +0100 Subject: [PATCH 04/31] Add heuristic distinguishing GAP and Scilab .tst files --- lib/linguist/heuristics.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index 53bb10a9..d6c097ce 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -40,6 +40,9 @@ module Linguist if languages.all? { |l| ["FORTRAN", "Forth"].include?(l) } result = disambiguate_f(data) end + if name.end_with? ".tst" and languages.all? { |l| ["GAP", "Scilab"].include?(l) } + result = disambiguate_tst(data) + end return result end end @@ -98,6 +101,16 @@ module Linguist matches end + def self.disambiguate_tst(data) + matches = [] + if (data.include?("gap> ")) + matches << Language["GAP"] + else + matches << Language["Scilab"] + end + matches + end + def self.disambiguate_cl(data) matches = [] if data.include?("(defun ") From 034137f533550019da8a2127770b3a26d1223d00 Mon Sep 17 00:00:00 2001 From: Dale Henrichs Date: Thu, 18 Dec 2014 21:19:38 -0800 Subject: [PATCH 05/31] Use source.smalltalk to hightlight STON files. While not perfect, source.smalltalk is a better fit for highlighting STON files than source.json. When STON departs from pure JSON (often) the hightlighting is pretty bad. --- lib/linguist/languages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index d69b072a..b4f76ed5 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -2621,8 +2621,8 @@ STON: group: Smalltalk extensions: - .ston - tm_scope: source.json - ace_mode: lisp + tm_scope: source.smalltalk + ace_mode: text Sage: type: programming From 401067f63741d6c4d61ac9d2e9bcd613415ac184 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Fri, 2 Jan 2015 22:57:20 +0100 Subject: [PATCH 06/31] Revert #1438: add file extensions with multiple segments --- lib/linguist/languages.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 921c7ed2..aeb44f97 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -419,7 +419,7 @@ CLIPS: CMake: extensions: - .cmake - - .in + - .cmake.in filenames: - CMakeLists.txt ace_mode: text @@ -503,10 +503,10 @@ Clojure: - .cl2 - .cljc - .cljs + - .cljs.hl - .cljscm - .cljx - .hic - - .hl filenames: - riemann.config @@ -1171,6 +1171,7 @@ HTML: extensions: - .html - .htm + - .html.hl - .st - .xht - .xhtml @@ -1196,7 +1197,8 @@ HTML+ERB: - erb extensions: - .erb - - .deface + - .erb.deface + - .html.erb.deface ace_mode: html_ruby HTML+PHP: @@ -1227,7 +1229,8 @@ Haml: type: markup extensions: - .haml - - .deface + - .haml.deface + - .html.haml.deface ace_mode: haml Handlebars: From 546d4163a90dd100d997a82c59bca24fbfff749c Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Sat, 3 Jan 2015 09:27:43 +0100 Subject: [PATCH 07/31] Remove unnecessary file extensions --- lib/linguist/languages.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index aeb44f97..d639ad8d 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -1198,7 +1198,6 @@ HTML+ERB: extensions: - .erb - .erb.deface - - .html.erb.deface ace_mode: html_ruby HTML+PHP: @@ -1230,7 +1229,6 @@ Haml: extensions: - .haml - .haml.deface - - .html.haml.deface ace_mode: haml Handlebars: From fbe43b61d48f5a3207206631fbcf788d860b21d9 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Sat, 3 Jan 2015 09:37:40 +0100 Subject: [PATCH 08/31] Sample file for .cmake.in --- samples/CMake/uninstall.cmake.in | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 samples/CMake/uninstall.cmake.in diff --git a/samples/CMake/uninstall.cmake.in b/samples/CMake/uninstall.cmake.in new file mode 100644 index 00000000..a5b7436f --- /dev/null +++ b/samples/CMake/uninstall.cmake.in @@ -0,0 +1,22 @@ +IF (NOT EXISTS "@PROJECT_BINARY_DIR@/install_manifest.txt") + MESSAGE (FATAL_ERROR "Cannot find install manifest: \"@PROJECT_BINARY_DIR@/install_manifest.txt\"") +ENDIF (NOT EXISTS "@PROJECT_BINARY_DIR@/install_manifest.txt") + +FILE (READ "@PROJECT_BINARY_DIR@/install_manifest.txt" files) +STRING (REGEX REPLACE "\n" ";" files "${files}") +FOREACH (file ${files}) + MESSAGE (STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") + IF (EXISTS "$ENV{DESTDIR}${file}") + EXEC_PROGRAM ( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + IF (NOT "${rm_retval}" STREQUAL 0) + MESSAGE (FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") + ENDIF (NOT "${rm_retval}" STREQUAL 0) + ELSE (EXISTS "$ENV{DESTDIR}${file}") + MESSAGE (STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") + ENDIF (EXISTS "$ENV{DESTDIR}${file}") +ENDFOREACH (file) + From 2f86bd8bda1aaaf7dc587439686589bb30267299 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Sat, 3 Jan 2015 09:37:50 +0100 Subject: [PATCH 09/31] Sample file for .html.hl --- samples/HTML/index.html.hl | 328 +++++++++++++++++++++++++++++++++++++ 1 file changed, 328 insertions(+) create mode 100644 samples/HTML/index.html.hl diff --git a/samples/HTML/index.html.hl b/samples/HTML/index.html.hl new file mode 100644 index 00000000..65491957 --- /dev/null +++ b/samples/HTML/index.html.hl @@ -0,0 +1,328 @@ + + + + + + + + +
+

Example 1

+ + + + + +
+ + +
+ +

~{x}

+
+
+
+
+ + +
+

Example 2

+ + + + + +
+ + +
+ +

~{x}

+
+
+
+
+ + +
+

Example 3

+ + + + + +
+ + + +
+ +

~{x}

+
+
+
+
+ + +
+

Example 4

+ + + + + +
+ + +
+
+
+ + +
+

Example 5

+ + + + + +
+ + +
+
+
+ + +
+

Example 6

+ + + + + +
+ + +
+
+ +

~{x}

+
+
+
+
+
+ + +
+

Example 7

+ + + + + +
+ + +
+
+ +

~{x}

+
+
+
+
+
+ + +
+

Example 8

+ + + + + +
+ + +
+
+ +

~{x}

+
+
+
+
+
+ + +
+

Example 9

+ + + + + +
+ + +
+
+ + +
+

Example 10

+ + + + + +
+ + + +
+
+ + From 3c6218f20eba8eec014160ec90a04adfa01f985f Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Sun, 4 Jan 2015 22:07:29 +0100 Subject: [PATCH 10/31] Heuristics for .cs files: Smalltalk and C# --- lib/linguist/heuristics.rb | 8 ++++++++ test/test_heuristics.rb | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index 97c1015a..33df8958 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -69,6 +69,14 @@ module Linguist end end + disambiguate "C#", "Smalltalk" do |data| + if /![\w\s]+methodsFor: /.match(data) + Language["Smalltalk"] + elsif /^\s*namespace\s*[\w\.]+\s*{/.match(data) || /^\s*using\s*[\w\.]+\s*;/.match(data) + Language["C#"] + end + end + disambiguate "Objective-C", "C++", "C" do |data| if (/^[ \t]*@(interface|class|protocol|property|end|synchronised|selector|implementation)\b/.match(data)) Language["Objective-C"] diff --git a/test/test_heuristics.rb b/test/test_heuristics.rb index 7520e828..785fe58e 100644 --- a/test/test_heuristics.rb +++ b/test/test_heuristics.rb @@ -133,6 +133,13 @@ class TestHeuristcs < Minitest::Test }) end + def test_cs_by_heuristics + assert_heuristics({ + "C#" => all_fixtures("C#", "*.cs"), + "Smalltalk" => all_fixtures("Smalltalk", "*.cs") + }) + end + def assert_heuristics(hash) candidates = hash.keys.map { |l| Language[l] } From ec28ea299f0801bdb788e91ddf357c52558b75d6 Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Thu, 8 Jan 2015 14:03:35 -0600 Subject: [PATCH 11/31] Use path for Generated? --- lib/linguist/blob_helper.rb | 2 +- lib/linguist/file_blob.rb | 11 +++++++++++ lib/linguist/lazy_blob.rb | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/linguist/blob_helper.rb b/lib/linguist/blob_helper.rb index c368b4d0..8be8a8a4 100644 --- a/lib/linguist/blob_helper.rb +++ b/lib/linguist/blob_helper.rb @@ -301,7 +301,7 @@ module Linguist # # Return true or false def generated? - @_generated ||= Generated.generated?(name, lambda { data }) + @_generated ||= Generated.generated?(path, lambda { data }) end # Public: Detects the Language of the blob. diff --git a/lib/linguist/file_blob.rb b/lib/linguist/file_blob.rb index 04441935..19bb46ba 100644 --- a/lib/linguist/file_blob.rb +++ b/lib/linguist/file_blob.rb @@ -32,6 +32,17 @@ module Linguist # Returns a String attr_reader :name + # Public: Filename with Path + # + # Examples + # + # FileBlob.new("/path/to/linguist/lib/linguist.rb").path + # # => "/path/to/linguist/lib/linguist.rb" + # + # Returns a String + attr_reader :path + + # Public: Read file permissions # # Returns a String like '100644' diff --git a/lib/linguist/lazy_blob.rb b/lib/linguist/lazy_blob.rb index 9691bca5..34cd7f45 100644 --- a/lib/linguist/lazy_blob.rb +++ b/lib/linguist/lazy_blob.rb @@ -24,6 +24,10 @@ module Linguist @mode = mode end + def path + name + end + def git_attributes @git_attributes ||= repository.fetch_attributes( name, GIT_ATTR, GIT_ATTR_FLAGS) From 1f429fb4887ee4e05de55f115085bed51cc49129 Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Thu, 8 Jan 2015 14:06:00 -0600 Subject: [PATCH 12/31] Whitespace --- lib/linguist/file_blob.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/linguist/file_blob.rb b/lib/linguist/file_blob.rb index 19bb46ba..916bbec3 100644 --- a/lib/linguist/file_blob.rb +++ b/lib/linguist/file_blob.rb @@ -42,7 +42,6 @@ module Linguist # Returns a String attr_reader :path - # Public: Read file permissions # # Returns a String like '100644' From efd25ec4d2468ff5fed6280bf493c070bba9f641 Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Thu, 8 Jan 2015 15:08:28 -0600 Subject: [PATCH 13/31] Start using path with LazyBlob --- lib/linguist/lazy_blob.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/linguist/lazy_blob.rb b/lib/linguist/lazy_blob.rb index 34cd7f45..14477241 100644 --- a/lib/linguist/lazy_blob.rb +++ b/lib/linguist/lazy_blob.rb @@ -1,6 +1,7 @@ require 'linguist/blob_helper' require 'linguist/language' require 'rugged' +require 'pry' module Linguist class LazyBlob @@ -14,20 +15,18 @@ module Linguist attr_reader :repository attr_reader :oid - attr_reader :name + attr_reader :path attr_reader :mode - def initialize(repo, oid, name, mode = nil) + alias :name :path + + def initialize(repo, oid, path, mode = nil) @repository = repo @oid = oid - @name = name + @path = path @mode = mode end - def path - name - end - def git_attributes @git_attributes ||= repository.fetch_attributes( name, GIT_ATTR, GIT_ATTR_FLAGS) From 846cff572120f475324684c4c89a67c5b7b3fbb1 Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Thu, 8 Jan 2015 15:10:05 -0600 Subject: [PATCH 14/31] Remove pry --- lib/linguist/lazy_blob.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/linguist/lazy_blob.rb b/lib/linguist/lazy_blob.rb index 14477241..ab6c4bee 100644 --- a/lib/linguist/lazy_blob.rb +++ b/lib/linguist/lazy_blob.rb @@ -1,7 +1,6 @@ require 'linguist/blob_helper' require 'linguist/language' require 'rugged' -require 'pry' module Linguist class LazyBlob From f4c1cc576b1bf0a057213ca0bb333fa6de3afdf0 Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Fri, 9 Jan 2015 15:15:34 -0600 Subject: [PATCH 15/31] Modifying BlobHelper and FileBlob to use path --- lib/linguist/blob_helper.rb | 4 +-- lib/linguist/file_blob.rb | 28 +++++++++----------- test/test_blob.rb | 52 +++++++++++++++++++++++++------------ 3 files changed, 49 insertions(+), 35 deletions(-) diff --git a/lib/linguist/blob_helper.rb b/lib/linguist/blob_helper.rb index 8be8a8a4..07e1ee52 100644 --- a/lib/linguist/blob_helper.rb +++ b/lib/linguist/blob_helper.rb @@ -99,7 +99,7 @@ module Linguist elsif name.nil? "attachment" else - "attachment; filename=#{EscapeUtils.escape_url(File.basename(name))}" + "attachment; filename=#{EscapeUtils.escape_url(name)}" end end @@ -233,7 +233,7 @@ module Linguist # # Return true or false def vendored? - name =~ VendoredRegexp ? true : false + path =~ VendoredRegexp ? true : false end # Public: Get each line of data diff --git a/lib/linguist/file_blob.rb b/lib/linguist/file_blob.rb index 916bbec3..55a420ef 100644 --- a/lib/linguist/file_blob.rb +++ b/lib/linguist/file_blob.rb @@ -3,7 +3,7 @@ require 'linguist/blob_helper' module Linguist # A FileBlob is a wrapper around a File object to make it quack # like a Grit::Blob. It provides the basic interface: `name`, - # `data`, and `size`. + # `data`, `path` and `size`. class FileBlob include BlobHelper @@ -14,32 +14,21 @@ module Linguist # # Returns a FileBlob. def initialize(path, base_path = nil) - @path = path - @name = base_path ? path.sub("#{base_path}/", '') : path + @path = base_path ? path.sub("#{base_path}/", '') : path end # Public: Filename # # Examples # - # FileBlob.new("/path/to/linguist/lib/linguist.rb").name + # FileBlob.new("/path/to/linguist/lib/linguist.rb").path # # => "/path/to/linguist/lib/linguist.rb" # # FileBlob.new("/path/to/linguist/lib/linguist.rb", - # "/path/to/linguist").name + # "/path/to/linguist").path # # => "lib/linguist.rb" # # Returns a String - attr_reader :name - - # Public: Filename with Path - # - # Examples - # - # FileBlob.new("/path/to/linguist/lib/linguist.rb").path - # # => "/path/to/linguist/lib/linguist.rb" - # - # Returns a String attr_reader :path # Public: Read file permissions @@ -49,6 +38,13 @@ module Linguist File.stat(@path).mode.to_s(8) end + # Public: File name + # + # Returns a String + def name + File.basename(path) + end + # Public: Read file contents. # # Returns a String. @@ -77,7 +73,7 @@ module Linguist # # Returns an Array def extensions - basename, *segments = File.basename(name).split(".") + basename, *segments = File.basename(path).split(".") segments.map.with_index do |segment, index| "." + segments[index..-1].join(".") diff --git a/test/test_blob.rb b/test/test_blob.rb index 372ff13f..b70a60b2 100644 --- a/test/test_blob.rb +++ b/test/test_blob.rb @@ -22,14 +22,22 @@ class TestBlob < Minitest::Test File.expand_path("../fixtures", __FILE__) end - def sample_blob(name) + def sample_blob(name, enforce_relative = false) name = File.join(samples_path, name) unless name =~ /^\// - FileBlob.new(name, samples_path) + if enforce_relative + FileBlob.new(name, samples_path) + else + FileBlob.new(name) + end end - def fixture_blob(name) + def fixture_blob(name, enforce_relative = false) name = File.join(fixtures_path, name) unless name =~ /^\// - FileBlob.new(name, fixtures_path) + if enforce_relative + FileBlob.new(name, fixtures_path) + else + FileBlob.new(name) + end end def script_blob(name) @@ -251,8 +259,7 @@ class TestBlob < Minitest::Test assert sample_blob("Zephir/filenames/exception.zep.php").generated? assert !sample_blob("Zephir/Router.zep").generated? - - assert Linguist::Generated.generated?("node_modules/grunt/lib/grunt.js", nil) + assert sample_blob("node_modules/grunt/lib/grunt.js").generated? # Godep saved dependencies assert sample_blob("Godeps/Godeps.json").generated? @@ -264,7 +271,7 @@ class TestBlob < Minitest::Test assert !sample_blob("ext/extconf.rb").vendored? # Dependencies - assert sample_blob("dependencies/windows/headers/GL/glext.h").vendored? + assert sample_blob("dependencies/windows/headers/GL/glext.h", true).vendored? # Node dependencies assert sample_blob("node_modules/coffee-script/lib/coffee-script.js").vendored? @@ -289,8 +296,10 @@ class TestBlob < Minitest::Test assert sample_blob("external/jquery.min.js").vendored? # C deps - assert sample_blob("deps/http_parser/http_parser.c").vendored? - assert sample_blob("deps/v8/src/v8.h").vendored? + assert sample_blob("deps/http_parser/http_parser.c", true).vendored? + assert sample_blob("deps/v8/src/v8.h", true).vendored? + + assert sample_blob("tools/something/else.c", true).vendored? # Chart.js assert sample_blob("some/vendored/path/Chart.js").vendored? @@ -300,7 +309,10 @@ class TestBlob < Minitest::Test assert sample_blob("codemirror/mode/blah.js").vendored? # Debian packaging - assert sample_blob("debian/cron.d").vendored? + assert sample_blob("debian/cron.d", true).vendored? + + # Erlang + assert sample_blob("rebar", true).vendored? # Minified JavaScript and CSS assert sample_blob("foo.min.js").vendored? @@ -310,6 +322,9 @@ class TestBlob < Minitest::Test assert !sample_blob("foomin.css").vendored? assert !sample_blob("foo.min.txt").vendored? + #.osx + assert sample_blob(".osx", true).vendored? + # Prototype assert !sample_blob("public/javascripts/application.js").vendored? assert sample_blob("public/javascripts/prototype.js").vendored? @@ -317,6 +332,9 @@ class TestBlob < Minitest::Test assert sample_blob("public/javascripts/controls.js").vendored? assert sample_blob("public/javascripts/dragdrop.js").vendored? + # Samples + assert sample_blob("Samples/Ruby/foo.rb", true).vendored? + # jQuery assert sample_blob("jquery.js").vendored? assert sample_blob("public/javascripts/jquery.js").vendored? @@ -380,10 +398,10 @@ class TestBlob < Minitest::Test assert sample_blob("public/javascripts/modernizr.custom.01009.js").vendored? # Fabric - assert sample_blob("fabfile.py").vendored? + assert sample_blob("fabfile.py", true).vendored? # WAF - assert sample_blob("waf").vendored? + assert sample_blob("waf", true).vendored? # Visual Studio IntelliSense assert sample_blob("Scripts/jquery-1.7-vsdoc.js").vendored? @@ -405,7 +423,7 @@ class TestBlob < Minitest::Test assert sample_blob("Scripts/jquery.unobtrusive-ajax.min.js").vendored? # NuGet Packages - assert sample_blob("packages/Modernizr.2.0.6/Content/Scripts/modernizr-2.0.6-development-only.js").vendored? + assert sample_blob("packages/Modernizr.2.0.6/Content/Scripts/modernizr-2.0.6-development-only.js", true).vendored? # Font Awesome assert sample_blob("some/asset/path/font-awesome.min.css").vendored? @@ -415,15 +433,15 @@ class TestBlob < Minitest::Test assert sample_blob("some/asset/path/normalize.css").vendored? # Cocoapods - assert sample_blob('Pods/blah').vendored? + assert sample_blob('Pods/blah', true).vendored? # Html5shiv assert sample_blob("Scripts/html5shiv.js").vendored? assert sample_blob("Scripts/html5shiv.min.js").vendored? # Test fixtures - assert sample_blob("test/fixtures/random.rkt").vendored? - assert sample_blob("Test/fixtures/random.rkt").vendored? + assert sample_blob("test/fixtures/random.rkt", true).vendored? + assert sample_blob("Test/fixtures/random.rkt", true).vendored? # Cordova/PhoneGap assert sample_blob("cordova.js").vendored? @@ -437,7 +455,7 @@ class TestBlob < Minitest::Test assert sample_blob("foundation.abide.js").vendored? # Vagrant - assert sample_blob("Vagrantfile").vendored? + assert sample_blob("Vagrantfile", true).vendored? # Gradle assert sample_blob("gradlew").vendored? From fbc99cf7e662bc91e65dd18eb5af5960e5f60dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Abi=C3=A1n?= Date: Sun, 11 Jan 2015 19:43:20 +0100 Subject: [PATCH 16/31] Update languages.yml with *.sagews --- lib/linguist/languages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 77da5506..e1b57dc9 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -2648,6 +2648,7 @@ Sage: group: Python extensions: - .sage + - .sagews tm_scope: source.python ace_mode: python From ef4b25591b1a0a3060835b5cac885d4f14520932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Abi=C3=A1n?= Date: Sun, 11 Jan 2015 22:08:56 +0100 Subject: [PATCH 17/31] Sample sagews file, as requested --- samples/Sage/polinomios.sagews | 136 +++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 samples/Sage/polinomios.sagews diff --git a/samples/Sage/polinomios.sagews b/samples/Sage/polinomios.sagews new file mode 100644 index 00000000..4edb2234 --- /dev/null +++ b/samples/Sage/polinomios.sagews @@ -0,0 +1,136 @@ +# -*- coding: utf-8 -*- +# +# Funciones en Python/Sage para el trabajo con polinomios con una +# incógnita (x). +# +# Copyright (C) 2014-2015, David Abián +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# this program. If not, see . + +def pols (grado=-1, K=GF(2), mostrar=False): + """Devuelve la lista de polinomios constantes y no constantes de + coeficientes mónicos y grado igual o menor que el especificado. + Si el grado indicado no es válido, devuelve una lista vacía. + """ + lpols = [] + if not grado.is_integer(): + grado = grado.round() + if grado >= 0: + var('x') + xs = vector([(x^i) for i in range(grado+1)]) + V = VectorSpace(K,grado+1) + lpols = [cs*xs for cs in V] + if mostrar: + for pol in lpols: + print pol + return lpols + +def polsNoCtes (grado=-1, K=GF(2), mostrar=False): + """Devuelve la lista de polinomios no constantes de coeficientes mónicos y + grado igual o menor que el especificado. + Si el grado indicado no es válido, devuelve una lista vacía. + """ + lpols = [] + if not grado.is_integer(): + grado = grado.round() + if grado >= 0: + var('x') + xs = vector([(x^i) for i in range(grado+1)]) + for cs in K^(grado+1): + if cs[:grado] != vector(grado*[0]): # no constantes + lpols += [cs*xs] + if mostrar: + for pol in lpols: + print pol + return lpols + +def polsMismoGrado (grado=-1, K=GF(2), mostrar=False): + """Devuelve la lista de polinomios de coeficientes mónicos del grado + especificado. + Si el grado indicado no es válido, devuelve una lista vacía. + """ + lpols = [] + if not grado.is_integer(): + grado = grado.round() + if grado >= 0: + var('x') + xs = vector([(x^(grado-i)) for i in [0..grado]]) + for cs in K^(grado+1): + if cs[0] != 0: # polinomios del mismo grado + lpols += [cs*xs] + if mostrar: + for pol in lpols: + print pol + return lpols + +def excluirReducibles (lpols=[], mostrar=False): + """Filtra una lista dada de polinomios de coeficientes mónicos y devuelve + aquellos irreducibles. + """ + var('x') + irreds = [] + for p in lpols: + fp = (p.factor_list()) + if len(fp) == 1 and fp[0][1] == 1: + irreds += [p] + if mostrar: + for pol in irreds: + print pol + return irreds + +def vecPol (vec=random_vector(GF(2),0)): + """Transforma los coeficientes dados en forma de vector en el polinomio + que representan. + + Por ejemplo, con vecPol(vector([1,0,3,1])) se obtiene x³ + 3*x + 1. + + Para la función opuesta, véase polVec(). + """ + var('x') + xs = vector([x^(len(vec)-1-i) for i in range(len(vec))]) + return vec*xs + +def polVec (p=None): + """Devuelve el vector de coeficientes del polinomio dado que acompañan a la + incógnita x, de mayor a menor grado. + + Por ejemplo, con polVec(x^3 + 3*x + 1) se obtiene el vector (1, 0, 3, 1). + + Para la función opuesta, véase vecPol(). + """ + cs = [] + if p != None: + var('x') + p(x) = p + for i in [0..p(x).degree(x)]: + cs.append(p(x).coefficient(x,i)) + cs = list(reversed(cs)) + return vector(cs) + +def completar2 (p=0): + """Aplica el método de completar cuadrados en parábolas al polinomio dado de + grado 2 y lo devuelve en su nueva forma. + + Si el polinomio dado no es válido, devuelve 0. + + Por ejemplo, con complCuad(3*x^2 + 12*x + 5) se obtiene 3*(x + 2)^2 - 7. + """ + var('x') + p(x) = p.expand() + if p(x).degree(x) != 2: + p(x) = 0 + else: + cs = polVec(p(x)) + p(x) = cs[0]*(x+(cs[1]/(2*cs[0])))^2+(4*cs[0]*cs[2]-cs[1]^2)/(4*cs[0]) + return p(x) From 0328b1cb3c7c5540617fd30479f11f3e5c46afff Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Wed, 14 Jan 2015 08:54:49 -0500 Subject: [PATCH 18/31] Use the original FileBlob path for filesystem access FileBlob now remembers the full path that was passed to its constructor, and uses that for performing filesystem access. FileBlob#path continues to return a relative path as before. This ensures that you can call methods like #size and #mode on FileBlobs with relative paths, regardless of the current working directory. --- lib/linguist/file_blob.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/linguist/file_blob.rb b/lib/linguist/file_blob.rb index 55a420ef..2ca74c2d 100644 --- a/lib/linguist/file_blob.rb +++ b/lib/linguist/file_blob.rb @@ -14,6 +14,7 @@ module Linguist # # Returns a FileBlob. def initialize(path, base_path = nil) + @fullpath = path @path = base_path ? path.sub("#{base_path}/", '') : path end @@ -35,28 +36,28 @@ module Linguist # # Returns a String like '100644' def mode - File.stat(@path).mode.to_s(8) + File.stat(@fullpath).mode.to_s(8) end # Public: File name # # Returns a String def name - File.basename(path) + File.basename(@fullpath) end # Public: Read file contents. # # Returns a String. def data - File.read(@path) + File.read(@fullpath) end # Public: Get byte size # # Returns an Integer. def size - File.size(@path) + File.size(@fullpath) end # Public: Get file extension. @@ -73,7 +74,7 @@ module Linguist # # Returns an Array def extensions - basename, *segments = File.basename(path).split(".") + basename, *segments = name.split(".") segments.map.with_index do |segment, index| "." + segments[index..-1].join(".") From 96c7bc30d86d99af5f29c23dc84f3ecc0d5e7841 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Wed, 14 Jan 2015 08:57:14 -0500 Subject: [PATCH 19/31] Simplify blob tests Now that FileBlobs with relative paths can still access their files on disk, we can use relative paths for all FileBlobs in the test. This more closely matches the behavior in github.com's codebase, where all blobs use relative paths. --- test/test_blob.rb | 46 +++++++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/test/test_blob.rb b/test/test_blob.rb index b70a60b2..4c4f7978 100644 --- a/test/test_blob.rb +++ b/test/test_blob.rb @@ -22,22 +22,14 @@ class TestBlob < Minitest::Test File.expand_path("../fixtures", __FILE__) end - def sample_blob(name, enforce_relative = false) + def sample_blob(name) name = File.join(samples_path, name) unless name =~ /^\// - if enforce_relative - FileBlob.new(name, samples_path) - else - FileBlob.new(name) - end + FileBlob.new(name, samples_path) end - def fixture_blob(name, enforce_relative = false) + def fixture_blob(name) name = File.join(fixtures_path, name) unless name =~ /^\// - if enforce_relative - FileBlob.new(name, fixtures_path) - else - FileBlob.new(name) - end + FileBlob.new(name, fixtures_path) end def script_blob(name) @@ -271,7 +263,7 @@ class TestBlob < Minitest::Test assert !sample_blob("ext/extconf.rb").vendored? # Dependencies - assert sample_blob("dependencies/windows/headers/GL/glext.h", true).vendored? + assert sample_blob("dependencies/windows/headers/GL/glext.h").vendored? # Node dependencies assert sample_blob("node_modules/coffee-script/lib/coffee-script.js").vendored? @@ -296,10 +288,10 @@ class TestBlob < Minitest::Test assert sample_blob("external/jquery.min.js").vendored? # C deps - assert sample_blob("deps/http_parser/http_parser.c", true).vendored? - assert sample_blob("deps/v8/src/v8.h", true).vendored? + assert sample_blob("deps/http_parser/http_parser.c").vendored? + assert sample_blob("deps/v8/src/v8.h").vendored? - assert sample_blob("tools/something/else.c", true).vendored? + assert sample_blob("tools/something/else.c").vendored? # Chart.js assert sample_blob("some/vendored/path/Chart.js").vendored? @@ -309,10 +301,10 @@ class TestBlob < Minitest::Test assert sample_blob("codemirror/mode/blah.js").vendored? # Debian packaging - assert sample_blob("debian/cron.d", true).vendored? + assert sample_blob("debian/cron.d").vendored? # Erlang - assert sample_blob("rebar", true).vendored? + assert sample_blob("rebar").vendored? # Minified JavaScript and CSS assert sample_blob("foo.min.js").vendored? @@ -323,7 +315,7 @@ class TestBlob < Minitest::Test assert !sample_blob("foo.min.txt").vendored? #.osx - assert sample_blob(".osx", true).vendored? + assert sample_blob(".osx").vendored? # Prototype assert !sample_blob("public/javascripts/application.js").vendored? @@ -333,7 +325,7 @@ class TestBlob < Minitest::Test assert sample_blob("public/javascripts/dragdrop.js").vendored? # Samples - assert sample_blob("Samples/Ruby/foo.rb", true).vendored? + assert sample_blob("Samples/Ruby/foo.rb").vendored? # jQuery assert sample_blob("jquery.js").vendored? @@ -398,10 +390,10 @@ class TestBlob < Minitest::Test assert sample_blob("public/javascripts/modernizr.custom.01009.js").vendored? # Fabric - assert sample_blob("fabfile.py", true).vendored? + assert sample_blob("fabfile.py").vendored? # WAF - assert sample_blob("waf", true).vendored? + assert sample_blob("waf").vendored? # Visual Studio IntelliSense assert sample_blob("Scripts/jquery-1.7-vsdoc.js").vendored? @@ -423,7 +415,7 @@ class TestBlob < Minitest::Test assert sample_blob("Scripts/jquery.unobtrusive-ajax.min.js").vendored? # NuGet Packages - assert sample_blob("packages/Modernizr.2.0.6/Content/Scripts/modernizr-2.0.6-development-only.js", true).vendored? + assert sample_blob("packages/Modernizr.2.0.6/Content/Scripts/modernizr-2.0.6-development-only.js").vendored? # Font Awesome assert sample_blob("some/asset/path/font-awesome.min.css").vendored? @@ -433,15 +425,15 @@ class TestBlob < Minitest::Test assert sample_blob("some/asset/path/normalize.css").vendored? # Cocoapods - assert sample_blob('Pods/blah', true).vendored? + assert sample_blob('Pods/blah').vendored? # Html5shiv assert sample_blob("Scripts/html5shiv.js").vendored? assert sample_blob("Scripts/html5shiv.min.js").vendored? # Test fixtures - assert sample_blob("test/fixtures/random.rkt", true).vendored? - assert sample_blob("Test/fixtures/random.rkt", true).vendored? + assert sample_blob("test/fixtures/random.rkt").vendored? + assert sample_blob("Test/fixtures/random.rkt").vendored? # Cordova/PhoneGap assert sample_blob("cordova.js").vendored? @@ -455,7 +447,7 @@ class TestBlob < Minitest::Test assert sample_blob("foundation.abide.js").vendored? # Vagrant - assert sample_blob("Vagrantfile", true).vendored? + assert sample_blob("Vagrantfile").vendored? # Gradle assert sample_blob("gradlew").vendored? From 1a1e21f34407e758fca0c92d488c6caa5254f6e5 Mon Sep 17 00:00:00 2001 From: phuicy Date: Wed, 14 Jan 2015 18:11:33 +0000 Subject: [PATCH 20/31] Added Web Ontology Language Support As syntax is only xml, it is a very simple fix. --- lib/linguist/languages.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index e1b57dc9..ec614526 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -3090,6 +3090,12 @@ WebIDL: - .webidl tm_scope: source.webidl ace_mode: text + +Web Ontology Language: + type: markup + extensions: + - .owl + ace_mode: xml XC: type: programming From d39f5eedf1f3dd28a48c1eaa1a05aee4bac52934 Mon Sep 17 00:00:00 2001 From: Guy Burroughes Date: Wed, 14 Jan 2015 19:14:16 +0000 Subject: [PATCH 21/31] Fixed issues for web ontology to pass tests --- lib/linguist/languages.yml | 14 +- samples/Web Ontology Language/sample.owl | 6858 ++++++++++++++++++++++ 2 files changed, 6866 insertions(+), 6 deletions(-) create mode 100644 samples/Web Ontology Language/sample.owl diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index ec614526..fd5241a7 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -3084,18 +3084,20 @@ Volt: tm_scope: source.d ace_mode: d +Web Ontology Language: + type: markup + color: "#3994bc" + extensions: + - .owl + tm_scope: text.xml + ace_mode: xml + WebIDL: type: programming extensions: - .webidl tm_scope: source.webidl ace_mode: text - -Web Ontology Language: - type: markup - extensions: - - .owl - ace_mode: xml XC: type: programming diff --git a/samples/Web Ontology Language/sample.owl b/samples/Web Ontology Language/sample.owl new file mode 100644 index 00000000..612186db --- /dev/null +++ b/samples/Web Ontology Language/sample.owl @@ -0,0 +1,6858 @@ + + + + + + + +]> + + + + + v.1.4. Added Food class (used in domain/range of hasIngredient), Added several hasCountryOfOrigin restrictions on pizzas, Made hasTopping invers functional + version 1.5 + v.1.5. Removed protege.owl import and references. Made ontology URI date-independent + An example ontology that contains all constructs required for the various versions of the Pizza Tutorial run by Manchester University (see http://www.co-ode.org/resources/tutorials/) + + + + + + + + + + + + + Americana + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AmericanaPicante + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CoberturaDeAnchovies + + + + + + + + + + + CoberturaDeArtichoke + + + + + + + + + + + + + + + + + CoberturaDeAspargos + + + + + + + + + + + + + + + + + Cajun + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CoberturaDeCajun + + + + + + + + + + + + + + + + + CoberturaDeCaper + + + + + + + + + + + + + + + + + Capricciosa + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Caprina + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CoberturaDeQueijo + + + + + + + + + + + Any pizza that has at least 1 cheese topping. + PizzaComQueijo + + + + + + + + + + + + + + + + + + + CoberturaDeQueijoComVegetais + This class will be inconsistent. This is because we have given it 2 disjoint parents, which means it could never have any members (as nothing can simultaneously be a CheeseTopping and a VegetableTopping). NB Called ProbeInconsistentTopping in the ProtegeOWL Tutorial. + + + + + + + + + + + + + + CoberturaDeFrango + + + + + + + + + + + + + + + + + Pais + A class that is equivalent to the set of individuals that are described in the enumeration - ie Countries can only be either America, England, France, Germany or Italy and nothing else. Note that these individuals have been asserted to be allDifferent from each other. + + + + + + + + + + + + + + + + + + + + + + + + BaseEspessa + + + + + + + + + + + + + + + + + Fiorentina + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CoberturaDePeixe + + + + + + + + + + + + + + + + + + + + + + + + + + + CoberturaQuatroQueijos + + + + + + + + + + + + + + + + + QuatroQueijos + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CoberturaDeFrutas + + + + + + + + + + + FrutosDoMar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CoberturaDeAlho + + + + + + + + + + + + + + + + + Giardiniera + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CoberturaDeQueijoDeCabra + + + + + + + + + + + + + + + + + CoberturaDeGorgonzola + + + + + + + + + + + + + + + + + CoberturaDePimentaoVerde + + + + + + + + + + + CoberturaDePresunto + + + + + + + + + + + CoberturaDeErvas + + + + + + + + + + + Picante + + + + + + + + + + + CoberturaDePimentaoVerdePicante + + + + + + + + + + + + + + + + + CoberturaDeBifePicante + + + + + + + + + + + + + + + + + A class to demonstrate mistakes made with setting a property domain. The property hasTopping has a domain of Pizza. This means that the reasoner can infer that all individuals using the hasTopping property must be of type Pizza. Because of the restriction on this class, all members of IceCream must use the hasTopping property, and therefore must also be members of Pizza. However, Pizza and IceCream are disjoint, so this causes an inconsistency. If they were not disjoint, IceCream would be inferred to be a subclass of Pizza. + Sorvete + + + + + + + + + + + + + + + + + PizzaInteressante + Any pizza that has at least 3 toppings. Note that this is a cardinality constraint on the hasTopping property and NOT a qualified cardinality constraint (QCR). A QCR would specify from which class the members in this relationship must be. eg has at least 3 toppings from PizzaTopping. This is currently not supported in OWL. + + + + + + 3 + + + + + + + + + + + + + CoberturaDeJalapeno + + + + + + + + + + + + + + + + + LaReine + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CoberturaDeLeek + + + + + + + + + + + + + + + + + Margherita + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CoberturaDeCarne + + + + + + + + + + + Any pizza that has at least one meat topping + PizzaDeCarne + + + + + + + + + + + + + + + + + + + Media + + + + + + + + + + + NaoPicante + + + + + + + + + + + CoberturaDeFrutosDoMarMistos + + + + + + + + + + + CoberturaDeMozzarella + + + + + + + + + + + + + + + + + + + + + + + Cogumelo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CoberturaDeCogumelo + + + + + + + + + + + + + + + + + A pizza that can be found on a pizza menu + PizzaComUmNome + + + + + + + + + + + Napoletana + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Any Pizza that is not a VegetarianPizza + PizzaNaoVegetariana + + + + + + + + + + + + + + + + + + + + CoberturaDeCastanha + + + + + + + + + + + + + + + + + CoberturaDeAzeitona + + + + + + + + + + + + + + + + + CoberturaDeCebola + + + + + + + + + + + + + + + + + CoberturaDePrezuntoParma + + + + + + + + + + + + + + + + + Parmense + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CoberturaDeParmesao + + + + + + + + + + + + + + + + + CoberturaPeperonata + + + + + + + + + + + + + + + + + CoberturaDeCalabreza + + + + + + + + + + + + + + + + + CoberturaDePimentao + + + + + + + + + + + CoberturaPetitPois + + + + + + + + + + + + + + + + + CoberturaPineKernels + + + + + + + + + + + Pizza + + + + + + + + + + + + + + + + + BaseDaPizza + + + + + + + + + + + CoberturaDaPizza + + + + + + + + + + + PolloAdAstra + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CoberturaDeCamarao + + + + + + + + + + + CoberturaPrinceCarlo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + QuatroQueijos + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This defined class has conditions that are part of the definition: ie any Pizza that has the country of origin, Italy is a RealItalianPizza. It also has conditions that merely describe the members - that all RealItalianPizzas must only have ThinAndCrispy bases. In essence, all pizzas from Italy must have ThinAndCrispy bases. + PizzaItalianaReal + + + + + + + + + + + + + + + + + + + + + + + + + CoberturaDeCebolaVermelha + + + + + + + + + + + CoberturaRocket + + + + + + + + + + + + + + + + + Rosa + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CoberturaRosemary + + + + + + + + + + + + + + + + + CoberturaEmMolho + + + + + + + + + + + Siciliana + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CoberturaDeTomateFatiado + + + + + + + + + + + + + + + + + SloppyGiuseppe + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Soho + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A ValuePartition that describes only values from Hot, Medium or Mild. NB Subclasses can themselves be divided up into further partitions. + Tempero + + + + + + + + + + + + + + + + + + + + Any pizza that has a spicy topping is a SpicyPizza + PizzaTemperada + + + + + + + + + + + + + + + + + + + An alternative definition for the SpicyPizza which does away with needing a definition of SpicyTopping and uses a slightly more complicated restriction: Pizzas that have at least one topping that is both a PizzaTopping and has spiciness hot are members of this class. + PizzaTemperadaEquivalente + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Any pizza topping that has spiciness Hot + CoberturaTemperada + + + + + + + + + + + + + + + + + + + CoberturaDeEspinafre + + + + + + + + + + + + + + + + + CoberturaSultana + + + + + + + + + + + + + + + + + CoberturaDeTomateRessecadoAoSol + + + + + + + + + + + + + + + + + CoberturaDePimentaoDoce + + + + + + + + + + + + + + + + + BaseFinaEQuebradica + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MolhoTobascoPepper + + + + + + + + + + + + + + + + + CoberturaDeTomate + + + + + + + + + + + + + + + + + PizzaAberta + An unclosed Pizza cannot be inferred to be either a VegetarianPizza or a NonVegetarianPizza, because it might have other toppings. + + + + + + + + + + + + + + + + + ValorDaParticao + A ValuePartition is a pattern that describes a restricted set of classes from which a property can be associated. The parent class is used in restrictions, and the covering axiom means that only members of the subclasses may be used as values. The possible subclasses cannot be extended without updating the ValuePartition class. + + + + + + + + CoberturaDeVegetais + + + + + + + + + + + PizzaVegetariana + Any pizza that does not have fish topping and does not have meat topping is a VegetarianPizza. Members of this class do not need to have any toppings at all. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Any pizza that only has vegetarian toppings or no toppings is a VegetarianPizzaEquiv1. Should be inferred to be equivalent to VegetarianPizzaEquiv2. Not equivalent to VegetarianPizza because PizzaTopping is not covering + PizzaVegetarianaEquivalente1 + + + + + + + + + + + + + + + + + + + An alternative to VegetarianPizzaEquiv1 that does not require a definition of VegetarianTopping. Perhaps more difficult to maintain. Not equivalent to VegetarianPizza + PizzaVegetarianaEquivalente2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An example of a covering axiom. VegetarianTopping is equivalent to the union of all toppings in the given axiom. VegetarianToppings can only be Cheese or Vegetable or....etc. + CoberturaVegetariana + + + + + + + + + + + + + + + + + + + + + + + + + Veneziana + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NB Transitive - the ingredients of ingredients are ingredients of the whole + + + + + + + + + + + + + + + + + + A property created to be used with the ValuePartition - Spiciness. + + + + + + + + + + + + Note that hasTopping is inverse functional because isToppingOf is functional + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The inverse property tree to hasIngredient - all subproperties and attributes of the properties should reflect those under hasIngredient. + + + + + + + + + + + + + + + + + + Any given instance of topping should only be added to a single pizza (no cheap half-measures on our pizzas) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 774d18ed8f651155c3554b9b3851960030f0352f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Michael=20O=2E=20Hegg=C3=B8?= Date: Sat, 6 Dec 2014 21:39:32 +0100 Subject: [PATCH 22/31] Add support for Turtle and SPARQL --- .gitmodules | 3 + grammars.yml | 3 + lib/linguist/languages.yml | 15 +++ samples/SPARQL/foaf.sparql | 7 + samples/SPARQL/string-matching.sparql | 40 ++++++ samples/Turtle/gnd-record.ttl | 183 ++++++++++++++++++++++++++ samples/Turtle/rdf-syntax-grammar.ttl | 10 ++ vendor/grammars/turtle.tmbundle | 1 + 8 files changed, 262 insertions(+) create mode 100644 samples/SPARQL/foaf.sparql create mode 100644 samples/SPARQL/string-matching.sparql create mode 100644 samples/Turtle/gnd-record.ttl create mode 100644 samples/Turtle/rdf-syntax-grammar.ttl create mode 160000 vendor/grammars/turtle.tmbundle diff --git a/.gitmodules b/.gitmodules index af8c2d11..79209740 100644 --- a/.gitmodules +++ b/.gitmodules @@ -546,3 +546,6 @@ [submodule "vendor/grammars/Racket"] path = vendor/grammars/Racket url = https://github.com/soegaard/racket-highlight-for-github +[submodule "vendor/grammars/turtle.tmbundle"] + path = vendor/grammars/turtle.tmbundle + url = https://github.com/peta/turtle.tmbundle diff --git a/grammars.yml b/grammars.yml index bb06d939..c85b2de6 100644 --- a/grammars.yml +++ b/grammars.yml @@ -452,6 +452,9 @@ vendor/grammars/thrift.tmbundle: - source.thrift vendor/grammars/toml.tmbundle: - source.toml +vendor/grammars/turtle.tmbundle: +- source.sparql +- source.turtle vendor/grammars/verilog.tmbundle: - source.verilog vendor/grammars/x86-assembly-textmate-bundle: diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index e1b57dc9..9f178663 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -2613,6 +2613,14 @@ SCSS: extensions: - .scss +SPARQL: + type: data + tm_scope: source.sparql + ace_mode: text + extensions: + - .sparql + - .rq + SQF: type: programming color: "#FFCB1F" @@ -2970,6 +2978,13 @@ Turing: tm_scope: none ace_mode: text +Turtle: + type: data + extensions: + - .ttl + tm_scope: source.turtle + ace_mode: text + Twig: type: markup group: PHP diff --git a/samples/SPARQL/foaf.sparql b/samples/SPARQL/foaf.sparql new file mode 100644 index 00000000..699360c7 --- /dev/null +++ b/samples/SPARQL/foaf.sparql @@ -0,0 +1,7 @@ +PREFIX foaf: +SELECT ?name ?email +WHERE { + ?person a foaf:Person. + ?person foaf:name ?name. + ?person foaf:mbox ?email. +} diff --git a/samples/SPARQL/string-matching.sparql b/samples/SPARQL/string-matching.sparql new file mode 100644 index 00000000..424ca987 --- /dev/null +++ b/samples/SPARQL/string-matching.sparql @@ -0,0 +1,40 @@ +PREFIX owl: +PREFIX rdf: +PREFIX skos: + +SELECT DISTINCT ?s ?label +WHERE { + SERVICE + { + SELECT DISTINCT ?s ?label ?plabel ?alabel ?hlabel (GROUP_CONCAT(DISTINCT STR(?type)) as ?types) + WHERE { + GRAPH + { + ?s rdf:type + { + ?s rdf:type ?type . + ?s ?prop ?match . + FILTER ( + strstarts(lcase(str(?match)), "test") && !(?match != ?label && strstarts(lcase(str(?label)), "test")) + ) + OPTIONAL { + ?s skos:prefLabel ?label . + FILTER (langMatches(lang(?label), "en")) + } + OPTIONAL { # in case previous OPTIONAL block gives no labels + ?s ?prop ?match . + ?s skos:prefLabel ?label . + FILTER (langMatches(lang(?label), lang(?match))) } + } + FILTER NOT EXISTS { ?s owl:deprecated true } + } + BIND(IF(?prop = skos:prefLabel && ?match != ?label, ?match, "") as ?plabel) + BIND(IF(?prop = skos:altLabel, ?match, "") as ?alabel) + BIND(IF(?prop = skos:hiddenLabel, ?match, "") as ?hlabel) + VALUES (?prop) { (skos:prefLabel) (skos:altLabel) (skos:hiddenLabel) } + } + GROUP BY ?match ?s ?label ?plabel ?alabel ?hlabel ?prop + ORDER BY lcase(str(?match)) lang(?match) + LIMIT 10 + } +} diff --git a/samples/Turtle/gnd-record.ttl b/samples/Turtle/gnd-record.ttl new file mode 100644 index 00000000..ef1d2c35 --- /dev/null +++ b/samples/Turtle/gnd-record.ttl @@ -0,0 +1,183 @@ +@prefix foaf: . +@prefix owl: . +@prefix gndo: . +@prefix xsd: . + + + a ; + foaf:page ; + owl:sameAs , , ; + gndo:gndIdentifier "118514768" ; + gndo:oldAuthorityNumber "(DE-588)1022091077", "(DE-588a)118514768", "(DE-588a)141399074", "(DE-588a)139089691", "(DE-588a)141300248", "(DE-588a)136949541", "(DE-588a)134336232", "(DE-588a)12794544X", "(DE-588a)12736630X", "(DE-588a)12722811X", "(DE-588a)127228098", "(DE-588a)127228101" ; + gndo:variantNameForThePerson "Brêcht, Becton", "Brecht, Bert", "Brecht, Bertolʹ", "Brecht, Berthold", "Brecht, Bertholt", "Brecht, Bertold", "Brecht, B.", "Brecht, Eugen Berthold Friedrich", "Brecht, ...", "Brecht-Eisler, ...", "Becht, Bertolt", "Beituo'erte-Bulaixite", "Berchito, B.", "Brechtas, B.", "Brechts, Bertolts", "Brehd, Berd", "Breht, Bertolt", "Brehts, Bertolts", "Breḳhṭ, Bārṭolṭ", "Brekt, Berṭolṭ", "Brekṭ, Berṭōlṭ", "Breḳṭ, Berṭôlṭ", "Breśṭ, Berṭalṭa", "Breṣṭa, Barṭolṭa", "Brišt, Bartūlt", "Brišt, Birtūld", "Brišt, Birtult", "Buchito, Berutorutu", "Bulaixite, Beituo'erte", "Bulaixite, ...", "Burehito, Berutoruto", "Burehito, ...", "B. B.", "Larsen, Berthold", "Mprecht, Mpertolt", "Mprecht, ...", "Pulaihsit'ê, Peit'oĉrht'ê", "Pulaihsit'ê, ...", "Pŭrehit'ŭ, Peŏt'olt'ŭ", "Bŭrehit'ŭ, Beŏt'olt'ŭ", "برشت، برتولد", "브레히트, 베르톨트", "ברכט, ברטולט", "贝·布莱希特", "布莱希特, 贝", "ブレヒト, ベルトルト" ; + gndo:variantNameEntityForThePerson [ + gndo:forename "Becton" ; + gndo:surname "Brêcht" + ], [ + gndo:forename "Bert" ; + gndo:surname "Brecht" + ], [ + gndo:forename "Bertolʹ" ; + gndo:surname "Brecht" + ], [ + gndo:forename "Berthold" ; + gndo:surname "Brecht" + ], [ + gndo:forename "Bertholt" ; + gndo:surname "Brecht" + ], [ + gndo:forename "Bertold" ; + gndo:surname "Brecht" + ], [ + gndo:forename "B." ; + gndo:surname "Brecht" + ], [ + gndo:forename "Eugen Berthold Friedrich" ; + gndo:surname "Brecht" + ], [ + gndo:forename "..." ; + gndo:surname "Brecht" + ], [ + gndo:forename "..." ; + gndo:surname "Brecht-Eisler" + ], [ + gndo:forename "Bertolt" ; + gndo:surname "Becht" + ], [ gndo:personalName "Beituo'erte-Bulaixite" ], [ + gndo:forename "B." ; + gndo:surname "Berchito" + ], [ + gndo:forename "B." ; + gndo:surname "Brechtas" + ], [ + gndo:forename "Bertolts" ; + gndo:surname "Brechts" + ], [ + gndo:forename "Berd" ; + gndo:surname "Brehd" + ], [ + gndo:forename "Bertolt" ; + gndo:surname "Breht" + ], [ + gndo:forename "Bertolts" ; + gndo:surname "Brehts" + ], [ + gndo:forename "Bārṭolṭ" ; + gndo:surname "Breḳhṭ" + ], [ + gndo:forename "Berṭolṭ" ; + gndo:surname "Brekt" + ], [ + gndo:forename "Berṭōlṭ" ; + gndo:surname "Brekṭ" + ], [ + gndo:forename "Berṭôlṭ" ; + gndo:surname "Breḳṭ" + ], [ + gndo:forename "Berṭalṭa" ; + gndo:surname "Breśṭ" + ], [ + gndo:forename "Barṭolṭa" ; + gndo:surname "Breṣṭa" + ], [ + gndo:forename "Bartūlt" ; + gndo:surname "Brišt" + ], [ + gndo:forename "Birtūld" ; + gndo:surname "Brišt" + ], [ + gndo:forename "Birtult" ; + gndo:surname "Brišt" + ], [ + gndo:forename "Berutorutu" ; + gndo:surname "Buchito" + ], [ + gndo:forename "Beituo'erte" ; + gndo:surname "Bulaixite" + ], [ + gndo:forename "..." ; + gndo:surname "Bulaixite" + ], [ + gndo:forename "Berutoruto" ; + gndo:surname "Burehito" + ], [ + gndo:forename "..." ; + gndo:surname "Burehito" + ], [ gndo:personalName "B. B." ], [ + gndo:forename "Berthold" ; + gndo:surname "Larsen" + ], [ + gndo:forename "Mpertolt" ; + gndo:surname "Mprecht" + ], [ + gndo:forename "..." ; + gndo:surname "Mprecht" + ], [ + gndo:forename "Peit'oĉrht'ê" ; + gndo:surname "Pulaihsit'ê" + ], [ + gndo:forename "..." ; + gndo:surname "Pulaihsit'ê" + ], [ + gndo:forename "Peŏt'olt'ŭ" ; + gndo:surname "Pŭrehit'ŭ" + ], [ + gndo:forename "Beŏt'olt'ŭ" ; + gndo:surname "Bŭrehit'ŭ" + ], [ gndo:personalName "برشت، برتولد" ], [ + gndo:forename "베르톨트" ; + gndo:surname "브레히트" + ], [ + gndo:forename "ברטולט" ; + gndo:surname "ברכט" + ], [ gndo:personalName "贝·布莱希特" ], [ + gndo:forename "贝" ; + gndo:surname "布莱希特" + ], [ + gndo:forename "ベルトルト" ; + gndo:surname "ブレヒト" + ] ; + gndo:preferredNameForThePerson "Brecht, Bertolt" ; + gndo:preferredNameEntityForThePerson [ + gndo:forename "Bertolt" ; + gndo:surname "Brecht" + ] ; + gndo:familialRelationship , , , , , , , , , , , , , , ; + gndo:professionOrOccupation , , , , , , ; + gndo:playedInstrument ; + gndo:gndSubjectCategory , , ; + gndo:geographicAreaCode ; + gndo:languageCode ; + gndo:placeOfBirth ; + gndo:placeOfDeath ; + gndo:placeOfExile , ; + gndo:gender ; + gndo:dateOfBirth "1898-02-10"^^xsd:date ; + gndo:dateOfDeath "1956-08-14"^^xsd:date . + + gndo:preferredNameForThePerson "Brecht, Berthold Friedrich" . + gndo:preferredNameForThePerson "Banholzer, Paula" . + gndo:preferredNameForThePerson "Neher, Carola" . + gndo:preferredNameForThePerson "Banholzer, Frank" . + gndo:preferredNameForThePerson "Berlau, Ruth" . + gndo:preferredNameForThePerson "Steffin, Margarete" . + gndo:preferredNameForThePerson "Zoff, Marianne" . + gndo:preferredNameForThePerson "Weigel, Helene" . + gndo:preferredNameForThePerson "Reichel, Käthe" . + gndo:preferredNameForThePerson "Hiob, Hanne" . + gndo:preferredNameForThePerson "Brecht, Stefan" . + gndo:preferredNameForThePerson "Brecht-Schall, Barbara" . + gndo:preferredNameForThePerson "Schall, Ekkehard" . + gndo:preferredNameForThePerson "Brezing, Joseph Friedrich" . + gndo:preferredNameForThePerson "Brezing, Friederike" . + gndo:preferredNameForTheSubjectHeading "Theaterregisseur" . + gndo:preferredNameForTheSubjectHeading "Dramatiker" . + gndo:preferredNameForTheSubjectHeading "Schauspieler" . + gndo:preferredNameForTheSubjectHeading "Lyriker" . + gndo:preferredNameForTheSubjectHeading "Schriftsteller" . + gndo:preferredNameForTheSubjectHeading "Regisseur" . + gndo:preferredNameForTheSubjectHeading "Drehbuchautor" . + gndo:preferredNameForThePlaceOrGeographicName "Augsburg" . + gndo:preferredNameForThePlaceOrGeographicName "Berlin" . + gndo:preferredNameForThePlaceOrGeographicName "Dänemark" . + gndo:preferredNameForThePlaceOrGeographicName "Schweden" . \ No newline at end of file diff --git a/samples/Turtle/rdf-syntax-grammar.ttl b/samples/Turtle/rdf-syntax-grammar.ttl new file mode 100644 index 00000000..edcd4db2 --- /dev/null +++ b/samples/Turtle/rdf-syntax-grammar.ttl @@ -0,0 +1,10 @@ +@prefix rdf: . +@prefix dc: . +@prefix ex: . + + + dc:title "RDF/XML Syntax Specification (Revised)" ; + ex:editor [ + ex:fullname "Dave Beckett"; + ex:homePage + ] . \ No newline at end of file diff --git a/vendor/grammars/turtle.tmbundle b/vendor/grammars/turtle.tmbundle new file mode 160000 index 00000000..0782b476 --- /dev/null +++ b/vendor/grammars/turtle.tmbundle @@ -0,0 +1 @@ +Subproject commit 0782b476573a317917fb9b3bbe7e6a68abefa7a5 From d030f9be9907304fee5f80ced69284c33917c31d Mon Sep 17 00:00:00 2001 From: AOE Takashi Date: Thu, 15 Jan 2015 17:42:47 +0900 Subject: [PATCH 23/31] Add support for FXML files. --- lib/linguist/languages.yml | 1 + samples/XML/FXMLSample.fxml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 samples/XML/FXMLSample.fxml diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index e1b57dc9..13750006 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -3120,6 +3120,7 @@ XML: - .dll.config - .filters - .fsproj + - .fxml - .glade - .grxml - .ivy diff --git a/samples/XML/FXMLSample.fxml b/samples/XML/FXMLSample.fxml new file mode 100644 index 00000000..30b56b04 --- /dev/null +++ b/samples/XML/FXMLSample.fxml @@ -0,0 +1,30 @@ + + + + + + + + + +
+ + + + + + + +
+ + + + + + + +
From 3bc1b97a68910a712e859327375c95e0829c1ef7 Mon Sep 17 00:00:00 2001 From: Pontus Rodling Date: Fri, 16 Jan 2015 09:18:55 +1300 Subject: [PATCH 24/31] Added interpreter "pike" for Pike. --- lib/linguist/languages.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 5a77b721..719ac0de 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -2230,6 +2230,8 @@ Pike: extensions: - .pike - .pmod + interpreters: + - pike ace_mode: text Pod: From f8603705a8e367acf56bfafbf878083f92dbb96a Mon Sep 17 00:00:00 2001 From: Pontus Rodling Date: Fri, 16 Jan 2015 09:56:13 +1300 Subject: [PATCH 25/31] Added shebang sample for Pike. --- samples/Pike/shebang.pike | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 samples/Pike/shebang.pike diff --git a/samples/Pike/shebang.pike b/samples/Pike/shebang.pike new file mode 100644 index 00000000..31bf7e96 --- /dev/null +++ b/samples/Pike/shebang.pike @@ -0,0 +1,6 @@ +#!/usr/bin/env pike + +int main(int argc, array argv) { + return 0; +} + From 8cd17698fefaaf4c354d32cf52a57a39e488f29f Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Sat, 17 Jan 2015 13:34:06 +0100 Subject: [PATCH 26/31] Slightly improve heuristic for C# --- lib/linguist/heuristics.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index 33df8958..42ff2241 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -72,7 +72,7 @@ module Linguist disambiguate "C#", "Smalltalk" do |data| if /![\w\s]+methodsFor: /.match(data) Language["Smalltalk"] - elsif /^\s*namespace\s*[\w\.]+\s*{/.match(data) || /^\s*using\s*[\w\.]+\s*;/.match(data) + elsif /^\s*namespace\s*[\w\.]+\s*{/.match(data) || /^\s*\/\//.match(data) Language["C#"] end end From b319731a2d2b1e3341a17e3f805468bf0c7c9e21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Juli=C3=A1n=20Merelo=20Guerv=C3=B3s?= Date: Sun, 18 Jan 2015 13:16:33 +0100 Subject: [PATCH 27/31] Adds Rexfile That's a Vagrantfile-like file for the Rex provisioning tool. --- lib/linguist/languages.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index d3dcb9e9..af0472c8 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -2212,6 +2212,8 @@ Perl6: - .pm - .pm6 - .t + filenames: + - Rexfile interpreters: - perl6 tm_scope: none From 36120a912270696f4624c20607a96c66fa2a9096 Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Tue, 20 Jan 2015 08:58:11 -0600 Subject: [PATCH 28/31] Revert "Use path for Generated?" --- lib/linguist/blob_helper.rb | 6 +++--- lib/linguist/file_blob.rb | 27 ++++++++++----------------- lib/linguist/lazy_blob.rb | 8 +++----- test/test_blob.rb | 14 ++------------ 4 files changed, 18 insertions(+), 37 deletions(-) diff --git a/lib/linguist/blob_helper.rb b/lib/linguist/blob_helper.rb index 07e1ee52..c368b4d0 100644 --- a/lib/linguist/blob_helper.rb +++ b/lib/linguist/blob_helper.rb @@ -99,7 +99,7 @@ module Linguist elsif name.nil? "attachment" else - "attachment; filename=#{EscapeUtils.escape_url(name)}" + "attachment; filename=#{EscapeUtils.escape_url(File.basename(name))}" end end @@ -233,7 +233,7 @@ module Linguist # # Return true or false def vendored? - path =~ VendoredRegexp ? true : false + name =~ VendoredRegexp ? true : false end # Public: Get each line of data @@ -301,7 +301,7 @@ module Linguist # # Return true or false def generated? - @_generated ||= Generated.generated?(path, lambda { data }) + @_generated ||= Generated.generated?(name, lambda { data }) end # Public: Detects the Language of the blob. diff --git a/lib/linguist/file_blob.rb b/lib/linguist/file_blob.rb index 2ca74c2d..04441935 100644 --- a/lib/linguist/file_blob.rb +++ b/lib/linguist/file_blob.rb @@ -3,7 +3,7 @@ require 'linguist/blob_helper' module Linguist # A FileBlob is a wrapper around a File object to make it quack # like a Grit::Blob. It provides the basic interface: `name`, - # `data`, `path` and `size`. + # `data`, and `size`. class FileBlob include BlobHelper @@ -14,50 +14,43 @@ module Linguist # # Returns a FileBlob. def initialize(path, base_path = nil) - @fullpath = path - @path = base_path ? path.sub("#{base_path}/", '') : path + @path = path + @name = base_path ? path.sub("#{base_path}/", '') : path end # Public: Filename # # Examples # - # FileBlob.new("/path/to/linguist/lib/linguist.rb").path + # FileBlob.new("/path/to/linguist/lib/linguist.rb").name # # => "/path/to/linguist/lib/linguist.rb" # # FileBlob.new("/path/to/linguist/lib/linguist.rb", - # "/path/to/linguist").path + # "/path/to/linguist").name # # => "lib/linguist.rb" # # Returns a String - attr_reader :path + attr_reader :name # Public: Read file permissions # # Returns a String like '100644' def mode - File.stat(@fullpath).mode.to_s(8) - end - - # Public: File name - # - # Returns a String - def name - File.basename(@fullpath) + File.stat(@path).mode.to_s(8) end # Public: Read file contents. # # Returns a String. def data - File.read(@fullpath) + File.read(@path) end # Public: Get byte size # # Returns an Integer. def size - File.size(@fullpath) + File.size(@path) end # Public: Get file extension. @@ -74,7 +67,7 @@ module Linguist # # Returns an Array def extensions - basename, *segments = name.split(".") + basename, *segments = File.basename(name).split(".") segments.map.with_index do |segment, index| "." + segments[index..-1].join(".") diff --git a/lib/linguist/lazy_blob.rb b/lib/linguist/lazy_blob.rb index ab6c4bee..9691bca5 100644 --- a/lib/linguist/lazy_blob.rb +++ b/lib/linguist/lazy_blob.rb @@ -14,15 +14,13 @@ module Linguist attr_reader :repository attr_reader :oid - attr_reader :path + attr_reader :name attr_reader :mode - alias :name :path - - def initialize(repo, oid, path, mode = nil) + def initialize(repo, oid, name, mode = nil) @repository = repo @oid = oid - @path = path + @name = name @mode = mode end diff --git a/test/test_blob.rb b/test/test_blob.rb index 4c4f7978..372ff13f 100644 --- a/test/test_blob.rb +++ b/test/test_blob.rb @@ -251,7 +251,8 @@ class TestBlob < Minitest::Test assert sample_blob("Zephir/filenames/exception.zep.php").generated? assert !sample_blob("Zephir/Router.zep").generated? - assert sample_blob("node_modules/grunt/lib/grunt.js").generated? + + assert Linguist::Generated.generated?("node_modules/grunt/lib/grunt.js", nil) # Godep saved dependencies assert sample_blob("Godeps/Godeps.json").generated? @@ -291,8 +292,6 @@ class TestBlob < Minitest::Test assert sample_blob("deps/http_parser/http_parser.c").vendored? assert sample_blob("deps/v8/src/v8.h").vendored? - assert sample_blob("tools/something/else.c").vendored? - # Chart.js assert sample_blob("some/vendored/path/Chart.js").vendored? assert !sample_blob("some/vendored/path/chart.js").vendored? @@ -303,9 +302,6 @@ class TestBlob < Minitest::Test # Debian packaging assert sample_blob("debian/cron.d").vendored? - # Erlang - assert sample_blob("rebar").vendored? - # Minified JavaScript and CSS assert sample_blob("foo.min.js").vendored? assert sample_blob("foo.min.css").vendored? @@ -314,9 +310,6 @@ class TestBlob < Minitest::Test assert !sample_blob("foomin.css").vendored? assert !sample_blob("foo.min.txt").vendored? - #.osx - assert sample_blob(".osx").vendored? - # Prototype assert !sample_blob("public/javascripts/application.js").vendored? assert sample_blob("public/javascripts/prototype.js").vendored? @@ -324,9 +317,6 @@ class TestBlob < Minitest::Test assert sample_blob("public/javascripts/controls.js").vendored? assert sample_blob("public/javascripts/dragdrop.js").vendored? - # Samples - assert sample_blob("Samples/Ruby/foo.rb").vendored? - # jQuery assert sample_blob("jquery.js").vendored? assert sample_blob("public/javascripts/jquery.js").vendored? From 72b268b25343f5e6c88f77048845d2d51a720ace Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Tue, 20 Jan 2015 09:17:46 -0600 Subject: [PATCH 29/31] Updating grammars --- vendor/grammars/NimLime | 2 +- vendor/grammars/SCSS.tmbundle | 2 +- vendor/grammars/Sublime-Inform | 2 +- vendor/grammars/Sublime-Text-2-OpenEdge-ABL | 2 +- vendor/grammars/carto-atom | 2 +- vendor/grammars/dart-sublime-bundle | 2 +- vendor/grammars/factor | 2 +- vendor/grammars/fsharpbinding | 2 +- vendor/grammars/haxe-sublime-bundle | 2 +- vendor/grammars/language-gfm | 2 +- vendor/grammars/language-javascript | 2 +- vendor/grammars/language-python | 2 +- vendor/grammars/latex.tmbundle | 2 +- vendor/grammars/nesC.tmbundle | 2 +- vendor/grammars/standard-ml.tmbundle | 2 +- vendor/grammars/sublime-rust | 2 +- vendor/grammars/sublimetext-cuda-cpp | 2 +- vendor/grammars/swift.tmbundle | 2 +- vendor/grammars/text.tmbundle | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/vendor/grammars/NimLime b/vendor/grammars/NimLime index a7067c60..3aab3b38 160000 --- a/vendor/grammars/NimLime +++ b/vendor/grammars/NimLime @@ -1 +1 @@ -Subproject commit a7067c605b893585c056d32a20a1b953f100e138 +Subproject commit 3aab3b3841707e2c1ebac7fad758ec2ca0c7d936 diff --git a/vendor/grammars/SCSS.tmbundle b/vendor/grammars/SCSS.tmbundle index 41475020..8ef6283d 160000 --- a/vendor/grammars/SCSS.tmbundle +++ b/vendor/grammars/SCSS.tmbundle @@ -1 +1 @@ -Subproject commit 41475020634fc07b5c03ff0dfaee64c2491fa32b +Subproject commit 8ef6283dcbd59795b818b646f20a7ff1cd23985f diff --git a/vendor/grammars/Sublime-Inform b/vendor/grammars/Sublime-Inform index c52a11e5..8db129b8 160000 --- a/vendor/grammars/Sublime-Inform +++ b/vendor/grammars/Sublime-Inform @@ -1 +1 @@ -Subproject commit c52a11e50697897469c9ad7c7a59dfdb683db654 +Subproject commit 8db129b8389044a6660ca232566651c8fe3ab646 diff --git a/vendor/grammars/Sublime-Text-2-OpenEdge-ABL b/vendor/grammars/Sublime-Text-2-OpenEdge-ABL index 7b02e1e2..6e8231cc 160000 --- a/vendor/grammars/Sublime-Text-2-OpenEdge-ABL +++ b/vendor/grammars/Sublime-Text-2-OpenEdge-ABL @@ -1 +1 @@ -Subproject commit 7b02e1e2444febb7c6b2179d52de0d2a7cdf5d58 +Subproject commit 6e8231cca124750b413ee50e8a4ee20e36636a03 diff --git a/vendor/grammars/carto-atom b/vendor/grammars/carto-atom index 8086625a..c00fb6c4 160000 --- a/vendor/grammars/carto-atom +++ b/vendor/grammars/carto-atom @@ -1 +1 @@ -Subproject commit 8086625aa5deac4ccd7374644b89e715deec2f7f +Subproject commit c00fb6c461e17de53e9efaf5b495e5b7d877b9d6 diff --git a/vendor/grammars/dart-sublime-bundle b/vendor/grammars/dart-sublime-bundle index d14f6469..3b97e169 160000 --- a/vendor/grammars/dart-sublime-bundle +++ b/vendor/grammars/dart-sublime-bundle @@ -1 +1 @@ -Subproject commit d14f64690cbde6d0bece2670ab385daf89533aea +Subproject commit 3b97e1691ed6aaae24fb8396478c697748fae51a diff --git a/vendor/grammars/factor b/vendor/grammars/factor index 2453a785..208f0141 160000 --- a/vendor/grammars/factor +++ b/vendor/grammars/factor @@ -1 +1 @@ -Subproject commit 2453a785f73429786583684cf729625c7cf7b04b +Subproject commit 208f01416deb340dbac19013b23d398fe4c8d71b diff --git a/vendor/grammars/fsharpbinding b/vendor/grammars/fsharpbinding index 99d2e9a5..9ea14cbe 160000 --- a/vendor/grammars/fsharpbinding +++ b/vendor/grammars/fsharpbinding @@ -1 +1 @@ -Subproject commit 99d2e9a53924ae5ba850985f3df1dc8c11cb6731 +Subproject commit 9ea14cbe3cdcb55215d11863fc4e21fdfa962211 diff --git a/vendor/grammars/haxe-sublime-bundle b/vendor/grammars/haxe-sublime-bundle index e2613bb1..6359431d 160000 --- a/vendor/grammars/haxe-sublime-bundle +++ b/vendor/grammars/haxe-sublime-bundle @@ -1 +1 @@ -Subproject commit e2613bb12598d4ae2de5ba57af890ce910195fce +Subproject commit 6359431d8837ea90f245b29def9e2827ff3f040b diff --git a/vendor/grammars/language-gfm b/vendor/grammars/language-gfm index 6af44a08..18400b22 160000 --- a/vendor/grammars/language-gfm +++ b/vendor/grammars/language-gfm @@ -1 +1 @@ -Subproject commit 6af44a08718668035f45270898389ae4fc8eeb8b +Subproject commit 18400b22cd7968afee982b4e0aa57ef7813ce991 diff --git a/vendor/grammars/language-javascript b/vendor/grammars/language-javascript index 51575193..b47a7fe0 160000 --- a/vendor/grammars/language-javascript +++ b/vendor/grammars/language-javascript @@ -1 +1 @@ -Subproject commit 515751937df1d397b495e4a92fec5a0933994cdb +Subproject commit b47a7fe0cbed2d2553cdb7c6d32e812f9881c21f diff --git a/vendor/grammars/language-python b/vendor/grammars/language-python index 46072e32..0141d449 160000 --- a/vendor/grammars/language-python +++ b/vendor/grammars/language-python @@ -1 +1 @@ -Subproject commit 46072e32e3060eb8e2fea98a106a86db89acc842 +Subproject commit 0141d44946d55ae06ce4dba90b1b0e08db1e437e diff --git a/vendor/grammars/latex.tmbundle b/vendor/grammars/latex.tmbundle index 52b2251a..e413297f 160000 --- a/vendor/grammars/latex.tmbundle +++ b/vendor/grammars/latex.tmbundle @@ -1 +1 @@ -Subproject commit 52b2251aab30577f4b3b3cc8997fb3c7d0e798ce +Subproject commit e413297f3af499f2c87c5fb92c6d3199f25fa586 diff --git a/vendor/grammars/nesC.tmbundle b/vendor/grammars/nesC.tmbundle index 5958c490..d0d322ce 160000 --- a/vendor/grammars/nesC.tmbundle +++ b/vendor/grammars/nesC.tmbundle @@ -1 +1 @@ -Subproject commit 5958c490262e4a5a7803d97c9ec770bd40307153 +Subproject commit d0d322ceafe3c4d8affc0e8b767fb6ad65c52704 diff --git a/vendor/grammars/standard-ml.tmbundle b/vendor/grammars/standard-ml.tmbundle index af5395b6..791c8b20 160000 --- a/vendor/grammars/standard-ml.tmbundle +++ b/vendor/grammars/standard-ml.tmbundle @@ -1 +1 @@ -Subproject commit af5395b606273b53e7dd3550270cff7f886d3cc3 +Subproject commit 791c8b2054b4c12edcee29d73945c0db53e447e9 diff --git a/vendor/grammars/sublime-rust b/vendor/grammars/sublime-rust index 9609ab44..40df3591 160000 --- a/vendor/grammars/sublime-rust +++ b/vendor/grammars/sublime-rust @@ -1 +1 @@ -Subproject commit 9609ab4418ed6667e06edea83d7fa157827a2923 +Subproject commit 40df35916158b680eb3d9acb9080a03f7799144c diff --git a/vendor/grammars/sublimetext-cuda-cpp b/vendor/grammars/sublimetext-cuda-cpp index 3ed68f99..e51269fc 160000 --- a/vendor/grammars/sublimetext-cuda-cpp +++ b/vendor/grammars/sublimetext-cuda-cpp @@ -1 +1 @@ -Subproject commit 3ed68f996137ad684d822463bcda1bfd1de00232 +Subproject commit e51269fc22602d3f7aaac0266fc189c4ed4a3901 diff --git a/vendor/grammars/swift.tmbundle b/vendor/grammars/swift.tmbundle index 3c7eac54..0cd27c70 160000 --- a/vendor/grammars/swift.tmbundle +++ b/vendor/grammars/swift.tmbundle @@ -1 +1 @@ -Subproject commit 3c7eac54457aa8f953fa5263cb34ec4dc9555217 +Subproject commit 0cd27c708953230e10571ccb88a4b24eedf762bb diff --git a/vendor/grammars/text.tmbundle b/vendor/grammars/text.tmbundle index c536e814..961652ad 160000 --- a/vendor/grammars/text.tmbundle +++ b/vendor/grammars/text.tmbundle @@ -1 +1 @@ -Subproject commit c536e81409d1fa1fc24f388f70b0513c3a8bfc59 +Subproject commit 961652ad957678e75b533406de1be5bd7f489063 From 3ce527b0b92e2813e2c04db3f0574ba711db12c2 Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Tue, 20 Jan 2015 09:29:26 -0600 Subject: [PATCH 30/31] Updating version.rb --- lib/linguist/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linguist/version.rb b/lib/linguist/version.rb index 3f330f79..73b6c63a 100644 --- a/lib/linguist/version.rb +++ b/lib/linguist/version.rb @@ -1,3 +1,3 @@ module Linguist - VERSION = "4.2.6" + VERSION = "4.2.7" end From 97d48a204ab68e44e66591e3dd771cbc319675ff Mon Sep 17 00:00:00 2001 From: Chow Loong Jin Date: Fri, 23 Jan 2015 14:14:15 +0800 Subject: [PATCH 31/31] Specify ace_mode for OpenSCAD --- lib/linguist/languages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index af0472c8..5f2d806b 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -2055,7 +2055,7 @@ OpenSCAD: extensions: - .scad tm_scope: none - ace_mode: text + ace_mode: scad Org: type: prose