haml-edge 3.1.25 → 3.1.26
Sign up to get free protection for your applications and to get access to all the features.
- data/EDGE_GEM_VERSION +1 -1
- data/VERSION +1 -1
- data/lib/haml/util.rb +7 -3
- data/lib/sass/engine.rb +1 -2
- data/lib/sass/tree/rule_node.rb +5 -2
- data/test/haml/util_test.rb +3 -0
- data/test/sass/engine_test.rb +12 -0
- data/test/sass/scss/scss_test.rb +10 -0
- metadata +2 -2
data/EDGE_GEM_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1.
|
1
|
+
3.1.26
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1.
|
1
|
+
3.1.26
|
data/lib/haml/util.rb
CHANGED
@@ -128,9 +128,13 @@ module Haml
|
|
128
128
|
# @param enum [Enumerable]
|
129
129
|
# @return [Array] The enumerable with strings merged
|
130
130
|
def merge_adjacent_strings(enum)
|
131
|
-
|
132
|
-
if e.is_a?(String)
|
133
|
-
a.last
|
131
|
+
enum.inject([]) do |a, e|
|
132
|
+
if e.is_a?(String)
|
133
|
+
if a.last.is_a?(String)
|
134
|
+
a.last << e
|
135
|
+
else
|
136
|
+
a << e.dup
|
137
|
+
end
|
134
138
|
else
|
135
139
|
a << e
|
136
140
|
end
|
data/lib/sass/engine.rb
CHANGED
@@ -637,8 +637,7 @@ WARNING
|
|
637
637
|
end
|
638
638
|
|
639
639
|
return silent ? "//" : "/* */" if content.empty?
|
640
|
-
content.
|
641
|
-
content.map! {|l| (l.empty? ? "" : " ") + l}
|
640
|
+
content.map! {|l| l.gsub!(/^\*( ?)/, '\1') || (l.empty? ? "" : " ") + l}
|
642
641
|
content.first.gsub!(/^ /, '') unless removed_first
|
643
642
|
content.last.gsub!(%r{ ?\*/ *$}, '')
|
644
643
|
if silent
|
data/lib/sass/tree/rule_node.rb
CHANGED
@@ -53,8 +53,11 @@ module Sass::Tree
|
|
53
53
|
# @param rule [Array<String, Sass::Script::Node>]
|
54
54
|
# The CSS rule. See \{#rule}
|
55
55
|
def initialize(rule)
|
56
|
-
|
57
|
-
|
56
|
+
#p rule
|
57
|
+
merged = Haml::Util.merge_adjacent_strings(rule)
|
58
|
+
#p merged
|
59
|
+
@rule = Haml::Util.strip_string_array(merged)
|
60
|
+
#p @rule
|
58
61
|
@tabs = 0
|
59
62
|
super()
|
60
63
|
end
|
data/test/haml/util_test.rb
CHANGED
@@ -64,6 +64,9 @@ class UtilTest < Test::Unit::TestCase
|
|
64
64
|
def test_merge_adjacent_strings
|
65
65
|
assert_equal(["foo bar baz", :bang, "biz bop", 12],
|
66
66
|
merge_adjacent_strings(["foo ", "bar ", "baz", :bang, "biz", " bop", 12]))
|
67
|
+
str = "foo"
|
68
|
+
assert_equal(["foo foo foo", :bang, "foo foo", 12],
|
69
|
+
merge_adjacent_strings([str, " ", str, " ", str, :bang, str, " ", str, 12]))
|
67
70
|
end
|
68
71
|
|
69
72
|
def test_intersperse
|
data/test/sass/engine_test.rb
CHANGED
@@ -1423,6 +1423,18 @@ CSS
|
|
1423
1423
|
SASS
|
1424
1424
|
end
|
1425
1425
|
|
1426
|
+
def test_loud_comments_with_no_space_after_starred_lines
|
1427
|
+
assert_equal(<<CSS, render(<<SASS))
|
1428
|
+
/*bip bop
|
1429
|
+
*beep boop
|
1430
|
+
*bap blimp */
|
1431
|
+
CSS
|
1432
|
+
/*bip bop
|
1433
|
+
*beep boop
|
1434
|
+
*bap blimp
|
1435
|
+
SASS
|
1436
|
+
end
|
1437
|
+
|
1426
1438
|
def test_comment_indentation_at_beginning_of_doc
|
1427
1439
|
assert_equal <<CSS, render(<<SASS)
|
1428
1440
|
/* foo
|
data/test/sass/scss/scss_test.rb
CHANGED
@@ -979,6 +979,16 @@ foo {
|
|
979
979
|
SCSS
|
980
980
|
end
|
981
981
|
|
982
|
+
def test_interpolation_with_bracket_on_next_line
|
983
|
+
assert_equal <<CSS, render(<<SCSS)
|
984
|
+
a.foo b {
|
985
|
+
color: red; }
|
986
|
+
CSS
|
987
|
+
a.\#{"foo"} b
|
988
|
+
{color: red}
|
989
|
+
SCSS
|
990
|
+
end
|
991
|
+
|
982
992
|
def test_extra_comma_in_mixin_arglist_error
|
983
993
|
assert_raise(Sass::SyntaxError, <<MESSAGE) {render <<SCSS}
|
984
994
|
Invalid CSS after "@include foo(bar, ": expected mixin argument, was ")"
|
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: 3.1.
|
4
|
+
version: 3.1.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Weizenbaum
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2010-
|
14
|
+
date: 2010-06-01 00:00:00 -04:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|