whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: add more info (in particular, id)
Date Mon, 25 Nov 2019 14:37:34 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 5875c14  add more info (in particular, id)
5875c14 is described below

commit 5875c1499f10b398ebef73cca8a8eeb51858e123
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Mon Nov 25 09:36:24 2019 -0500

    add more info (in particular, id)
---
 www/racktest/config.ru | 15 ++++++++++++++-
 www/test.cgi           |  1 +
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/www/racktest/config.ru b/www/racktest/config.ru
index 463fbfb..eb5f72f 100644
--- a/www/racktest/config.ru
+++ b/www/racktest/config.ru
@@ -5,6 +5,19 @@ run lambda {|env|
   env.delete('PASSENGER_CONNECT_PASSWORD')
   env.delete('SECRET_KEY_BASE')
   env.delete('HTTP_AUTHORIZATION')
+
+  begin
+
+    data = {
+      id: `id`,
+      ruby: RbConfig.ruby,
+      ruby_version: RUBY_VERSION,
+      gem_version: Gem::VERSION,
+      env: env
+    }
   
-  [ 200, {'Content-Type' => 'text/plain'}, [JSON.pretty_generate(env)] ]
+    [ 200, {'Content-Type' => 'text/plain'}, [JSON.pretty_generate(data)] ]
+  rescue => e
+    [ 500, {'Content-Type' => 'text/plain'}, [e.to_s] ]
+  end
 }
diff --git a/www/test.cgi b/www/test.cgi
index 7ce2dfd..93cb4ef 100755
--- a/www/test.cgi
+++ b/www/test.cgi
@@ -22,6 +22,7 @@ end
 query = ENV['QUERY_STRING'] || ARGV[0]
 if query and not query.empty? and ENV['SCRIPT_URL'] == '/test.cgi'
     print "\n"
+    puts_system('id')
     puts_system('which','-a','svn')
     puts_system('svn','--version')
     puts_system('which','-a','ruby')


Mime
View raw message