diff --git a/lib/jekyll/converters/sass.rb b/lib/jekyll/converters/sass.rb index a5f34518..aacf2a86 100644 --- a/lib/jekyll/converters/sass.rb +++ b/lib/jekyll/converters/sass.rb @@ -12,7 +12,7 @@ module Jekyll end def convert(content) - Sass.compile(content, :syntax => :sass) + Object::Sass.compile(content, :syntax => :sass) end end end diff --git a/lib/jekyll/converters/scss.rb b/lib/jekyll/converters/scss.rb index de7c097f..27a4e85f 100644 --- a/lib/jekyll/converters/scss.rb +++ b/lib/jekyll/converters/scss.rb @@ -1,10 +1,10 @@ module Jekyll - class Sass < Converter + class Scss < Converter safe true priority :low def matches(ext) - ext =~ /^\.sass$/i + ext =~ /^\.scss$/i end def output_ext(ext) @@ -12,7 +12,7 @@ module Jekyll end def convert(content) - Sass.compile(content, :syntax => :scss) + ::Sass.compile(content, :syntax => :scss) end end end diff --git a/test/test_sass.rb b/test/test_sass.rb new file mode 100644 index 00000000..0fa44d21 --- /dev/null +++ b/test/test_sass.rb @@ -0,0 +1,20 @@ +require 'helper' + +class TestSass < Test::Unit::TestCase + context "converting sass" do + setup do + @content = <<-SASS +$font-stack: Helvetica, sans-serif +body + font-family: $font-stack + font-color: fuschia +SASS + @output = <<-CSS +body {\n font-family: Helvetica, sans-serif;\n font-color: fuschia; } +CSS + end + should "produce CSS" do + assert_equal @output, Jekyll::Sass.new.convert(@content) + end + end +end diff --git a/test/test_scss.rb b/test/test_scss.rb new file mode 100644 index 00000000..dbc40d83 --- /dev/null +++ b/test/test_scss.rb @@ -0,0 +1,21 @@ +require 'helper' + +class TestSass < Test::Unit::TestCase + context "converting SCSS" do + setup do + @content = <<-SCSS +$font-stack: Helvetica, sans-serif; +body { + font-family: $font-stack; + font-color: fuschia; +} +SCSS + @output = <<-CSS +body {\n font-family: Helvetica, sans-serif;\n font-color: fuschia; } +CSS + end + should "produce CSS" do + assert_equal @output, Jekyll::Scss.new.convert(@content) + end + end +end