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.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -1
  3. data/.travis.yml +5 -2
  4. data/CHANGES.textile +23 -15
  5. data/Gemfile +1 -1
  6. data/README.md +412 -0
  7. data/Rakefile +2 -2
  8. data/cells.gemspec +5 -6
  9. data/gemfiles/Gemfile.rails3-0 +2 -2
  10. data/gemfiles/Gemfile.rails3-1 +1 -1
  11. data/gemfiles/Gemfile.rails3-2 +1 -2
  12. data/gemfiles/Gemfile.rails4-0 +7 -0
  13. data/lib/cell.rb +27 -0
  14. data/lib/cell/base.rb +31 -18
  15. data/lib/cell/builder.rb +11 -10
  16. data/lib/cell/dsl.rb +7 -0
  17. data/lib/cell/rack.rb +5 -9
  18. data/lib/cell/rails.rb +19 -11
  19. data/lib/cell/rails/view_model.rb +115 -0
  20. data/lib/cell/rails3_0_strategy.rb +1 -1
  21. data/lib/cell/rails3_1_strategy.rb +1 -1
  22. data/lib/cell/rails4_0_strategy.rb +1 -2
  23. data/lib/cell/test_case.rb +11 -11
  24. data/lib/cells.rb +4 -3
  25. data/lib/cells/rails.rb +16 -3
  26. data/lib/cells/version.rb +1 -1
  27. data/test/app/cells/bassist_cell.rb +9 -1
  28. data/test/app/cells/rails_helper_api_test/bassist/edit.html.erb +3 -3
  29. data/test/app/cells/song/dashboard.haml +7 -0
  30. data/test/app/cells/song/details.html.haml +1 -0
  31. data/test/app/cells/song/info.html.haml +1 -0
  32. data/test/app/cells/song/lyrics.html.haml +6 -0
  33. data/test/app/cells/song/plays.haml +1 -0
  34. data/test/app/cells/song/show.html.haml +3 -0
  35. data/test/app/cells/song/title.html.haml +1 -0
  36. data/test/app/cells/view_model_test/comments/show.haml +7 -0
  37. data/test/cell_module_test.rb +39 -41
  38. data/test/cell_test.rb +28 -0
  39. data/test/dummy/app/views/musician/featured_with_block.html.erb +1 -1
  40. data/test/dummy/app/views/musician/title.erb +1 -0
  41. data/test/dummy/config/routes.rb +1 -0
  42. data/test/helper_test.rb +13 -10
  43. data/test/rails/caching_test.rb +75 -73
  44. data/test/rails/cells_test.rb +25 -23
  45. data/test/rails/integration_test.rb +80 -61
  46. data/test/rails/view_model_test.rb +119 -0
  47. data/test/rails_helper_api_test.rb +11 -13
  48. metadata +41 -61
  49. data/README.rdoc +0 -279
  50. data/about.yml +0 -7
  51. data/test/app/cells/producer/capture.html.erb +0 -1
  52. data/test/app/cells/producer/content_for.html.erb +0 -2
  53. 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 %>
@@ -1,2 +0,0 @@
1
- <% global_content_for :recorded do %><%= "DummDoo" %><% end %>
2
- <% global_content_for :recorded do %><%= "DiiDoo" %><% end %>
@@ -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