Skip to content

Commit

Permalink
Merge pull request #67 from beckje01/master
Browse files Browse the repository at this point in the history
GSP Guess fix for Ruby 1.8.7
  • Loading branch information
josh committed Aug 29, 2011
2 parents 007cd53 + 5c93120 commit 7670ed6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/linguist/blob_helper.rb
Expand Up @@ -438,7 +438,7 @@ def guess_r_language
#
# Returns a Language.
def guess_gsp_language
if lines.grep(/<%|<%@|${|<%|<g:|<meta name="layout"|<r:/).any?
if lines.grep(/<%|<%@|\${|<%|<g:|<meta name="layout"|<r:/).any?
Language['Groovy Server Pages']
else
Language['Gosu']
Expand Down
9 changes: 9 additions & 0 deletions test/fixtures/hello-var.gsp
@@ -0,0 +1,9 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Testing with SiteMesh and ${example}</title>

</head>
<body>
</body>
</html>
2 changes: 1 addition & 1 deletion test/test_blob.rb
Expand Up @@ -337,7 +337,7 @@ def test_language
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

assert_equal Language['Groovy Server Pages'], blob("hello-var.gsp").language
end

def test_lexer
Expand Down

0 comments on commit 7670ed6

Please sign in to comment.