deas-erubis 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,12 +11,12 @@ module Deas::Erubis
11
11
 
12
12
  module Methods
13
13
 
14
- def partial(*args)
15
- @deas_source.partial(*args)
14
+ def partial(n, l = nil)
15
+ @deas_source.partial(n, l || {})
16
16
  end
17
17
 
18
- def capture_partial(*args, &content)
19
- _erb_buffer @deas_source.partial(*args, &Proc.new{ _erb_capture(&content) })
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
@@ -1,4 +1,4 @@
1
1
  module Deas; end
2
2
  module Deas::Erubis
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
@@ -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>
@@ -3,4 +3,5 @@
3
3
  <span>some content</span>
4
4
  <% end %>
5
5
  <% capture_partial '_partial', 'local1' => local1 %>
6
+ <% capture_partial '_partial_no_locals' %>
6
7
  </div>
@@ -1,3 +1,4 @@
1
1
  <div>
2
2
  <%= partial '_partial', 'local1' => local1 %>
3
+ <%= partial '_partial_no_locals' %>
3
4
  </div>
@@ -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 in ivar on init" do
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: 23
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 0.2.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