Fixes for Sass/SCSS converters.
This commit is contained in:
parent
824a84ef2a
commit
4da7223831
|
@ -12,7 +12,7 @@ module Jekyll
|
|||
end
|
||||
|
||||
def convert(content)
|
||||
Sass.compile(content, :syntax => :sass)
|
||||
Object::Sass.compile(content, :syntax => :sass)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue