geny 2.2.0 → 2.3.0

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: e2286049f68c8960495c76620fc2ee09f9c24750
4
- data.tar.gz: 1bd837179aa4586403a537d674fc835723a1c1d7
3
+ metadata.gz: fe20ce2aad56f9d9ea091a83694d9a10704c4841
4
+ data.tar.gz: 81021763bcf6b5681f7fb428ce25ba47d9d21a8c
5
5
  SHA512:
6
- metadata.gz: a8d4c6173e8929ed5e47e6be62c0cdbdf75afe1d5b4f953e3e9875f0656eb8f964751743ac8fb3cb1bf4f536e212c09ee94de039c416acc072f822e93a2f5ae2
7
- data.tar.gz: 66499adbb817910d08bbd1775f712b6ec6f65f693a61351ec7a396d3a0e5ecc4f844fb286823439a4b132cf1c55b95b5751088d749aadda48324bcc735bbec61
6
+ metadata.gz: 30433c06880fef7821d918ee93b7e4619c37a344e68817990c34e9a44131e72442c20cefc89c8347c08cd5004dc114f0b5398c654ed3638c4ac967a68810b35f
7
+ data.tar.gz: b618741dfd41d3f0fe8780486df2cd43101b7cc7e304cedf0e23831c1686cd287105cda75076b58b0f22a65f2c41ecf03cdfefdb89ff90562a417c7fb4781f82
@@ -10,6 +10,23 @@ module Geny
10
10
  def merge(updates)
11
11
  View.new(command: command, locals: locals.merge(updates))
12
12
  end
13
+
14
+ # Append to the output buffer
15
+ def concat(data)
16
+ @output_buffer << data
17
+ end
18
+
19
+ # Capture the ERB rendered inside a block
20
+ def capture(*args, &block)
21
+ @output_buffer, buffer_was = "", @output_buffer
22
+
23
+ begin
24
+ block.call(*args)
25
+ block.binding.eval("@output_buffer")
26
+ ensure
27
+ @output_buffer = buffer_was
28
+ end
29
+ end
13
30
  end
14
31
  end
15
32
  end
data/lib/geny/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Geny
2
- VERSION = "2.2.0"
2
+ VERSION = "2.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geny
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ray Zane
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-21 00:00:00.000000000 Z
11
+ date: 2019-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: argy