cells 3.6.5 → 3.6.6

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.
data/.gitignore CHANGED
@@ -3,5 +3,5 @@ pkg
3
3
  .*~
4
4
  .bundle
5
5
  Gemfile.lock
6
- test/dummy/log/test.log
6
+ test/dummy/log/*.log
7
7
  test/dummy/tmp/
data/CHANGES.textile CHANGED
@@ -1,3 +1,9 @@
1
+ h2. 3.6.6
2
+
3
+ h3. Changes
4
+ * Added the @:format@ option for @#render@ which should be used with caution. Sorry for that.
5
+ * Removed the useless @layouts/@ view path from Cell::Base.
6
+
1
7
  h2. 3.6.5
2
8
 
3
9
  h3. Bugfixes
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
- Run your tests with
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 plugin.'
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
@@ -5,7 +5,6 @@ module Cell
5
5
 
6
6
  DEFAULT_VIEW_PATHS = [
7
7
  File.join('app', 'cells'),
8
- File.join('app', 'cells', 'layouts')
9
8
  ]
10
9
 
11
10
  module ClassMethods
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
@@ -20,7 +20,7 @@ module Cell
20
20
  def process_opts_for(opts, state)
21
21
  opts[:action] = opts[:view] || state
22
22
 
23
- lookup_context.formats = opts.delete(:format) if opts[:format]
23
+ lookup_context.formats = [opts.delete(:format)] if opts[:format]
24
24
  end
25
25
  end
26
26
  end
data/lib/cells/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cells
2
- VERSION = '3.6.5'
2
+ VERSION = '3.6.6'
3
3
  end
@@ -17,5 +17,7 @@ module Dummy
17
17
 
18
18
  # Configure sensitive parameters which will be filtered from the log file.
19
19
  config.filter_parameters += [:password]
20
+
21
+ config.cache_store = :memory_store
20
22
  end
21
23
  end
@@ -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", "app/cells/layouts"], Cell::Base::DEFAULT_VIEW_PATHS
51
+ assert_equal ["app/cells"], Cell::Base::DEFAULT_VIEW_PATHS
52
52
  end
53
53
 
54
54
  should "respond to .setup_view_paths!" do
@@ -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
@@ -24,6 +24,7 @@ module ApplicationTests
24
24
  def default_url_options
25
25
  {:host => "cells.rails.org"}
26
26
  end
27
+
27
28
  end
28
29
 
29
30
  assert_equal "http://cells.rails.org/", BassistCell.new(@controller).root_url
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
- - 5
9
- version: 3.6.5
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-08-15 00:00:00 +02:00
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: shoulda
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: haml
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: slim
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