deas-erubis 0.2.0 → 0.3.0
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/deas-erubis/template_helpers.rb +4 -4
- data/lib/deas-erubis/version.rb +1 -1
- data/test/support/factory.rb +2 -0
- data/test/support/templates/_partial_no_locals.erb +1 -0
- data/test/support/templates/with_capture_partial.erb +1 -0
- data/test/support/templates/with_partial.erb +1 -0
- data/test/unit/source_tests.rb +1 -1
- metadata +5 -3
@@ -11,12 +11,12 @@ module Deas::Erubis
|
|
11
11
|
|
12
12
|
module Methods
|
13
13
|
|
14
|
-
def partial(
|
15
|
-
@deas_source.partial(
|
14
|
+
def partial(n, l = nil)
|
15
|
+
@deas_source.partial(n, l || {})
|
16
16
|
end
|
17
17
|
|
18
|
-
def capture_partial(
|
19
|
-
_erb_buffer @deas_source.partial(
|
18
|
+
def capture_partial(n, l = nil, &c)
|
19
|
+
_erb_buffer @deas_source.partial(n, l || {}, &Proc.new{ _erb_capture(&c) })
|
20
20
|
end
|
21
21
|
|
22
22
|
private
|
data/lib/deas-erubis/version.rb
CHANGED
data/test/support/factory.rb
CHANGED
@@ -58,6 +58,7 @@ module Factory
|
|
58
58
|
"<div>\n"\
|
59
59
|
" <h1>local1: #{locals['local1']}</h1>\n"\
|
60
60
|
"<p>logger: #{engine.logger.to_s}</p>\n\n"\
|
61
|
+
" <span>No locals!</span>\n\n"\
|
61
62
|
"</div>\n"
|
62
63
|
end
|
63
64
|
|
@@ -72,6 +73,7 @@ module Factory
|
|
72
73
|
"</div>\n"\
|
73
74
|
"<h1>local1: #{locals['local1']}</h1>\n"\
|
74
75
|
"<p>logger: #{engine.logger.to_s}</p>\n"\
|
76
|
+
"<span>No locals!</span>\n"\
|
75
77
|
"</div>\n"
|
76
78
|
end
|
77
79
|
|
@@ -0,0 +1 @@
|
|
1
|
+
<span>No locals!</span>
|
data/test/unit/source_tests.rb
CHANGED
@@ -102,7 +102,7 @@ class Deas::Erubis::Source
|
|
102
102
|
assert_equal local_val, context.send(local_name)
|
103
103
|
end
|
104
104
|
|
105
|
-
should "set any deas source given to its context class as
|
105
|
+
should "set any deas source given to its context class as an ivar on init" do
|
106
106
|
deas_source = 'a-deas-source'
|
107
107
|
context = subject.context_class.new(deas_source, {})
|
108
108
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deas-erubis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 3
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kelly Redding
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- test/helper.rb
|
88
88
|
- test/support/factory.rb
|
89
89
|
- test/support/templates/_partial.erb
|
90
|
+
- test/support/templates/_partial_no_locals.erb
|
90
91
|
- test/support/templates/_yield_partial.erb
|
91
92
|
- test/support/templates/basic.erb
|
92
93
|
- test/support/templates/compile.erb
|
@@ -136,6 +137,7 @@ test_files:
|
|
136
137
|
- test/helper.rb
|
137
138
|
- test/support/factory.rb
|
138
139
|
- test/support/templates/_partial.erb
|
140
|
+
- test/support/templates/_partial_no_locals.erb
|
139
141
|
- test/support/templates/_yield_partial.erb
|
140
142
|
- test/support/templates/basic.erb
|
141
143
|
- test/support/templates/compile.erb
|