whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curc...@apache.org
Subject [whimsy] branch json-editor updated: Fixup links and output
Date Thu, 25 May 2017 01:25:05 GMT
This is an automated email from the ASF dual-hosted git repository.

curcuru pushed a commit to branch json-editor
in repository https://gitbox.apache.org/repos/asf/whimsy.git

The following commit(s) were added to refs/heads/json-editor by this push:
       new  2d66840   Fixup links and output
2d66840 is described below

commit 2d668406701570b823344a04ca7980728ee9edfa
Author: Shane Curcuru <asf@shanecurcuru.org>
AuthorDate: Wed May 24 21:24:59 2017 -0400

    Fixup links and output
---
 www/test/dataflow.cgi | 47 +++++++++++++++++++++++++++++++----------------
 1 file changed, 31 insertions(+), 16 deletions(-)

diff --git a/www/test/dataflow.cgi b/www/test/dataflow.cgi
index 6a40d4c..b5a6c03 100644
--- a/www/test/dataflow.cgi
+++ b/www/test/dataflow.cgi
@@ -1,17 +1,19 @@
 #!/usr/bin/env ruby
-# Wvisible:tools Crawl data sources and emit /public related links
+PAGETITLE = 'Public Datafiles And Dependencies' # Wvisible:tools
+
 $LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
 require 'json'
 require 'whimsy/asf'
 require 'wunderbar'
 require 'wunderbar/bootstrap'
 
-PAGETITLE = 'Public Datafiles And Dependencies'
+DATAFLOWDATA = 'dataflow.json'
+GITWHIMSY = 'https://github.com/apache/whimsy/blob/master'
 
 _html do
   _body? do
     _whimsy_header PAGETITLE
-    deplist = JSON.parse(File.read('dataflow.json')) 
+    deplist = JSON.parse(File.read(DATAFLOWDATA)) 
     _whimsy_content do
       _p %{ Whimsy tools consume and produce a variety of data files 
         about PMCs and the ASF as a whole.  This non-comprehensive 
@@ -20,40 +22,53 @@ _html do
         of which are privately stored).
         }
 
-      _ul do
+      _ul.list_group do
         deplist.each do |dep, info|
-          _li do
-            _a '', name: dep
+          _li.list_group_item do
+            _a '', name: dep.gsub(/[#%\[\]\{\}\\"<>]/, '')
             if dep =~ /http/i then
-              _code do
-                _a File.basename(dep), href: dep
+              _code! do
+                _a! File.basename(dep), href: dep
               end
+            elsif dep =~ %r{\A/} then
+              _code! do
+                _a! dep, href: "#{GITWHIMSY}#{dep}"
+              end              
             else
-              _code dep
+              _code! dep
             end
-            _ info['description']
+            _ " #{info['description']}"
             _br
             if info['maintainer'] =~ %r{/} then
-              _span.text_muted "Maintained by: Whimsy PMC using script: #{info['maintainer']}"
+              _span.text_muted 'Maintained by: Whimsy PMC using script: '
+              _a.text_muted "#{info['maintainer']}", href: "#{GITWHIMSY}#{info['maintainer']}"
             else
-              _a.text_muted "Maintained by role/PMC: #{info['maintainer']}", href: "https://whimsy.apache.org/roster/orgchart/#{info['maintainer']}"
+              _span.text_muted 'Maintained by role/PMC: '
+              _a.text_muted "#{info['maintainer']}", href: "https://whimsy.apache.org/roster/orgchart/#{info['maintainer']}"
             end
             _br
             if info.key?('sources') then
+              _span 'Derived from:'
               _ul do
-                _span.text_muted 'Derived from:'
                 info['sources'].each do |src|
                   _li do 
-                    _a "#{src}", href: "##{src}"
+                    _a "#{src}", href: "##{src.gsub(/[#%\[\]\{\}\\"<>]/, '')}"
                   end
                 end
               end
-            else
-              _br # Add a little more space
             end
           end
         end
       end
+      
+      _p do 
+        _ "The #{DATAFLOWDATA} file is currently a manually maintained file where the hash
key identifies a file: "
+        _ul do
+          _li "Starting with 'http' means it's at a public URL"
+          _li "Starting with '/' means it's a path within whimsy repo"
+          _li "All other paths means it's an SVN/Git reference from repository.yml"
+        end
+      end
     end
   end
 end

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message