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 d5e549df Ensure directories have trailing / when dates requested
d5e549df is described below

commit d5e549df0a0f094b039a2da714e424bb4987ed1a
Author: Sebb <[email protected]>
AuthorDate: Thu Sep 12 17:58:07 2024 +0100

    Ensure directories have trailing / when dates requested
---
 lib/whimsy/asf/svn.rb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/whimsy/asf/svn.rb b/lib/whimsy/asf/svn.rb
index ab4c7839..882dcb73 100644
--- a/lib/whimsy/asf/svn.rb
+++ b/lib/whimsy/asf/svn.rb
@@ -307,8 +307,11 @@ module ASF
           require 'nokogiri'
           xml_doc = Nokogiri::XML(xmlstring)
           xml_doc.css('entry').each do |entry|
+            kind = entry.attr('kind')
             date = entry.css('date').text
-            list << [entry.css('name').text, date, 
Time.parse(date).strftime('%s').to_i]
+            name = entry.css('name').text
+            name += '/' if kind == 'dir'
+            list << [name, date, Time.parse(date).strftime('%s').to_i]
           end
         end
       else

Reply via email to