cells 3.8.8 → 3.9.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.
- checksums.yaml +7 -0
- data/.gitignore +2 -1
- data/.travis.yml +5 -2
- data/CHANGES.textile +23 -15
- data/Gemfile +1 -1
- data/README.md +412 -0
- data/Rakefile +2 -2
- data/cells.gemspec +5 -6
- data/gemfiles/Gemfile.rails3-0 +2 -2
- data/gemfiles/Gemfile.rails3-1 +1 -1
- data/gemfiles/Gemfile.rails3-2 +1 -2
- data/gemfiles/Gemfile.rails4-0 +7 -0
- data/lib/cell.rb +27 -0
- data/lib/cell/base.rb +31 -18
- data/lib/cell/builder.rb +11 -10
- data/lib/cell/dsl.rb +7 -0
- data/lib/cell/rack.rb +5 -9
- data/lib/cell/rails.rb +19 -11
- data/lib/cell/rails/view_model.rb +115 -0
- data/lib/cell/rails3_0_strategy.rb +1 -1
- data/lib/cell/rails3_1_strategy.rb +1 -1
- data/lib/cell/rails4_0_strategy.rb +1 -2
- data/lib/cell/test_case.rb +11 -11
- data/lib/cells.rb +4 -3
- data/lib/cells/rails.rb +16 -3
- data/lib/cells/version.rb +1 -1
- data/test/app/cells/bassist_cell.rb +9 -1
- data/test/app/cells/rails_helper_api_test/bassist/edit.html.erb +3 -3
- data/test/app/cells/song/dashboard.haml +7 -0
- data/test/app/cells/song/details.html.haml +1 -0
- data/test/app/cells/song/info.html.haml +1 -0
- data/test/app/cells/song/lyrics.html.haml +6 -0
- data/test/app/cells/song/plays.haml +1 -0
- data/test/app/cells/song/show.html.haml +3 -0
- data/test/app/cells/song/title.html.haml +1 -0
- data/test/app/cells/view_model_test/comments/show.haml +7 -0
- data/test/cell_module_test.rb +39 -41
- data/test/cell_test.rb +28 -0
- data/test/dummy/app/views/musician/featured_with_block.html.erb +1 -1
- data/test/dummy/app/views/musician/title.erb +1 -0
- data/test/dummy/config/routes.rb +1 -0
- data/test/helper_test.rb +13 -10
- data/test/rails/caching_test.rb +75 -73
- data/test/rails/cells_test.rb +25 -23
- data/test/rails/integration_test.rb +80 -61
- data/test/rails/view_model_test.rb +119 -0
- data/test/rails_helper_api_test.rb +11 -13
- metadata +41 -61
- data/README.rdoc +0 -279
- data/about.yml +0 -7
- data/test/app/cells/producer/capture.html.erb +0 -1
- data/test/app/cells/producer/content_for.html.erb +0 -2
- data/test/rails/capture_test.rb +0 -70
data/about.yml
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
author: Nick Sutterer, Peter Bex, Bob Leers
|
|
2
|
-
summary: Cells are lightweight controllers for Rails and can be rendered in controllers and views, providing an elegant and fast way for encapsulation and component-orientation.
|
|
3
|
-
homepage: http://cells.rubyforge.org
|
|
4
|
-
plugin:
|
|
5
|
-
license: MIT
|
|
6
|
-
version: 1.1
|
|
7
|
-
rails_version: 2.1
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<% @local_track = global_capture(:recorded) do %><%= "DummDoo" %><% end %> <%= @local_track %>
|
data/test/rails/capture_test.rb
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
require 'test_helper'
|
|
2
|
-
|
|
3
|
-
class ProducerCell < Cell::Rails
|
|
4
|
-
#helper ::Cells::Helpers::CaptureHelper
|
|
5
|
-
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
class RailsCaptureTest < ActionController::TestCase
|
|
9
|
-
tests MusicianController
|
|
10
|
-
|
|
11
|
-
test "#content_for" do
|
|
12
|
-
@controller.class_eval do
|
|
13
|
-
def featured
|
|
14
|
-
|
|
15
|
-
render :inline => '<%= render_cell(:producer, :content_for, self) %><pre><%= yield :recorded %></pre>'
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
ProducerCell.class_eval do
|
|
20
|
-
def content_for(tpl);
|
|
21
|
-
puts tpl
|
|
22
|
-
@tpl = tpl
|
|
23
|
-
|
|
24
|
-
render; end
|
|
25
|
-
|
|
26
|
-
def global_content_for(*args, &block)
|
|
27
|
-
@tpl.content_for(*args, &block)
|
|
28
|
-
end
|
|
29
|
-
helper_method :global_content_for
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
get 'featured'
|
|
33
|
-
assert_equal "\n<pre>DummDooDiiDoo</pre>", @response.body
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
describe "what" do
|
|
38
|
-
it "see content from global_capture" do
|
|
39
|
-
@controller.class_eval do
|
|
40
|
-
def featured
|
|
41
|
-
render :inline => '<h3><%= @recorded %></h3>' << render_cell(:producer, :capture)
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
ProducerCell.class_eval do
|
|
46
|
-
def capture; render; end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
get 'featured'
|
|
50
|
-
assert_equal '<h3>DummDoo</h3> DummDoo', @response.body
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
it "see yieldable content from global_content_for" do
|
|
55
|
-
@controller.class_eval do
|
|
56
|
-
def featured
|
|
57
|
-
render_cell(:producer, :content_for)
|
|
58
|
-
render :inline => '<pre><%= yield :recorded %></pre>'
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
ProducerCell.class_eval do
|
|
63
|
-
def content_for; render; end
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
get 'featured'
|
|
67
|
-
assert_equal "\n<pre>DummDooDiiDoo</pre>", @response.body
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
end
|