cells 3.6.5 → 3.6.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -1
- data/CHANGES.textile +6 -0
- data/README.rdoc +3 -1
- data/Rakefile +3 -1
- data/cells.gemspec +2 -0
- data/lib/cell.rb +0 -1
- data/lib/cell/rails.rb +1 -1
- data/lib/cell/rails3_1_strategy.rb +1 -1
- data/lib/cells/version.rb +1 -1
- data/test/dummy/config/application.rb +2 -0
- data/test/rails/cells_test.rb +1 -1
- data/test/rails/render_test.rb +7 -0
- data/test/rails/router_test.rb +1 -0
- data/test/test_helper.rb +0 -1
- metadata +32 -6
data/.gitignore
CHANGED
data/CHANGES.textile
CHANGED
data/README.rdoc
CHANGED
@@ -149,7 +149,9 @@ So what if you wanna test the cart cell? Use the generated <tt>test/cells/cart_c
|
|
149
149
|
assert_select "#cart", "You have 3 items in your shopping cart."
|
150
150
|
end
|
151
151
|
|
152
|
-
|
152
|
+
Don't forget to put <tt>require 'cell/test_case'</tt> in your project's <tt>test/test_helper.rb</tt> file.
|
153
|
+
|
154
|
+
Then, run your tests with
|
153
155
|
|
154
156
|
$ rake test:cells
|
155
157
|
|
data/Rakefile
CHANGED
@@ -3,7 +3,9 @@ Bundler::GemHelper.install_tasks
|
|
3
3
|
|
4
4
|
require 'rake/testtask'
|
5
5
|
|
6
|
-
desc 'Test the cells
|
6
|
+
desc 'Test the cells gem.'
|
7
|
+
task :default => :test
|
8
|
+
|
7
9
|
Rake::TestTask.new(:test) do |test|
|
8
10
|
test.libs << 'test'
|
9
11
|
test.test_files = FileList['test/*_test.rb', 'test/rails/*_test.rb'] - ['test/rails/capture_test.rb']
|
data/cells.gemspec
CHANGED
@@ -22,7 +22,9 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_dependency "actionpack", "~> 3.0"
|
23
23
|
s.add_dependency "railties", "~> 3.0"
|
24
24
|
|
25
|
+
s.add_development_dependency "rake"
|
25
26
|
s.add_development_dependency "shoulda"
|
26
27
|
s.add_development_dependency "haml"
|
27
28
|
s.add_development_dependency "slim"
|
29
|
+
s.add_development_dependency "tzinfo" # FIXME: why the hell do we need this for 3.1?
|
28
30
|
end
|
data/lib/cell.rb
CHANGED
data/lib/cell/rails.rb
CHANGED
@@ -77,7 +77,7 @@ module Cell
|
|
77
77
|
# +:file+:: Specifies the name of the file template to render.
|
78
78
|
# +:nothing+:: Doesn't invoke the rendering process.
|
79
79
|
# +:state+:: Instantly invokes another rendering cycle for the passed state and returns. You may pass arbitrary state-args to the called state.
|
80
|
-
# +:format+:: Sets a different template format, e.g. +:json+.
|
80
|
+
# +:format+:: Sets a different template format, e.g. +:json+. Use this option with caution as it currently modifies the global format variable. This might lead to unexpected subsequent render behaviour due to a design flaw in Rails.
|
81
81
|
#
|
82
82
|
# Example:
|
83
83
|
# class MusicianCell < ::Cell::Base
|
data/lib/cells/version.rb
CHANGED
data/test/rails/cells_test.rb
CHANGED
@@ -48,7 +48,7 @@ class RailsCellsTest < ActiveSupport::TestCase
|
|
48
48
|
|
49
49
|
context "A rails cell" do
|
50
50
|
should "respond to DEFAULT_VIEW_PATHS" do
|
51
|
-
assert_equal ["app/cells"
|
51
|
+
assert_equal ["app/cells"], Cell::Base::DEFAULT_VIEW_PATHS
|
52
52
|
end
|
53
53
|
|
54
54
|
should "respond to .setup_view_paths!" do
|
data/test/rails/render_test.rb
CHANGED
@@ -18,6 +18,13 @@ class RailsRenderTest < ActiveSupport::TestCase
|
|
18
18
|
assert_equal "alert(\"Doo\");\n", render_cell(:bassist, :play)
|
19
19
|
end
|
20
20
|
|
21
|
+
should_eventually "accept :format without messing up following render calls" do
|
22
|
+
BassistCell.class_eval do
|
23
|
+
def play; render(:format => :js) + render; end
|
24
|
+
end
|
25
|
+
assert_equal "alert(\"Doo\");\nDoo\n", render_cell(:bassist, :play)
|
26
|
+
end
|
27
|
+
|
21
28
|
should "also render alternative engines, like haml" do
|
22
29
|
BassistCell.class_eval do
|
23
30
|
def sing; render; end
|
data/test/rails/router_test.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -21,7 +21,6 @@ test_app_dir = File.join(gem_dir, 'test', 'app')
|
|
21
21
|
require 'cells'
|
22
22
|
|
23
23
|
Cell::Rails.append_view_path(File.join(test_app_dir, 'cells'))
|
24
|
-
Cell::Rails.append_view_path(File.join(test_app_dir, 'cells', 'layouts'))
|
25
24
|
|
26
25
|
require "cell/test_case"
|
27
26
|
# Extend TestCase.
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 3
|
7
7
|
- 6
|
8
|
-
-
|
9
|
-
version: 3.6.
|
8
|
+
- 6
|
9
|
+
version: 3.6.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Nick Sutterer
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-09-21 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
type: :runtime
|
47
47
|
version_requirements: *id002
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
|
-
name:
|
49
|
+
name: rake
|
50
50
|
prerelease: false
|
51
51
|
requirement: &id003 !ruby/object:Gem::Requirement
|
52
52
|
none: false
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
type: :development
|
60
60
|
version_requirements: *id003
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
62
|
+
name: shoulda
|
63
63
|
prerelease: false
|
64
64
|
requirement: &id004 !ruby/object:Gem::Requirement
|
65
65
|
none: false
|
@@ -72,7 +72,7 @@ dependencies:
|
|
72
72
|
type: :development
|
73
73
|
version_requirements: *id004
|
74
74
|
- !ruby/object:Gem::Dependency
|
75
|
-
name:
|
75
|
+
name: haml
|
76
76
|
prerelease: false
|
77
77
|
requirement: &id005 !ruby/object:Gem::Requirement
|
78
78
|
none: false
|
@@ -84,6 +84,32 @@ dependencies:
|
|
84
84
|
version: "0"
|
85
85
|
type: :development
|
86
86
|
version_requirements: *id005
|
87
|
+
- !ruby/object:Gem::Dependency
|
88
|
+
name: slim
|
89
|
+
prerelease: false
|
90
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
segments:
|
96
|
+
- 0
|
97
|
+
version: "0"
|
98
|
+
type: :development
|
99
|
+
version_requirements: *id006
|
100
|
+
- !ruby/object:Gem::Dependency
|
101
|
+
name: tzinfo
|
102
|
+
prerelease: false
|
103
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
104
|
+
none: false
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
segments:
|
109
|
+
- 0
|
110
|
+
version: "0"
|
111
|
+
type: :development
|
112
|
+
version_requirements: *id007
|
87
113
|
description: Cells are view components for Rails. They are lightweight controllers, can be rendered in views and thus provide an elegant and fast way for encapsulation and component-orientation.
|
88
114
|
email:
|
89
115
|
- apotonick@gmail.com
|