haml-edge 2.1.3 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/EDGE_GEM_VERSION +1 -1
- data/VERSION +1 -1
- data/lib/sass/tree/attr_node.rb +1 -0
- data/lib/sass/tree/comment_node.rb +12 -1
- data/lib/sass/tree/directive_node.rb +1 -0
- data/lib/sass/tree/node.rb +3 -1
- data/lib/sass/tree/rule_node.rb +1 -0
- data/test/sass/engine_test.rb +44 -0
- metadata +2 -2
data/EDGE_GEM_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.1.
|
1
|
+
2.1.4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.1.
|
1
|
+
2.1.4
|
data/lib/sass/tree/attr_node.rb
CHANGED
@@ -20,11 +20,22 @@ module Sass::Tree
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def to_s(tabs = 0, parent_name = nil)
|
23
|
-
return if
|
23
|
+
return if invisible?
|
24
24
|
|
25
25
|
spaces = ' ' * (tabs - 1)
|
26
26
|
spaces + "/* " + ([value] + lines.map {|l| l.text}).
|
27
27
|
map{|l| l.sub(%r{ ?\*/ *$},'')}.join(@style == :compact ? ' ' : "\n#{spaces} * ") + " */"
|
28
28
|
end
|
29
|
+
|
30
|
+
def invisible?
|
31
|
+
@style == :compressed || silent?
|
32
|
+
end
|
33
|
+
|
34
|
+
protected
|
35
|
+
|
36
|
+
def _perform(environment)
|
37
|
+
return [] if silent?
|
38
|
+
self
|
39
|
+
end
|
29
40
|
end
|
30
41
|
end
|
data/lib/sass/tree/node.rb
CHANGED
@@ -27,14 +27,16 @@ module Sass
|
|
27
27
|
self.class == other.class && other.children == children
|
28
28
|
end
|
29
29
|
|
30
|
+
def invisible?; false; end
|
31
|
+
|
30
32
|
def to_s
|
31
33
|
result = String.new
|
32
34
|
children.each do |child|
|
33
35
|
if child.is_a? AttrNode
|
34
36
|
raise Sass::SyntaxError.new('Attributes aren\'t allowed at the root of a document.', child.line)
|
35
37
|
else
|
38
|
+
next if child.invisible?
|
36
39
|
child_str = child.to_s(1)
|
37
|
-
next unless child_str && child_str.length > 0
|
38
40
|
result << child_str + (@style == :compressed ? '' : "\n")
|
39
41
|
end
|
40
42
|
end
|
data/lib/sass/tree/rule_node.rb
CHANGED
data/test/sass/engine_test.rb
CHANGED
@@ -681,6 +681,50 @@ a
|
|
681
681
|
SASS
|
682
682
|
end
|
683
683
|
|
684
|
+
# Regression tests
|
685
|
+
|
686
|
+
def test_comment_beneath_attr
|
687
|
+
assert_equal(<<RESULT, render(<<SOURCE))
|
688
|
+
.box {
|
689
|
+
border-style: solid; }
|
690
|
+
RESULT
|
691
|
+
.box
|
692
|
+
:border
|
693
|
+
//:color black
|
694
|
+
:style solid
|
695
|
+
SOURCE
|
696
|
+
|
697
|
+
assert_equal(<<RESULT, render(<<SOURCE))
|
698
|
+
.box {
|
699
|
+
/* :color black */
|
700
|
+
border-style: solid; }
|
701
|
+
RESULT
|
702
|
+
.box
|
703
|
+
:border
|
704
|
+
/*:color black
|
705
|
+
:style solid
|
706
|
+
SOURCE
|
707
|
+
|
708
|
+
assert_equal(<<RESULT, render(<<SOURCE, :style => :compressed))
|
709
|
+
.box{border-style:solid}
|
710
|
+
RESULT
|
711
|
+
.box
|
712
|
+
:border
|
713
|
+
/*:color black
|
714
|
+
:style solid
|
715
|
+
SOURCE
|
716
|
+
end
|
717
|
+
|
718
|
+
def test_compressed_comment_beneath_directive
|
719
|
+
assert_equal(<<RESULT, render(<<SOURCE, :style => :compressed))
|
720
|
+
@foo{a:b}
|
721
|
+
RESULT
|
722
|
+
@foo
|
723
|
+
a: b
|
724
|
+
/*b: c
|
725
|
+
SOURCE
|
726
|
+
end
|
727
|
+
|
684
728
|
private
|
685
729
|
|
686
730
|
def render(sass, options = {})
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml-edge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Weizenbaum
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-05-
|
13
|
+
date: 2009-05-10 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|