# HG changeset patch # User Chris Cannam # Date 1297441315 0 # Node ID 292cde42265adf95e55cfa772e1f506682ed1fbf # Parent 1e55195bca45f1da94e1ac72028bffd6ec0d1fa9 * Enable Embedded on projects that have new documentation diff -r 1e55195bca45 -r 292cde42265a config/routes.rb --- a/config/routes.rb Mon Feb 07 16:46:28 2011 +0000 +++ b/config/routes.rb Fri Feb 11 16:21:55 2011 +0000 @@ -236,7 +236,7 @@ map.with_options :controller => 'sys' do |sys| sys.connect 'sys/projects.:format', :action => 'projects', :conditions => {:method => :get} sys.connect 'sys/projects/:id/repository.:format', :action => 'create_project_repository', :conditions => {:method => :post} - sys.connect 'sys/projects/:id/embedded.:format', :action => 'set_embedded_active', :conditions => { :method => :get } #todo: should be post + sys.connect 'sys/projects/:id/embedded.:format', :action => 'set_embedded_active', :conditions => { :method => :post } end # Install the default route as the lowest priority. diff -r 1e55195bca45 -r 292cde42265a extra/soundsoftware/extract-docs.sh --- a/extra/soundsoftware/extract-docs.sh Mon Feb 07 16:46:28 2011 +0000 +++ b/extra/soundsoftware/extract-docs.sh Fri Feb 11 16:21:55 2011 +0000 @@ -8,6 +8,11 @@ hgdir="/var/hg" docdir="/var/doc" +apikey="" +apihost="" +apiuser="" +apipass="" + progdir=$(dirname $0) case "$progdir" in /*) ;; @@ -23,6 +28,16 @@ fi done +enable_embedded() +{ + p="$1" + if [ -n "$apiuser" ]; then + curl -u "$apiuser":"$apipass" "http://$apihost/sys/projects/$p/embedded.xml?enable=1&key=$apikey" -d "" + else + curl "http://$apihost/sys/projects/$p/embedded.xml?enable=1&key=$apikey" -d "" + fi +} + for projectdir in "$hgdir"/* ; do if [ -d "$projectdir" ] && [ -d "$projectdir/.hg" ]; then @@ -59,6 +74,7 @@ # # If we have just written something to a doc directory that was # # previously empty, we should switch on Embedded for this project echo "This project hasn't had doc extracted before -- I should switch on Embedded for it at this point" + enable_embedded "$project" fi if [ -d "$targetdir" ]; then