You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2020/07/16 15:08:14 UTC

[whimsy] branch master updated: Simplify

This is an automated email from the ASF dual-hosted git repository.

sebb 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 92d2362  Simplify
92d2362 is described below

commit 92d2362f43d7a11fcf5db96620247ab5a05a09b0
Author: Sebb <se...@apache.org>
AuthorDate: Thu Jul 16 16:08:05 2020 +0100

    Simplify
---
 lib/whimsy/asf/documents.rb | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/whimsy/asf/documents.rb b/lib/whimsy/asf/documents.rb
index 532bdf7..5836b6b 100644
--- a/lib/whimsy/asf/documents.rb
+++ b/lib/whimsy/asf/documents.rb
@@ -118,12 +118,10 @@ module ASF
         downcase.gsub(' ','-').gsub(/[^a-z0-9-]+/,'') rescue nil
       id = person.id
       files = self.listnames(getDate).find_all do |file|
-        if getDate
-          # allow for missing epoch
-          stem = [file].pop.split('.')[0] # directories don't have a trailing /
-        else
-          stem = file.split('.')[0] # directories don't have a trailing /
+        if file.is_a?(Array) # we have [epoch, file]
+          file = file[1]
         end
+        stem = file.split('.')[0] # directories don't have a trailing /
         stem == id or stem == name
       end
       # Only valid if we match a single file or directory