diff --git a/.gitignore b/.gitignore index d87d4be..b36aa3d 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ spec/reports test/tmp test/version_tmp tmp + +.DS_Store diff --git a/lib/rocco/comment_styles.rb b/lib/rocco/comment_styles.rb index 8aac0bd..d0b8cc6 100644 --- a/lib/rocco/comment_styles.rb +++ b/lib/rocco/comment_styles.rb @@ -46,6 +46,11 @@ module CommentStyles }, "scala" => C_STYLE_COMMENTS, "scheme" => { :single => ";;", :multi => nil, :heredoc => nil }, + "sql" => { + :single => nil, + :multi => { :start => '/*', :middle => nil, :end => '*/' }, + :heredoc => nil + }, "xml" => { :single => nil, :multi => { :start => '' }, diff --git a/lib/rocco/layout.mustache b/lib/rocco/layout.mustache index 5d0297e..91484e9 100644 --- a/lib/rocco/layout.mustache +++ b/lib/rocco/layout.mustache @@ -23,8 +23,7 @@ - - + diff --git a/test/test_language_detection.rb b/test/test_language_detection.rb index 5e2c1eb..cdc03f4 100644 --- a/test/test_language_detection.rb +++ b/test/test_language_detection.rb @@ -8,6 +8,14 @@ def test_basic_detection assert_equal "python", r.options[:language], "`@options[:language]` should be set to the correct language" end end + + def test_sql_detection + r = Rocco.new( 'filename.sql' ) { "" } + if r.pygmentize? + assert_equal "sql", r.detect_language(), "`detect_language()` should return the correct language" + assert_equal "sql", r.options[:language], "`@options[:language]` should be set to the correct language" + end + end def test_fallback_default r = Rocco.new( 'filename.an_extension_with_no_meaning_whatsoever' ) { "" }

{{ title }}

{{ title }}