whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Bazley <s...@apache.org>
Subject [whimsy.git] [1/1] Commit 3d7d8af: Simplify by using json_common
Date Tue, 16 Feb 2016 01:23:46 GMT
Commit 3d7d8af88265319bfa4ef16820364a0b32640fdb:
    Simplify by using json_common


Branch: refs/heads/master
Author: Sebb <sebb@apache.org>
Committer: Sebb <sebb@apache.org>
Pusher: sebb <sebb@apache.org>

------------------------------------------------------------
www/roster/public_icla_info.rb                               | + -------
------------------------------------------------------------
31 changes: 3 additions, 28 deletions.
------------------------------------------------------------


diff --git a/www/roster/public_icla_info.rb b/www/roster/public_icla_info.rb
index 3529364..0c37ef4 100644
--- a/www/roster/public_icla_info.rb
+++ b/www/roster/public_icla_info.rb
@@ -1,28 +1,6 @@
-require 'bundler/setup'
+# Extract public data from iclas.txt
 
-require 'whimsy/asf'
-
-GEMVERSION = Gem.loaded_specs['whimsy-asf'].version.to_s rescue nil
-  # rescue is to allow for running with local library rather than a Gem
-
-# parse arguments for output file name
-if ARGV.length == 0 or ARGV.first == '-'
-  output = STDOUT
-else
-  # exit quickly if there has been no change
-  if File.exist? ARGV.first
-    source = "#{ASF::SVN['private/foundation/officers']}/iclas.txt"
-    lib = File.expand_path('../../../lib', __FILE__)
-    mtime = Dir["#{lib}/**/*"].map {|file| File.mtime(file)}.max
-    mtime = [mtime, File.mtime(source), File.mtime(__FILE__)].max
-    if File.mtime(ARGV.first) >= mtime
-      previous_results = JSON.parse(File.read ARGV.first) rescue {}
-      exit 0 if previous_results['gem_version'] == GEMVERSION
-    end
-  end
-
-  output = File.open(ARGV.first, 'w')
-end
+require_relative 'public_json_common'
 
 # gather icla info
 ids = {}
@@ -38,11 +16,8 @@
 
 info = {
   last_updated: ASF::ICLA.svn_change,
-  gem_version: GEMVERSION,
   committers: ids.sort,
   non_committers: noid # do not sort because the input is already sorted by surname
 }
 
-# output results
-output.puts JSON.pretty_generate(info)
-output.close
+public_json_output(info)

Mime
View raw message