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 c0304c8b Fix up resolution parsing; also add TLP setting
c0304c8b is described below

commit c0304c8b2925b0b5bd0f7f3024c1ce1602359a59
Author: Sebb <[email protected]>
AuthorDate: Wed Aug 30 23:04:38 2023 +0100

    Fix up resolution parsing; also add TLP setting
---
 lib/whimsy/asf/podling.rb | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/lib/whimsy/asf/podling.rb b/lib/whimsy/asf/podling.rb
index 56cba388..5ed4fba6 100644
--- a/lib/whimsy/asf/podling.rb
+++ b/lib/whimsy/asf/podling.rb
@@ -50,6 +50,9 @@ module ASF
     # <resolution url="">, from podlings.xml
     attr_accessor  :resolutionURL
 
+    # <resolution tlp="">, from podlings.xml
+    attr_accessor  :resolutionTLP
+
     # create a podling from a Nokogiri node built from podlings.xml
     def initialize(node)
       @mtime = nil
@@ -71,8 +74,16 @@ module ASF
       @reporting = node.at('reporting') || nil # ensure variable is defined
       @monthly = @reporting&.text&.split(/,\s*/)
 
-      @resolutionLink = node.at('resolution') ? node.at('resolution')['link'] 
: nil
-      @resolutionURL = node.at('resolution') ? node.at('resolution')['url'] : 
nil
+      res = node.at('resolution')
+      if res
+        @resolutionLink = res.attr('link')
+        @resolutionURL = res.attr('url')
+        @resolutionTLP = res.attr('tlp')
+      else
+        @resolutionLink = nil
+        @resolutionURL = nil
+        @resolutionTLP = nil
+      end
 
       # Note: the following optional elements are not currently processed:
       # - resolution (except for resolution/@link)
@@ -384,6 +395,7 @@ module ASF
       hash[:podlingStatus] = podlingStatus
       hash[:resolutionLink] = resolutionLink if resolutionLink
       hash[:resolutionURL] = resolutionURL if resolutionURL
+      hash[:resolutionTLP] = resolutionTLP if resolutionTLP
       hash
     end
 

Reply via email to