Commit 534114b8a75a24a07011858db1f6f6fd66805c6a
Committed by
Daniela Feitosa
1 parent
1fda9d30
Exists in
master
and in
29 other branches
Fix plugin asset caching for Debian package
(i.e. for the case in which public/ is not writable) (ActionItem2314) Signed-off-by: Daniela Soares Feitosa <danielafeitosa@colivre.coop.br>
Showing
3 changed files
with
7 additions
and
6 deletions
Show diff stats
app/views/layouts/application-ng.rhtml
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | <% | 15 | <% |
16 | plugins_stylesheets = @plugins.select(&:stylesheet?).map { |plugin| plugin.class.public_path('style.css') } | 16 | plugins_stylesheets = @plugins.select(&:stylesheet?).map { |plugin| plugin.class.public_path('style.css') } |
17 | %> | 17 | %> |
18 | - <%= stylesheet_link_tag(plugins_stylesheets, :cache => 'cache-plugins-style-' + Digest::MD5.hexdigest(plugins_stylesheets.to_s)) unless plugins_stylesheets.empty? %> | 18 | + <%= stylesheet_link_tag(plugins_stylesheets, :cache => 'cache/plugins-' + Digest::MD5.hexdigest(plugins_stylesheets.to_s)) unless plugins_stylesheets.empty? %> |
19 | <%= stylesheet_link_tag theme_stylesheet_path %> | 19 | <%= stylesheet_link_tag theme_stylesheet_path %> |
20 | 20 | ||
21 | <%# Add custom tags/styles/etc via content_for %> | 21 | <%# Add custom tags/styles/etc via content_for %> |
@@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
24 | <% | 24 | <% |
25 | plugins_javascripts = @plugins.map { |plugin| plugin.js_files.map { |js| plugin.class.public_path(js) } }.flatten | 25 | plugins_javascripts = @plugins.map { |plugin| plugin.js_files.map { |js| plugin.class.public_path(js) } }.flatten |
26 | %> | 26 | %> |
27 | - <%= javascript_include_tag(plugins_javascripts, :cache => 'cache-plugins-js-' + Digest::MD5.hexdigest(plugins_javascripts.to_s)) unless plugins_javascripts.empty? %> | 27 | + <%= javascript_include_tag(plugins_javascripts, :cache => 'cache/plugins-' + Digest::MD5.hexdigest(plugins_javascripts.to_s)) unless plugins_javascripts.empty? %> |
28 | <%= | 28 | <%= |
29 | @plugins.dispatch(:head_ending).collect do |content| | 29 | @plugins.dispatch(:head_ending).collect do |content| |
30 | content.respond_to?(:call) ? content.call : content | 30 | content.respond_to?(:call) ? content.call : content |
debian/noosfero.links
@@ -13,6 +13,8 @@ var/lib/noosfero-data/cache/cache-chat.js usr/share/noosfero/public/ja | @@ -13,6 +13,8 @@ var/lib/noosfero-data/cache/cache-chat.js usr/share/noosfero/public/ja | ||
13 | var/lib/noosfero-data/cache/cache-slideshow.js usr/share/noosfero/public/javascripts/cache-slideshow.js | 13 | var/lib/noosfero-data/cache/cache-slideshow.js usr/share/noosfero/public/javascripts/cache-slideshow.js |
14 | var/lib/noosfero-data/cache/cache.css usr/share/noosfero/public/stylesheets/cache.css | 14 | var/lib/noosfero-data/cache/cache.css usr/share/noosfero/public/stylesheets/cache.css |
15 | var/lib/noosfero-data/cache/cache-media-listing.css usr/share/noosfero/public/stylesheets/cache-media-listing.css | 15 | var/lib/noosfero-data/cache/cache-media-listing.css usr/share/noosfero/public/stylesheets/cache-media-listing.css |
16 | +var/lib/noosfero-data/cache usr/share/noosfero/public/javascripts/cache | ||
17 | +var/lib/noosfero-data/cache usr/share/noosfero/public/stylesheets/cache | ||
16 | var/lib/noosfero-data/public/articles usr/share/noosfero/public/articles | 18 | var/lib/noosfero-data/public/articles usr/share/noosfero/public/articles |
17 | var/lib/noosfero-data/public/image_uploads usr/share/noosfero/public/image_uploads | 19 | var/lib/noosfero-data/public/image_uploads usr/share/noosfero/public/image_uploads |
18 | var/lib/noosfero-data/public/thumbnails usr/share/noosfero/public/thumbnails | 20 | var/lib/noosfero-data/public/thumbnails usr/share/noosfero/public/thumbnails |
script/production
@@ -17,12 +17,11 @@ fi | @@ -17,12 +17,11 @@ fi | ||
17 | clear_cache() { | 17 | clear_cache() { |
18 | if test -w ./public; then | 18 | if test -w ./public; then |
19 | echo "Cleaning cache files" | 19 | echo "Cleaning cache files" |
20 | - rm -f ./public/javascripts/cache-*.js | ||
21 | - rm -f ./public/stylesheets/cache.css | 20 | + rm -rf ./public/javascripts/cache* |
21 | + rm -rf ./public/stylesheets/cache* | ||
22 | elif [ ! -z "$NOOSFERO_DATA_DIR" ] && [ -w "$NOOSFERO_DATA_DIR" ]; then | 22 | elif [ ! -z "$NOOSFERO_DATA_DIR" ] && [ -w "$NOOSFERO_DATA_DIR" ]; then |
23 | echo "Cleaning cache files" | 23 | echo "Cleaning cache files" |
24 | - rm -f $NOOSFERO_DATA_DIR/cache/cache-*.js | ||
25 | - rm -f $NOOSFERO_DATA_DIR/cache/cache.css | 24 | + rm -rf "$NOOSFERO_DATA_DIR"/cache/* |
26 | fi | 25 | fi |
27 | } | 26 | } |
28 | 27 |