Commit da1ac64ab7939b92df9c9a5d20f2ae960bf1fd98

Authored by Antonio Terceiro
1 parent d4faecd1

rails3: write cached assets to a cache/ subdirectory

This fixes a problem with the packaged production environment where
Rails 3 expects write access to the entire directory instead of to just
the file it actually needs to write
app/helpers/layout_helper.rb
... ... @@ -33,7 +33,7 @@ module LayoutHelper
33 33 plugins_stylesheets = @plugins.select(&:stylesheet?).map { |plugin| plugin.class.public_path('style.css') }
34 34  
35 35 output = ''
36   - output += stylesheet_link_tag standard_stylesheets, :cache => 'cache'
  36 + output += stylesheet_link_tag standard_stylesheets, :cache => 'cache/application'
37 37 output += stylesheet_link_tag template_stylesheet_path
38 38 output += stylesheet_link_tag icon_theme_stylesheet_path
39 39 output += stylesheet_link_tag jquery_ui_theme_stylesheet_path
... ...
app/views/layouts/_javascript.html.erb
... ... @@ -3,7 +3,7 @@
3 3 'jquery-ui-1.8.2.custom.min', 'jquery.scrollTo', 'jquery.form.js', 'jquery-validation/jquery.validate',
4 4 'jquery.cookie', 'jquery.ba-bbq.min.js', 'reflection', 'jquery.tokeninput',
5 5 'add-and-join', 'report-abuse', 'catalog', 'manage-products',
6   -'jquery-ui-timepicker-addon', 'application.js', 'rails.js', :cache => 'cache-general' %>
  6 +'jquery-ui-timepicker-addon', 'application.js', 'rails.js', :cache => 'cache/application' %>
7 7  
8 8 <% language = FastGettext.locale %>
9 9 <% %w{messages methods}.each do |type| %>
... ...
app/views/layouts/chat.html.erb
... ... @@ -6,7 +6,7 @@
6 6 <meta name="description" content="<%= @environment.name %>" />
7 7 <link rel="shortcut icon" href="<%= image_path(theme_favicon) %>" type="image/x-icon" />
8 8 <%= noosfero_javascript %>
9   - <%= javascript_include_tag 'prototype', 'jquery.scrollabletab', 'strophejs-1.0.1/strophe', 'jquery.emoticon', '../designs/icons/pidgin/emoticons.js', 'ba-linkify', 'jquery.ba-hashchange', 'jquery.sound', 'chat', :cache => 'cache-chat' %>
  9 + <%= javascript_include_tag 'prototype', 'jquery.scrollabletab', 'strophejs-1.0.1/strophe', 'jquery.emoticon', '../designs/icons/pidgin/emoticons.js', 'ba-linkify', 'jquery.ba-hashchange', 'jquery.sound', 'chat', :cache => 'cache/chat' %>
10 10 <%= noosfero_stylesheets %>
11 11 <%= stylesheet_link_tag icon_theme_stylesheet_path %>
12 12 <%= stylesheet_link_tag theme_stylesheet_path %>
... ...
app/views/layouts/slideshow.html.erb
... ... @@ -11,7 +11,7 @@
11 11 %></title>
12 12  
13 13 <%= stylesheet_import "slideshow" %>
14   - <%= javascript_include_tag 'jquery-latest', 'sliderjs', 'pikachoose', :cache => 'cache-slideshow' %>
  14 + <%= javascript_include_tag 'jquery-latest', 'sliderjs', 'pikachoose', :cache => 'cache/slideshow' %>
15 15 <script type="text/javascript">
16 16 $(document).ready(function (){
17 17 $("#slideshow").PikaChoose({
... ...
debian/noosfero.links
... ... @@ -7,11 +7,6 @@ etc/noosfero/plugins usr/share/noosfero/config/pl
7 7 etc/noosfero/noosfero.yml usr/share/noosfero/config/noosfero.yml
8 8 etc/noosfero/local.rb usr/share/noosfero/config/local.rb
9 9 var/lib/noosfero-data/index usr/share/noosfero/index
10   -var/lib/noosfero-data/cache/cache-general.js usr/share/noosfero/public/javascripts/cache-general.js
11   -var/lib/noosfero-data/cache/cache-chat.js usr/share/noosfero/public/javascripts/cache-chat.js
12   -var/lib/noosfero-data/cache/cache-slideshow.js usr/share/noosfero/public/javascripts/cache-slideshow.js
13   -var/lib/noosfero-data/cache/cache.css usr/share/noosfero/public/stylesheets/cache.css
14   -var/lib/noosfero-data/cache/cache-media-listing.css usr/share/noosfero/public/stylesheets/cache-media-listing.css
15 10 var/lib/noosfero-data/cache usr/share/noosfero/public/javascripts/cache
16 11 var/lib/noosfero-data/cache usr/share/noosfero/public/stylesheets/cache
17 12 var/lib/noosfero-data/public/articles usr/share/noosfero/public/articles
... ...
public/stylesheets/images 0 → 120000
... ... @@ -0,0 +1 @@
  1 +../images
0 2 \ No newline at end of file
... ...