cells-capture 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/README.md +1 -3
- data/lib/cells_capture.rb +3 -2
- data/lib/cells_capture/CHANGES.md +5 -1
- data/lib/cells_capture/version.rb +1 -1
- data/test/capture_test.rb +7 -2
- data/test/views/bassist/content_for.html.erb +1 -0
- data/test/views/musicians/show.html.erb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0fa3fcc31aeaa1b18cb043e30491be8af3a6c09
|
4
|
+
data.tar.gz: 824ab2446fe7f936c1ad85a600827c49e8a76ae7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 198f0693e35f01e555584d6213c1f2918daae56ed3933ccdab1347ac8dab7483176ac5c89e96a14bd59c02c3a7658e06e2ec35d2f13a004713f3534f0a96c7c9
|
7
|
+
data.tar.gz: c7e27f6a4ea647b5ea8756378bb6f6b95d75e355581c9337bf85d79bc5b1f9043e3ffeef7e535fc0761149ef83a097e6d6aacca01b2438d41be1c6f215127fb9
|
data/README.md
CHANGED
@@ -30,6 +30,4 @@ The captured content is now available globally (brrr) in your controller views o
|
|
30
30
|
|
31
31
|
# Limitations
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
Also, I want to note that I am not a big fan of breaking cells' encapsulation by emiting content into a global variable. However, as many people asked for it I provide this feature to improve the world's happiness factor.
|
33
|
+
I want to note that I am not a big fan of breaking cells' encapsulation by emitting content into a global variable. However, as many people asked for it I provide this feature to improve the world's happiness factor.
|
data/lib/cells_capture.rb
CHANGED
@@ -11,8 +11,9 @@ module Cell
|
|
11
11
|
attr_accessor :global_tpl
|
12
12
|
|
13
13
|
module RenderCellExtension
|
14
|
-
def render_cell(*args)
|
15
|
-
super(*args) do |cell|
|
14
|
+
def render_cell(*args, &block)
|
15
|
+
super(*args) do |cell|
|
16
|
+
block.call(cell) if block_given?
|
16
17
|
cell.global_tpl = self if cell.is_a? ::Cell::Rails::Capture
|
17
18
|
end
|
18
19
|
end
|
data/test/capture_test.rb
CHANGED
@@ -16,7 +16,7 @@ end
|
|
16
16
|
|
17
17
|
class BassistCell < Cell::Rails
|
18
18
|
append_view_path("test/views")
|
19
|
-
|
19
|
+
attr_accessor :data_from_block
|
20
20
|
#helper ::Cells::Helpers::CaptureHelper
|
21
21
|
def content_for
|
22
22
|
render
|
@@ -31,6 +31,11 @@ class CaptureTest < ActionController::TestCase
|
|
31
31
|
|
32
32
|
test "#content_for" do
|
33
33
|
get 'show'
|
34
|
-
|
34
|
+
assert_includes @response.body, "keep me!<pre>DummDooDiiDoo</pre>"
|
35
|
+
end
|
36
|
+
|
37
|
+
test "#render_cell passes arguments to the cell" do
|
38
|
+
get 'show'
|
39
|
+
assert_includes @response.body, "I am data from block"
|
35
40
|
end
|
36
41
|
end
|
@@ -1 +1 @@
|
|
1
|
-
<%= render_cell(:bassist, :content_for) %><pre><%= yield :recorded %></pre>
|
1
|
+
<%= render_cell(:bassist, :content_for) { |c| c.data_from_block = "I am data from block"} %><pre><%= yield :recorded %></pre>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cells-capture
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
117
|
version: '0'
|
118
118
|
requirements: []
|
119
119
|
rubyforge_project:
|
120
|
-
rubygems_version: 2.
|
120
|
+
rubygems_version: 2.2.2
|
121
121
|
signing_key:
|
122
122
|
specification_version: 4
|
123
123
|
summary: Provides content_for for Cells.
|