theme_support 3.0.3 → 3.0.4

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/README CHANGED
@@ -149,6 +149,8 @@ The theme_support plugin includes patches from the following:
149
149
  Thanks guys!
150
150
 
151
151
  == Changelog
152
+ 3.0.4 - [BUG] override view when we use explicitely render
153
+
152
154
  3.0.3 - Hack which uses layout theme but crashes if it doesn't exist ! Now it loads the default layout
153
155
 
154
156
  3.0.2 - Don't load a nil theme
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.3
1
+ 3.0.4
@@ -32,21 +32,19 @@ class AbstractController::Base
32
32
  end
33
33
  end
34
34
 
35
- # Hack which uses layout theme but crashes if it doesn't exist !
36
- # Now it loads the default layout
37
- #AbstractController::Layouts.module_eval do
38
- # def _normalize_options(options)
39
- # super
40
- #
41
- # if _include_layout?(options)
42
- # layout = options.key?(:layout) ? options.delete(:layout) : :default
43
- # value = _layout_for_option(layout)
44
- # options[:layout] = (value =~ /\blayouts/ ? value : "layouts/#{value}") if value
45
- # end
46
- #
47
- # if current_theme
48
- # theme_path = File.join(Rails.root, "themes", current_theme, "views")
49
- # options[:layout] = File.join(theme_path, options[:layout])
50
- # end
51
- # end
52
- #end
35
+ module AbstractController
36
+ module Rendering
37
+ alias_method :theme_support_render, :render
38
+
39
+ def render(*args, &block)
40
+ theme = current_theme
41
+ if theme
42
+ theme = ActionView::Base.process_view_paths(File.join("themes", theme, "views"))
43
+ prepend_view_path(theme)
44
+ end
45
+
46
+ theme_support_render(*args, &block)
47
+ end
48
+
49
+ end
50
+ end
data/lib/theme_support.rb CHANGED
@@ -7,7 +7,6 @@ require 'theme_support/theme_controller'
7
7
 
8
8
  # Initializes theme support by extending some of the core Rails classes
9
9
  require 'theme_support/patches/abstractcontroller_ex'
10
- require 'theme_support/patches/actioncontroller_ex'
11
10
  require 'theme_support/patches/routeset_ex'
12
11
 
13
12
  # Add the tag helpers for rhtml and, optionally, liquid templates
@@ -5,7 +5,7 @@ spec = Gem::Specification.new do |s|
5
5
  s.name = 'theme_support'
6
6
  s.author = 'Pierre Yager and Sylvain Claudel'
7
7
  s.email = "pierre@levosgien.net"
8
- s.version = ("$Release: 3.0.3" =~ /[\.\d]+/) && $&
8
+ s.version = ("$Release: 3.0.4" =~ /[\.\d]+/) && $&
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.homepage = 'http://github.com/zedalaye/theme_support'
11
11
  s.rubyforge_project = 'theme-support'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: theme_support
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
- - 3
10
- version: 3.0.3
9
+ - 4
10
+ version: 3.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pierre Yager and Sylvain Claudel
@@ -38,7 +38,6 @@ files:
38
38
  - lib/generators/theme/templates/preview.png
39
39
  - lib/generators/theme/theme_generator.rb
40
40
  - lib/theme_support.rb
41
- - lib/theme_support/patches/actioncontroller_ex.rb
42
41
  - lib/theme_support/patches/abstractcontroller_ex.rb
43
42
  - lib/theme_support/patches/routeset_ex.rb
44
43
  - lib/theme_support/patches/actionmailer_ex.rb
@@ -1,16 +0,0 @@
1
- # Load the theme to execution and not in loading app
2
- # TODO Check if this code works this action mailer
3
- module ActionController
4
- module ImplicitRender
5
- alias_method :theme_support_default_render, :default_render
6
-
7
- def default_render
8
- theme = current_theme
9
- if theme
10
- theme = ActionView::Base.process_view_paths(File.join("themes", theme, "views"))
11
- prepend_view_path(theme)
12
- end
13
- theme_support_default_render
14
- end
15
- end
16
- end