diff --git a/lib/linguist/blob_helper.rb b/lib/linguist/blob_helper.rb index 089a9381..b982c2e1 100644 --- a/lib/linguist/blob_helper.rb +++ b/lib/linguist/blob_helper.rb @@ -432,6 +432,19 @@ module Linguist Language['R'] end end + + + # Internal: Guess language of .gsp files. + # + # Returns a Language. + def guess_gsp_language + if lines.grep(/<%|<%@|${|<%| + + + Testing with SiteMesh and Resources + + + + + + diff --git a/test/fixtures/hello-pagedirective.gsp b/test/fixtures/hello-pagedirective.gsp new file mode 100644 index 00000000..d632536d --- /dev/null +++ b/test/fixtures/hello-pagedirective.gsp @@ -0,0 +1,16 @@ +<%@ page contentType="text/html;charset=UTF-8" %> + + + + Using page directive tag + + +
+ Download +
+
+ Print +
+ + + diff --git a/test/fixtures/hello-resources.gsp b/test/fixtures/hello-resources.gsp new file mode 100644 index 00000000..15c0edd2 --- /dev/null +++ b/test/fixtures/hello-resources.gsp @@ -0,0 +1,9 @@ + + + + Testing with Resources + + + + + diff --git a/test/test_blob.rb b/test/test_blob.rb index 174a9495..1218eda8 100644 --- a/test/test_blob.rb +++ b/test/test_blob.rb @@ -332,6 +332,12 @@ class TestBlob < Test::Unit::TestCase assert_equal Language['Gosu'], blob("hello.gsp").language assert_equal Language['Gosu'], blob("Hello.gst").language assert_equal Language['Gosu'], blob("hello.vark").language + + #Groovy Server Pages + assert_equal Language['Groovy Server Pages'], blob("bar.gsp").language + assert_equal Language['Groovy Server Pages'], blob("hello-resources.gsp").language + assert_equal Language['Groovy Server Pages'], blob("hello-pagedirective.gsp").language + end def test_lexer