slim 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +2 -0
- data/lib/slim/interpolation.rb +1 -1
- data/lib/slim/sections.rb +12 -0
- data/lib/slim/version.rb +1 -1
- data/test/helper.rb +4 -0
- data/test/slim/test_wrapper.rb +7 -0
- metadata +2 -2
data/CHANGES
CHANGED
data/lib/slim/interpolation.rb
CHANGED
@@ -22,7 +22,7 @@ module Slim
|
|
22
22
|
# Interpolation
|
23
23
|
string, code = parse_expression($')
|
24
24
|
escape = code !~ /^\{.*\}$/
|
25
|
-
block << [:
|
25
|
+
block << [:slim, :output, escape, escape ? code : code[1..-2], [:multi]]
|
26
26
|
when /^([^#]+|#)/
|
27
27
|
# Static text
|
28
28
|
block << [:static, $&]
|
data/lib/slim/sections.rb
CHANGED
@@ -41,6 +41,18 @@ module Slim
|
|
41
41
|
[:slim, :output, escape, access(name), content]
|
42
42
|
end
|
43
43
|
|
44
|
+
def on_slim_attr(name, escape, value)
|
45
|
+
[:slim, :attr, name, escape, access(value)]
|
46
|
+
end
|
47
|
+
|
48
|
+
def on_dynamic(code)
|
49
|
+
raise 'Embedded code is forbidden in sections mode'
|
50
|
+
end
|
51
|
+
|
52
|
+
def on_code(code)
|
53
|
+
raise 'Embedded code is forbidden in sections mode'
|
54
|
+
end
|
55
|
+
|
44
56
|
protected
|
45
57
|
|
46
58
|
def on_slim_inverted_section(name, content)
|
data/lib/slim/version.rb
CHANGED
data/test/helper.rb
CHANGED
data/test/slim/test_wrapper.rb
CHANGED
@@ -29,4 +29,11 @@ ul
|
|
29
29
|
assert_html '<ul><li>Andy</li><li>Atlanta</li><li>Fred</li><li>Melbourne</li><li>Daniel</li><li>Karlsruhe</li></ul>', source, :sections => true
|
30
30
|
end
|
31
31
|
|
32
|
+
def test_method
|
33
|
+
source = %q{
|
34
|
+
a href=output_number Link
|
35
|
+
}
|
36
|
+
assert_html '<a href="1337">Link</a>', source, :sections => true
|
37
|
+
end
|
38
|
+
|
32
39
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: slim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.9.
|
5
|
+
version: 0.9.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Andrew Stone
|
@@ -12,7 +12,7 @@ autorequire:
|
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
14
|
|
15
|
-
date: 2011-05-
|
15
|
+
date: 2011-05-21 00:00:00 -04:00
|
16
16
|
default_executable:
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|