skim 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.md +4 -0
- data/lib/skim/version.rb +1 -1
- data/lib/temple/coffee_script/generators.rb +2 -5
- data/test/test_code_blocks.rb +9 -0
- data/vendor/assets/javascripts/skim.js.coffee +4 -2
- metadata +2 -2
data/History.md
CHANGED
data/lib/skim/version.rb
CHANGED
@@ -7,10 +7,7 @@ module Temple
|
|
7
7
|
|
8
8
|
def call(exp)
|
9
9
|
@indent = options[:indent]
|
10
|
-
compile [:multi,
|
11
|
-
[:code, "#{buffer} = []"],
|
12
|
-
exp,
|
13
|
-
[:code, "#{buffer}.join('')"]]
|
10
|
+
compile [:multi, [:code, "#{buffer} = ''"], exp, [:code, "#{buffer}"]]
|
14
11
|
end
|
15
12
|
|
16
13
|
def on_multi(*exp)
|
@@ -41,7 +38,7 @@ module Temple
|
|
41
38
|
end
|
42
39
|
|
43
40
|
def concat(str)
|
44
|
-
indent
|
41
|
+
indent "#{buffer} += #{str}"
|
45
42
|
end
|
46
43
|
|
47
44
|
def indent(str, indent = @indent)
|
data/test/test_code_blocks.rb
CHANGED
@@ -66,6 +66,15 @@ p
|
|
66
66
|
assert_html '<p>Hey!Hey!Hey!</p>', source
|
67
67
|
end
|
68
68
|
|
69
|
+
def test_render_with_control_code_for_in_loop_without_parent
|
70
|
+
source = %q{
|
71
|
+
- for i in [0..2]
|
72
|
+
p Hey!
|
73
|
+
}
|
74
|
+
|
75
|
+
assert_html '<p>Hey!</p><p>Hey!</p><p>Hey!</p>', source
|
76
|
+
end
|
77
|
+
|
69
78
|
def test_render_with_control_code_for_own_of_loop
|
70
79
|
source = %q{
|
71
80
|
p
|
@@ -35,8 +35,10 @@ this.Skim =
|
|
35
35
|
|
36
36
|
context.escape ||= @escape || (string) ->
|
37
37
|
return '' unless string?
|
38
|
-
|
39
|
-
|
38
|
+
if string.skimSafe or not /[&<>\"]/.test(string)
|
39
|
+
return string
|
40
|
+
|
41
|
+
@safe ('' + string)
|
40
42
|
.replace(/&/g, '&')
|
41
43
|
.replace(/</g, '<')
|
42
44
|
.replace(/>/g, '>')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: slim
|