cells 3.6.0 → 3.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ h2. 3.6.1
2
+
3
+ h3. Changes
4
+ * Added the @:format@ option allowing @#render@ to set different template types, e.g. @render :format => :json@.
5
+
6
+
1
7
  h2. 3.6.0
2
8
 
3
9
  h3. Changes
@@ -19,8 +19,8 @@ Gem::Specification.new do |s|
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
21
 
22
- s.add_dependency "actionpack", "~> 3.0"
23
- s.add_dependency "railties", "~> 3.0"
22
+ s.add_dependency "actionpack", "~> 3.0.0"
23
+ s.add_dependency "railties", "~> 3.0.0"
24
24
 
25
25
  s.add_development_dependency "shoulda"
26
26
  s.add_development_dependency "haml"
@@ -76,6 +76,7 @@ module Cell
76
76
  # +:file+:: Specifies the name of the file template to render.
77
77
  # +:nothing+:: Doesn't invoke the rendering process.
78
78
  # +:state+:: Instantly invokes another rendering cycle for the passed state and returns. You may pass arbitrary state-args to the called state.
79
+ # +:format+:: Sets a different template format, e.g. +:json+.
79
80
  #
80
81
  # Example:
81
82
  # class MusicianCell < ::Cell::Base
@@ -63,6 +63,8 @@ module Cell
63
63
  end
64
64
 
65
65
  def process_opts_for(opts, state)
66
+ lookup_context.formats = opts.delete(:format) if opts[:format]
67
+
66
68
  opts[:template] = find_family_view_for_state(opts.delete(:view) || state)
67
69
  end
68
70
  end
@@ -19,6 +19,8 @@ module Cell
19
19
  private
20
20
  def process_opts_for(opts, state)
21
21
  opts[:action] = opts[:view] || state
22
+
23
+ lookup_context.formats = opts.delete(:format) if opts[:format]
22
24
  end
23
25
  end
24
26
  end
@@ -1,3 +1,3 @@
1
1
  module Cells
2
- VERSION = '3.6.0'
2
+ VERSION = '3.6.1'
3
3
  end
@@ -16,7 +16,7 @@ class RailsRenderTest < ActiveSupport::TestCase
16
16
  BassistCell.class_eval do
17
17
  def play; render :format => :js; end
18
18
  end
19
- assert_equal "alert(\"Doo\");", render_cell(:bassist, :play)
19
+ assert_equal "alert(\"Doo\");\n", render_cell(:bassist, :play)
20
20
  end
21
21
 
22
22
  should "also render alternative engines, like haml" do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 3
7
7
  - 6
8
- - 0
9
- version: 3.6.0
8
+ - 1
9
+ version: 3.6.1
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-06-14 00:00:00 +02:00
17
+ date: 2011-06-28 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -28,7 +28,8 @@ dependencies:
28
28
  segments:
29
29
  - 3
30
30
  - 0
31
- version: "3.0"
31
+ - 0
32
+ version: 3.0.0
32
33
  type: :runtime
33
34
  version_requirements: *id001
34
35
  - !ruby/object:Gem::Dependency
@@ -42,7 +43,8 @@ dependencies:
42
43
  segments:
43
44
  - 3
44
45
  - 0
45
- version: "3.0"
46
+ - 0
47
+ version: 3.0.0
46
48
  type: :runtime
47
49
  version_requirements: *id002
48
50
  - !ruby/object:Gem::Dependency