whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curc...@apache.org
Subject [whimsy] branch master updated: Hack to use static data for demo/beta of UI
Date Wed, 24 May 2017 15:21:49 GMT
This is an automated email from the ASF dual-hosted git repository.

curcuru 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  a073d1c   Hack to use static data for demo/beta of UI
a073d1c is described below

commit a073d1c6d27e04f39587eeb78698aaa4d041f753
Author: Shane Curcuru <asf@shanecurcuru.org>
AuthorDate: Wed May 24 11:21:46 2017 -0400

    Hack to use static data for demo/beta of UI
---
 tools/comdevtalks.rb | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/tools/comdevtalks.rb b/tools/comdevtalks.rb
index de71cd3..36b7594 100644
--- a/tools/comdevtalks.rb
+++ b/tools/comdevtalks.rb
@@ -11,15 +11,15 @@ COMDEVTALKS = 'https://svn.apache.org/repos/asf/comdev/site/trunk/content/speake
 COMDEVDIR = '/Users/curcuru/src/comdev/site/trunk/content/speakers/talks/' # *.yaml
 
 # Parse all talks and submitters
-def parse_talks(dir)
+def parse_talks(dir = "#{COMDEVDIR}")
   talks = {}
   submitters = {}
   Dir[File.join("#{dir}", "*.yaml")].each do |fname|
     begin
       if fname =~ /_/
-        talks["#{File.basename(fname, ".*")}"] = YAML.load(File.read(fname))
+        talks["#{File.basename(fname, ".*")}"] = YAML.load(File.read(fname.untaint))
       else
-        submitters["#{File.basename(fname, ".*")}"] = YAML.load(File.read(fname))
+        submitters["#{File.basename(fname, ".*")}"] = YAML.load(File.read(fname.untaint))
       end
     rescue Exception => e
       puts "Bogosity! analyzing #{fname} raised #{e.message[0..255]}"
@@ -30,6 +30,17 @@ def parse_talks(dir)
   return talks, submitters
 end
 
+# Abstract how cgi gets data
+def get_talks_submitters()
+  # return parse_talks
+  # HACK static data until we have generated public/ or other format
+  talks = {"Apache_Way_2017"=>{"title"=>"Apache Way: Effective Open Source Project
Management", "teaser"=>"Learn how to manage long-lived diverse open source project communities
by following the behaviors of the Apache Way.", "submitter"=>"curcuru", "speakers"=>["curcuru"],
"abstract"=>"The \"Apache Way\" is the process by which Apache Software Foundation projects
are managed. It has evolved 18 years and has produced over 170 highly successful open source
Apache projects. But what is it  [...]
+
+  submitters = {"curcuru"=>{"name"=>"Shane Curcuru", "website"=>"http://communityovercode.com/",
"twitter"=>"shanecurcuru", "facebook"=>nil, "bio"=>"Shane has been involved at the
Apache Software Foundation (ASF) since 1999, and serves as Director and VP of Brand Management,
setting trademark policies and helping all 200+ Apache projects implement and defend their
brands.\n\nOtherwise, Shane is: a father and husband, a friend, a geek, a Member of the ASF,
a baker, and a punny guy.  Oh, a [...]
+  
+  return talks, submitters
+end
+
 # ## ### #### ##### ######
 # Main method for command line use
 if __FILE__ == $PROGRAM_NAME
@@ -43,5 +54,7 @@ if __FILE__ == $PROGRAM_NAME
   File.open(outfile, "w") do |f|
     f.puts JSON.pretty_generate(results)
   end
+  puts talks
   puts "END: Thanks for running, see #{outfile}"
+  puts submitters
 end

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

Mime
View raw message