zrb 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zrb.rb +6 -3
- data/lib/zrb/version.rb +1 -1
- data/test/test_zrb.rb +14 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b133af75330b0d640a7e49c8e178c49ddffa73c4
|
4
|
+
data.tar.gz: c0bbf52ba08cedab9e6d977c919770dcb6211ec4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '080d8f33a816df69152715243a437f073d3e4bc5943b8e45b6096936a52f6bea69559018b32a0dc39db3ce4eee45065b0661f5697793e682e06fca4e4a50f820'
|
7
|
+
data.tar.gz: 4f89b829e297626bae289890f79ea312e33e827bcfaa28d880a9feb864de01057392f29a504854f8a3fbd51663bc462549dbc43e6dbb48551f9c717e04646b4f
|
data/lib/zrb.rb
CHANGED
@@ -170,9 +170,12 @@ module ZRB
|
|
170
170
|
|
171
171
|
def capture(blk, *args)
|
172
172
|
start = self.size
|
173
|
-
|
174
|
-
|
175
|
-
|
173
|
+
begin
|
174
|
+
blk.call(*args)
|
175
|
+
ensure
|
176
|
+
result = self.slice!(start..-1)
|
177
|
+
end
|
178
|
+
result
|
176
179
|
end
|
177
180
|
end
|
178
181
|
|
data/lib/zrb/version.rb
CHANGED
data/test/test_zrb.rb
CHANGED
@@ -115,6 +115,20 @@ world
|
|
115
115
|
assert_equal "<form>Hello /awesome!</form>", t.render(self).strip
|
116
116
|
end
|
117
117
|
|
118
|
+
def test_block_expr_error
|
119
|
+
@form_buffer = @buffer = Buffer.new
|
120
|
+
t = Template.new { <<-'EOF' }
|
121
|
+
<?= form_for do |path| ?>
|
122
|
+
Hello #{path}!
|
123
|
+
<? raise ?>
|
124
|
+
<? end ?>
|
125
|
+
EOF
|
126
|
+
|
127
|
+
assert_raises do
|
128
|
+
t.render(self)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
118
132
|
def test_html
|
119
133
|
@buffer = HTMLBuffer.new
|
120
134
|
t = Template.new { 'Hello #{"&"}' }
|