roger 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 513655e105f751dca8bbc543a7256b732aeb511b
4
- data.tar.gz: e9d571bfed7a5daa925441689eee296e489cd64c
3
+ metadata.gz: 90bed681641cf5722ab1358fb98eb699beeec2db
4
+ data.tar.gz: f96a2a9b467568731dd0e3dcb3d60729bde47ad2
5
5
  SHA512:
6
- metadata.gz: 91fb6db2902cf5c9aa25a95d30c5ad2cb75bcb701d04fdddaa182c2544f0d4d2af2cc7c020398c960e51fdbc8774407a2b8b1b6679184f961ad471485ca95cd3
7
- data.tar.gz: 60cda336208d541df3bdd447343a0a46a87feab919c84c55c70a5ac9b2c8cfeeab4d3ef931f64fc1f025195538e90de1cf6ebcb75a6f70dd6ced94d656e9cb03
6
+ metadata.gz: 86c610fe97e1e7f8a2080676c1d87731750b20faf9294e75205b2638e72da37fa38bf4af536f7c564270b3ca17655263768914e4efd94ba5989102ea1c6ad26d
7
+ data.tar.gz: c7234601296a0d70c2b5c1ead72008399e922b1ae2daad1f291741978717d4f0d93ebb6afd397b4e65bf74f5feb7a7381a927839a857f39dc60122b57fa08faf
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## Version 1.7.2
4
+ * Return from partials instead of rendering partial content as string. This allows us to have code in ruby blocks instead of just more ERB.
5
+
3
6
  ## Version 1.7.1
4
7
  * Allow setting defaults per template extension.
5
8
  * Minor fixes
@@ -48,7 +48,7 @@ module Roger
48
48
 
49
49
  eval "@_erbout_tmp#{counter} = _erbout", block.binding
50
50
  eval "_erbout = \"\"", block.binding
51
- t = Tilt::ERBTemplate.new { "<%= yield %>" }
51
+ t = Tilt::ERBTemplate.new { "<% return yield %>" }
52
52
  t.render(&block)
53
53
  ensure
54
54
  eval "_erbout = @_erbout_tmp#{counter}", block.binding
data/lib/roger/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # Roger main namespace
2
2
  module Roger
3
- VERSION = "1.7.1".freeze
3
+ VERSION = "1.7.2".freeze
4
4
  end
@@ -67,6 +67,14 @@ module Roger
67
67
 
68
68
  result = render_erb_template "<% partial 'test/yield' do %><%= 'CONTENT' %><% end %>"
69
69
  assert_equal result, "B-CONTENT-A"
70
+
71
+ result = render_erb_template "<% partial 'test/yield' do %>|<%= [1,2].join(',') %>|<% end %>"
72
+ assert_equal result, "B-|1,2|-A"
73
+ end
74
+
75
+ def test_partial_with_code_block
76
+ result = render_erb_template "<% partial 'test/array' do [1,2,3,4] end %>"
77
+ assert_equal result, "1234"
70
78
  end
71
79
 
72
80
  def test_partial_with_block_without_yield
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flurin Egger
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-06-01 00:00:00.000000000 Z
13
+ date: 2017-08-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor