whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [1/1] Commit 81916f7: support writable CGI
Date Thu, 03 Mar 2016 15:31:38 GMT
Commit 81916f712ff1d0942cf2b61a3a08e9a121630911:
    support writable CGI


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
www/status/svn.cgi                                           | +++++ --
------------------------------------------------------------
7 changes: 5 additions, 2 deletions.
------------------------------------------------------------


diff --git a/www/status/svn.cgi b/www/status/svn.cgi
index 80de1a8..2e923b7 100755
--- a/www/status/svn.cgi
+++ b/www/status/svn.cgi
@@ -18,6 +18,8 @@ _html do
   _link rel: 'stylesheet', href: 'css/status.css'
   _img.logo src: '../whimsy.svg'
 
+  writable = true
+
   _h1_ 'SVN Repository Status'
 
   _table.table do
@@ -37,6 +39,7 @@ _html do
 
         if local
           rev = `svn info #{local}`[/^Revision: (.*)/, 1]
+          writable &&= File.writable?(local)
         else
           color = 'bg-danger'
         end
@@ -55,7 +58,7 @@ _html do
   end
 
   _script %{
-    var local = #{!!defined? Sinatra};
+    var local = #{writable};
 
     // update status of a row based on a sever response
     function updateStatus(tr, response) {
@@ -132,7 +135,7 @@ _json do
 end
 
 # standalone (local) support
-if __FILE__ == $0
+if __FILE__ == $0 and not ENV['GATEWAY_INTERFACE']
   require 'wunderbar/sinatra'
 
   get '/whimsy.svg' do

Mime
View raw message