tiny 0.2.5 → 0.2.6
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/lib/tiny.rb +2 -1
- data/lib/tiny/tag.rb +1 -1
- data/lib/tiny/version.rb +1 -1
- data/spec/helpers_spec.rb +5 -0
- data/spec/widget_spec.rb +1 -0
- metadata +2 -2
data/lib/tiny.rb
CHANGED
@@ -409,13 +409,14 @@ module Tiny
|
|
409
409
|
# @see Widget.
|
410
410
|
#
|
411
411
|
def render &block
|
412
|
-
with_buffer do
|
412
|
+
output = with_buffer do
|
413
413
|
next markup unless block_given?
|
414
414
|
markup do |args|
|
415
415
|
context = eval('self', block.binding)
|
416
416
|
append! context.instance_eval{ with_buffer(*args, &block) }
|
417
417
|
end
|
418
418
|
end
|
419
|
+
SafeString.new output
|
419
420
|
end
|
420
421
|
alias to_html render
|
421
422
|
end
|
data/lib/tiny/tag.rb
CHANGED
data/lib/tiny/version.rb
CHANGED
data/spec/helpers_spec.rb
CHANGED
@@ -30,6 +30,11 @@ describe 'markup helpers' do
|
|
30
30
|
output.should == "<li data-something></li>"
|
31
31
|
end
|
32
32
|
|
33
|
+
it 'should not emit value if value is false' do
|
34
|
+
output = tag(:li, 'data-something' => false)
|
35
|
+
output.should == "<li></li>"
|
36
|
+
end
|
37
|
+
|
33
38
|
it 'should not allow passing text without #text' do
|
34
39
|
output = tag(:li) { 'Hello' }
|
35
40
|
output.should == '<li></li>'
|
data/spec/widget_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tiny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
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: 2012-
|
12
|
+
date: 2012-09-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: tilt
|