cells 3.7.0 → 3.7.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.textile CHANGED
@@ -1,3 +1,7 @@
1
+ h2. 3.7.1
2
+
3
+ * Runs with Rails 3.2 now. Thanks to Mohammad Satrio [tyok] for fixing.
4
+
1
5
  h2. 3.7.0
2
6
 
3
7
  h3. Changes
data/lib/cell/base.rb ADDED
@@ -0,0 +1,41 @@
1
+ require 'abstract_controller'
2
+ require 'cell/builder'
3
+ require 'cell/caching'
4
+ require 'cell/rendering'
5
+ require 'cell/rails3_0_strategy' if Cells.rails3_0?
6
+ require 'cell/rails3_1_strategy' if Cells.rails3_1_or_more?
7
+
8
+ module Cell
9
+ class Base < AbstractController::Base
10
+ abstract!
11
+ DEFAULT_VIEW_PATHS = [File.join('app', 'cells')]
12
+
13
+ extend Builder
14
+ include AbstractController
15
+ include AbstractController::Rendering, Layouts, Helpers, Callbacks, Translation, Logger
16
+
17
+ include VersionStrategy
18
+ include Rendering
19
+ include Caching
20
+
21
+
22
+ class View < ActionView::Base
23
+ def render(*args, &block)
24
+ options = args.first.is_a?(::Hash) ? args.first : {} # this is copied from #render by intention.
25
+
26
+ return controller.render(*args, &block) if options[:state] or options[:view]
27
+ super
28
+ end
29
+ end
30
+
31
+
32
+ # Called in Railtie at initialization time.
33
+ def self.setup_view_paths!
34
+ self.view_paths = DEFAULT_VIEW_PATHS
35
+ end
36
+
37
+ def self.controller_path
38
+ @controller_path ||= name.sub(/Cell$/, '').underscore unless anonymous?
39
+ end
40
+ end
41
+ end
data/lib/cell/rails.rb CHANGED
@@ -10,7 +10,7 @@ module Cell
10
10
 
11
11
  if Cells.rails3_0?
12
12
  require 'cell/rails3_0_strategy'
13
- elsif Cells.rails3_1?
13
+ elsif Cells.rails3_1_or_more?
14
14
  require 'cell/rails3_1_strategy'
15
15
  end
16
16
 
data/lib/cells.rb CHANGED
@@ -75,8 +75,8 @@ module Cells
75
75
  ::Rails::VERSION::MINOR == 0
76
76
  end
77
77
 
78
- def self.rails3_1?
79
- ::Rails::VERSION::MINOR == 1
78
+ def self.rails3_1_or_more?
79
+ ::Rails::VERSION::MINOR >= 1
80
80
  end
81
81
  end
82
82
 
data/lib/cells/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cells
2
- VERSION = '3.7.0'
2
+ VERSION = '3.7.1'
3
3
  end
@@ -20,12 +20,15 @@ class CellsModuleTest < ActiveSupport::TestCase
20
20
  end
21
21
  end
22
22
 
23
- should "respond to #rails3_1?" do
23
+ should "respond to #rails3_1_or_more?" do
24
24
  if Rails::VERSION::MINOR == 0
25
- assert ! Cells.rails3_1?
25
+ assert ! Cells.rails3_1_or_more?
26
26
  assert Cells.rails3_0?
27
- elsif
28
- assert Cells.rails3_1?
27
+ elsif Rails::VERSION::MINOR == 1
28
+ assert Cells.rails3_1_or_more?
29
+ assert ! Cells.rails3_0?
30
+ elsif Rails::VERSION::MINOR == 2
31
+ assert Cells.rails3_1_or_more?
29
32
  assert ! Cells.rails3_0?
30
33
  end
31
34
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 3
7
7
  - 7
8
- - 0
9
- version: 3.7.0
8
+ - 1
9
+ version: 3.7.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-10-13 00:00:00 +02:00
17
+ date: 2011-12-20 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -129,6 +129,7 @@ files:
129
129
  - about.yml
130
130
  - cells.gemspec
131
131
  - lib/cell.rb
132
+ - lib/cell/base.rb
132
133
  - lib/cell/caching.rb
133
134
  - lib/cell/deprecations.rb
134
135
  - lib/cell/rails.rb