theme_support 3.0.5 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.
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.6 - We didn't need to preload cache (rake themes:cache:update) in development
153
+
152
154
  3.0.5 - html_safe on helpers, Theme model and controller become Themesupport model and controller
153
155
 
154
156
  3.0.4 - [BUG] override view when we use explicitely render
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.5
1
+ 3.0.6
@@ -15,10 +15,16 @@ module ActionView::Helpers::AssetTagHelper
15
15
  end
16
16
 
17
17
  # returns the path to a theme javascript
18
- def theme_javascript_path( source, theme=nil )
18
+ # Add ts to the name function, because rails think it's a route (_path)
19
+ def theme_javascript_pathts( source, theme=nil )
19
20
  theme = theme || controller.current_theme
20
21
  compute_public_path(source, "themes/#{theme}/javascripts", 'js').html_safe
21
22
  end
23
+
24
+ # To keep compatibility with old themesupport plugin
25
+ def theme_javascript_path( source, theme=nil )
26
+ theme_javascript_pathts( source, theme)
27
+ end
22
28
 
23
29
  # This tag it will automatially include theme specific css files
24
30
  def theme_stylesheet_link_tag(*sources)
@@ -56,7 +62,7 @@ module ActionView::Helpers::AssetTagHelper
56
62
  sources << "application" if defined?(Rails.root) && File.exists?("#{Rails.root}/public/javascripts/application.js")
57
63
  end
58
64
  sources.collect { |source|
59
- source = theme_javascript_path(source)
65
+ source = theme_javascript_pathts(source)
60
66
  content_tag("script", "", { "type" => "text/javascript", "src" => source }.merge(options))
61
67
  }.join("\n").html_safe
62
68
  end
@@ -1,19 +1,20 @@
1
+ # coding: utf-8
1
2
  # The controller for serving/cacheing theme content...
2
3
  #
3
4
  class ThemesupportController < ActionController::Base
4
5
 
5
- after_filter :cache_theme_files
6
+ #after_filter :cache_theme_files
6
7
 
7
8
  def stylesheets
8
- render_theme_item(:stylesheets, params[:filename].join('/'), params[:theme])
9
+ render_theme_item(:stylesheets, [params[:filename]].flatten.join('/'), params[:theme])
9
10
  end
10
11
 
11
12
  def javascript
12
- render_theme_item(:javascripts, params[:filename].join('/'), params[:theme], 'text/javascript')
13
+ render_theme_item(:javascripts, [params[:filename]].flatten.join('/'), params[:theme], 'text/javascript')
13
14
  end
14
15
 
15
16
  def images
16
- render_theme_item(:images, params[:filename].to_s, params[:theme])
17
+ render_theme_item(:images, [params[:filename]].flatten.join('/'), params[:theme])
17
18
  end
18
19
 
19
20
  def error
@@ -24,7 +25,11 @@ class ThemesupportController < ActionController::Base
24
25
 
25
26
  def render_theme_item(type, file, theme, mime = mime_for(file))
26
27
  render :text => "Not Found", :status => 404 and return if file.split(%r{[\\/]}).include?("..")
27
- send_file "#{Themesupport.path_to_theme(theme)}/#{type}/#{file}", :type => mime, :content_type => mime, :disposition => 'inline'
28
+
29
+ #Call manually, if it is in a after_filter send_file doesn't work
30
+ cache_theme_files
31
+
32
+ send_file "#{Themesupport.path_to_theme(theme)}/#{type}/#{file}", :type => mime, :disposition => 'inline'
28
33
  end
29
34
 
30
35
  def cache_theme_files
@@ -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.5" =~ /[\.\d]+/) && $&
8
+ s.version = ("$Release: 3.0.6" =~ /[\.\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: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
- - 5
10
- version: 3.0.5
9
+ - 6
10
+ version: 3.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pierre Yager and Sylvain Claudel
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-09 00:00:00 +02:00
18
+ date: 2010-09-16 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21