whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curc...@apache.org
Subject [whimsy] branch styleallthethings updated: Semi-automated way to catalog different tools
Date Fri, 26 May 2017 15:13:35 GMT
This is an automated email from the ASF dual-hosted git repository.

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

The following commit(s) were added to refs/heads/styleallthethings by this push:
       new  7f9e56e   Semi-automated way to catalog different tools
7f9e56e is described below

commit 7f9e56e23d3536007fc1ac32d0edd74f6e502eb6
Author: Shane Curcuru <asf@shanecurcuru.org>
AuthorDate: Fri May 26 11:13:30 2017 -0400

    Semi-automated way to catalog different tools
---
 tools/wwwdocs.rb                        | 37 +++++++++++++++++++------------
 www/brand/list.cgi                      |  3 +--
 www/committers/assets/bootstrap-min.css |  6 ++---
 www/committers/assets/bootstrap-min.js  |  8 +++----
 www/committers/assets/jquery-min.js     |  8 +++----
 www/committers/moderationhelper.cgi     |  2 +-
 www/committers/subscribe.cgi            |  5 +++--
 www/committers/svn-info.cgi             |  1 +
 www/committers/test.cgi                 |  1 +
 www/committers/testauth.cgi             |  2 +-
 www/committers/tools.cgi                | 39 +++++++++++++++++++++++++++++++++
 www/events/other.cgi                    |  2 +-
 www/events/past.cgi                     |  2 +-
 www/events/talks.cgi                    |  2 +-
 www/incubator/maillist.cgi              |  2 ++
 www/incubator/moderators.cgi            |  1 +
 www/incubator/podlings/by-age.cgi       |  1 +
 www/incubator/signoff.cgi               |  1 +
 www/site.cgi                            |  2 +-
 www/test/dataflow.cgi                   |  2 +-
 www/test/test.cgi                       |  2 +-
 21 files changed, 92 insertions(+), 37 deletions(-)

diff --git a/tools/wwwdocs.rb b/tools/wwwdocs.rb
index 4c2bfef..c09af24 100755
--- a/tools/wwwdocs.rb
+++ b/tools/wwwdocs.rb
@@ -1,20 +1,29 @@
 #!/usr/bin/env ruby
-# Wvisible:tools Crawl scripts and emit homepage related links
+# Scan all /www scripts for WVisible PAGETITLE and categories
 $LOAD_PATH.unshift File.realpath(File.expand_path('../../lib', __FILE__))
-require 'json'
+SCANDIR = "../www"
+ISERR = '!'
 
- # TODO: crawl all tools that might be URLs under www
- # If there's a Wvisible line, store it's cat,egor,ies And long description
-startdir = '../www/test'
-
-homelinks = {}
-
-Dir["#{startdir}/*.cgi"].each do |f|
-  File.open(f).each_line.map(&:chomp).each do |line|
-    if line =~ /^\#\sWvisible\:(.*?)\s+(.*)/i then
-      line = [$1.split(','), $2]
-      homelinks[f] = line # TODO make paths relative for easy _a output
+# Return [PAGETITLE, [cat,egories] ] after WVisible; or same as !Bogosity error
+def scanfile(f)
+  begin
+    File.open(f).each_line.map(&:chomp).each do |line|
+      if line =~ /\APAGETITLE\s?=\s?"([^"]+)"\s?#\s?WVisible:(.*)/i then
+        return [$1, $2.chomp.split(%r{[\s,]})]
+      end
     end
+    return nil
+  rescue Exception => e
+    return ["!Bogosity! #{e.message[0..255]}", "\t#{e.backtrace.join("\n\t")}"]
+  end
+end
+
+# Return data only about WVisible cgis, plus any errors
+def scandir(dir)
+  links = {}
+  Dir["#{dir}/**/*.cgi".untaint].each do |f|
+    l = scanfile(f.untaint)
+    links[f.sub(dir, '')] = l if l
   end
+  return links
 end
-puts JSON.pretty_generate homelinks
diff --git a/www/brand/list.cgi b/www/brand/list.cgi
index 1784dcc..a5e60cb 100755
--- a/www/brand/list.cgi
+++ b/www/brand/list.cgi
@@ -1,6 +1,5 @@
 #!/usr/bin/env ruby
-# Wvisible:brand,trademarks
-PAGETITLE = 'Listing of Apache Trademarks'
+PAGETITLE = "Listing of Apache Trademarks" # Wvisible:brand,trademarks
 
 $LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
 require 'csv'
diff --git a/www/committers/assets/bootstrap-min.css b/www/committers/assets/bootstrap-min.css
index 4cf729e..ed3905e 100644
--- a/www/committers/assets/bootstrap-min.css
+++ b/www/committers/assets/bootstrap-min.css
@@ -1,6 +1,6 @@
 /*!
- * Bootstrap v3.3.6 (http://getbootstrap.com)
- * Copyright 2011-2015 Twitter, Inc.
+ * Bootstrap v3.3.7 (http://getbootstrap.com)
+ * Copyright 2011-2016 Twitter, Inc.
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr
[...]
+ *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr
[...]
 /*# sourceMappingURL=bootstrap.min.css.map */
\ No newline at end of file
diff --git a/www/committers/assets/bootstrap-min.js b/www/committers/assets/bootstrap-min.js
index e79c065..9bcd2fc 100644
--- a/www/committers/assets/bootstrap-min.js
+++ b/www/committers/assets/bootstrap-min.js
@@ -1,7 +1,7 @@
 /*!
- * Bootstrap v3.3.6 (http://getbootstrap.com)
- * Copyright 2011-2015 Twitter, Inc.
+ * Bootstrap v3.3.7 (http://getbootstrap.com)
+ * Copyright 2011-2016 Twitter, Inc.
  * Licensed under the MIT license
  */
-if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use
strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>2)throw
new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than
version 3")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"
[...]
-d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var
d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return
a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var
b=a(this);c.call(b,b.data()) [...]
\ No newline at end of file
+if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use
strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw
new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than
version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"
[...]
+this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var
d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return
 [...]
\ No newline at end of file
diff --git a/www/committers/assets/jquery-min.js b/www/committers/assets/jquery-min.js
index e6a051d..644d35e 100644
--- a/www/committers/assets/jquery-min.js
+++ b/www/committers/assets/jquery-min.js
@@ -1,4 +1,4 @@
-/*! jQuery v1.11.2 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
-!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw
new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof
window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.2",m=function(a,b){return
new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b
[...]
-return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void
0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof
b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void
0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}fu
[...]
-}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var
a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var
b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(
[...]
+/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */
+!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw
new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof
window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function
p(a,b){b=b||d;var c=b.createElem [...]
+a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var
T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h
in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return
j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d: [...]
+null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var
c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var
c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return
b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var
c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();r [...]
diff --git a/www/committers/moderationhelper.cgi b/www/committers/moderationhelper.cgi
index 48596b8..4068572 100755
--- a/www/committers/moderationhelper.cgi
+++ b/www/committers/moderationhelper.cgi
@@ -1,3 +1,3 @@
 #!/usr/bin/env ruby
-
+PAGETITLE = "Mail List Moderation Helper" # Wvisible:mail moderation
 require "../../tools/moderationhelper.rb"
diff --git a/www/committers/subscribe.cgi b/www/committers/subscribe.cgi
index 06dedc7..0e62881 100755
--- a/www/committers/subscribe.cgi
+++ b/www/committers/subscribe.cgi
@@ -1,4 +1,5 @@
 #!/usr/bin/env ruby
+PAGETITLE = "ASF Mailing List Self-subscription" # Wvisible:mail subscribe
 $LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
 require 'wunderbar'
 require 'wunderbar/bootstrap'
@@ -40,7 +41,7 @@ _html do
   _script src: 'assets/bootstrap-select.js'
   _link rel: 'stylesheet', href: 'assets/bootstrap-select.css'
   _body? do
-    _whimsy_header 'ASF Mailing List Self-subscription'
+    _whimsy_header PAGETITLE
     _whimsy_content do
       _div.row do
         _div.panel.panel_primary do
@@ -58,7 +59,7 @@ _html do
       
       _form method: 'post' do
         _fieldset do
-          _legend 'ASF Mailing List Self-subscription'                
+          _legend PAGETITLE
           _label 'Subscribe'
           _select name: 'addr' do
             addrs.each do |addr|
diff --git a/www/committers/svn-info.cgi b/www/committers/svn-info.cgi
index 5cb2a7b..033f8f9 100755
--- a/www/committers/svn-info.cgi
+++ b/www/committers/svn-info.cgi
@@ -1,4 +1,5 @@
 #!/usr/bin/env ruby
+PAGETITLE = "Subversion Info Helper" # Wvisible:tools svn
 $LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
 require 'wunderbar'
 require 'wunderbar/bootstrap'
diff --git a/www/committers/test.cgi b/www/committers/test.cgi
index f3d862e..74cd88d 100755
--- a/www/committers/test.cgi
+++ b/www/committers/test.cgi
@@ -1,4 +1,5 @@
 #!/usr/bin/env ruby
+PAGETITLE = "Whimsy Environment Tester" # Wvisible:debug
 # __dir__ requires 2.0
 #load "#{__dir__}/../test.cgi" 
 load File.expand_path('../../test.cgi',__FILE__)
diff --git a/www/committers/testauth.cgi b/www/committers/testauth.cgi
index 609418e..2d33684 100755
--- a/www/committers/testauth.cgi
+++ b/www/committers/testauth.cgi
@@ -1,5 +1,5 @@
 #!/usr/bin/env ruby
-
+PAGETITLE = "Board Agenda Auth Tester" # Wvisible:agenda debug
 #
 # Small CGI to help debug board agenda authentication issues
 #
diff --git a/www/committers/tools.cgi b/www/committers/tools.cgi
new file mode 100755
index 0000000..040baf1
--- /dev/null
+++ b/www/committers/tools.cgi
@@ -0,0 +1,39 @@
+#!/usr/bin/env ruby
+PAGETITLE = "Listing Of Whimsy Tools" # Wvisible:tools
+
+$LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
+require 'json'
+require 'whimsy/asf'
+require 'wunderbar'
+require 'wunderbar/bootstrap'
+require '../../tools/wwwdocs.rb'
+
+_html do
+  _body? do
+    _whimsy_body2 title: PAGETITLE, related: {
+      "https://projects.apache.org/" => "Learn About Apache Projects",
+      "https://community.apache.org/" => "Get Community Help",
+      "https://github.com/apache/whimsy/" => "Read The Whimsy Code"
+    } do
+      scan = scandir("../#{SCANDIR}") # TODO Should be a static generated file
+      scan.reject{ |k, v| v[1] =~ /\A#{ISERR}/ }
+        .group_by{ |k, v| v[1][0] }
+        .each do | category, links |
+        _ul.list_group do
+          _li.list_group_item.active do
+            _ category.capitalize
+          end
+          links.each do |l, desc|
+            _li.list_group_item do
+              _a "#{desc[0]}", href: l
+              _ ' - '
+              _code! do
+                _a "#{l}", href: l
+              end
+            end
+          end
+        end
+      end
+    end
+  end
+end
diff --git a/www/events/other.cgi b/www/events/other.cgi
index 1c611af..5aa0a63 100755
--- a/www/events/other.cgi
+++ b/www/events/other.cgi
@@ -1,5 +1,5 @@
 #!/usr/bin/env ruby
-PAGETITLE = 'Other FOSS Conference Listings' # Wvisible:events
+PAGETITLE = "Other FOSS Conference Listings" # Wvisible:events
 
 $LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
 require 'json'
diff --git a/www/events/past.cgi b/www/events/past.cgi
index 0ee8855..a084343 100755
--- a/www/events/past.cgi
+++ b/www/events/past.cgi
@@ -1,5 +1,5 @@
 #!/usr/bin/env ruby
-PAGETITLE = 'ApacheCon Historical Listing' # Wvisible:apachecon
+PAGETITLE = "ApacheCon Historical Listing" # Wvisible:apachecon
 
 $LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
 require 'csv'
diff --git a/www/events/talks.cgi b/www/events/talks.cgi
index 6d2eace..aa30d31 100755
--- a/www/events/talks.cgi
+++ b/www/events/talks.cgi
@@ -1,5 +1,5 @@
 #!/usr/bin/env ruby
-PAGETITLE = 'Apache Related Talks Listing' # Wvisible:events
+PAGETITLE = "Apache Related Talks Listing" # Wvisible:events
 
 $LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
 require 'json'
diff --git a/www/incubator/maillist.cgi b/www/incubator/maillist.cgi
index 43a2a26..f191cf1 100755
--- a/www/incubator/maillist.cgi
+++ b/www/incubator/maillist.cgi
@@ -1,4 +1,6 @@
 #!/usr/bin/env ruby
+PAGETITLE = "Incubator Podling Mailing Lists" # Wvisible:incubator mail
+
 $LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
 
 require 'whimsy/asf'
diff --git a/www/incubator/moderators.cgi b/www/incubator/moderators.cgi
index 6adfc3d..72f3c36 100755
--- a/www/incubator/moderators.cgi
+++ b/www/incubator/moderators.cgi
@@ -1,4 +1,5 @@
 #!/usr/bin/env ruby
+PAGETITLE = "Incubator Mailing List Moderators" # Wvisible:incubator mail
 
 $LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
 require 'wunderbar'
diff --git a/www/incubator/podlings/by-age.cgi b/www/incubator/podlings/by-age.cgi
index 6e7ff5d..a750e21 100755
--- a/www/incubator/podlings/by-age.cgi
+++ b/www/incubator/podlings/by-age.cgi
@@ -1,4 +1,5 @@
 #!/usr/bin/env ruby
+PAGETITLE = "Incubator Podlings By Age" # Wvisible:incubator historical
 require 'nokogiri'
 require 'date'
 require 'net/http'
diff --git a/www/incubator/signoff.cgi b/www/incubator/signoff.cgi
index 4311582..4d1b87a 100755
--- a/www/incubator/signoff.cgi
+++ b/www/incubator/signoff.cgi
@@ -1,4 +1,5 @@
 #!/usr/bin/env ruby
+PAGETITLE = "Incubator Mentor Signoffs" # Wvisible:incubator
 
 # quick and dirty script to tally up which mentors have been providing
 # signoffs and which have not.
diff --git a/www/site.cgi b/www/site.cgi
index 5f38b6c..62b2fb6 100755
--- a/www/site.cgi
+++ b/www/site.cgi
@@ -13,7 +13,7 @@ require 'json'
 require 'net/http'
 require 'time' # for httpdate
 
-PAGETITLE = 'Apache TLP Website Link Checks'
+PAGETITLE = "Apache TLP Website Link Checks" # Wvisible:sites,brand
 cols = %w( uri events foundation license sponsorship security thanks copyright trademarks
)
 CHECKS = { 
   'uri'         => %r{https?://[^.]+\.apache\.org},
diff --git a/www/test/dataflow.cgi b/www/test/dataflow.cgi
index 35f8d60..0ee0007 100755
--- a/www/test/dataflow.cgi
+++ b/www/test/dataflow.cgi
@@ -1,5 +1,5 @@
 #!/usr/bin/env ruby
-PAGETITLE = 'Public Datafiles And Dependencies' # Wvisible:tools
+PAGETITLE = "Public Datafiles And Dependencies" # Wvisible:tools,data
 
 $LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
 require 'json'
diff --git a/www/test/test.cgi b/www/test/test.cgi
index 02cdaa2..f28b1d0 100755
--- a/www/test/test.cgi
+++ b/www/test/test.cgi
@@ -1,5 +1,5 @@
 #!/usr/bin/env ruby
-PAGETITLE = 'Example Whimsy Script With Styles' # Wvisible:tools
+PAGETITLE = "Example Whimsy Script With Styles" # Wvisible:tools Note: PAGETITLE must be
double quoted
 
 $LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
 require 'json'

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

Mime
View raw message