Handle jammit by precaching in script/server.

This introduces some jammit warnings in 'rake spec'. These seem
to be just warnings. To get rid of them, take steps as described in
https://github.com/diaspora/diaspora/wiki/Installing-and-Running-Diaspora
in the "Read-only Installation" (sic!) chapter.
This commit is contained in:
Alec Leamas 2010-11-20 18:32:40 +01:00
parent 194373ff70
commit b6648cb9e2
3 changed files with 13 additions and 14 deletions

View file

@ -1,3 +1,4 @@
package: always
javascripts:
flash_socket:
- public/javascripts/vendor/FABridge.js
@ -19,14 +20,14 @@ javascripts:
- public/javascripts/vendor/mailchimp/jquery.form.js
- public/javascripts/vendor/mailchimp/jquery.validate.js
- public/javascripts/vendor/mailchimp/jquery126.min.js
photo:
- public/javascripts/photo.js
- public/javascripts/image-picker.js
aspects:
- public/javascripts/vendor/jquery-ui-1.8.6.custom.min.js
- public/javascripts/aspect-edit.js
stylesheets:
default:
- public/stylesheets/application.css

View file

@ -48,6 +48,16 @@ if [ ! -e public/source.tar.gz ]; then
exit 65
fi
# Precache jammit assets
if [ -w public ]; then
bundle exec jammit
fi
if [ ! -e 'public/assets/main.js.gz' ]; then
echo 'Jammit precache error (now or at install)' >&2
exit 66
fi
mkdir -p -v log/thin/
bundle exec ruby ./script/websocket_server.rb&
bundle exec magent start --log-path=log/ &

View file

@ -41,20 +41,8 @@ def process_message
end
end
def package_js
require 'jammit'
begin
Jammit.package!
rescue => e
puts "Error minifying assets, but server will continue starting normally."
puts e.inspect
end
end
begin
EM.run {
package_js
Diaspora::WebSocket.initialize_channels
socket_params = { :host => APP_CONFIG[:socket_host],