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 2296866  Lint
     new 1d7b08c  Merge branch 'master' of 
https://gitbox.apache.org/repos/asf/whimsy
2296866 is described below

commit 2296866eadbec793cb3f4f4604d01e2448d7eb17
Author: Sebb <s...@apache.org>
AuthorDate: Tue Mar 29 17:23:24 2022 +0100

    Lint
---
 lib/spec/lib/svn_spec.rb  |  8 ++++----
 lib/whimsy/asf/podling.rb | 12 +++++-------
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/lib/spec/lib/svn_spec.rb b/lib/spec/lib/svn_spec.rb
index 10bc1e8..b5a3785 100644
--- a/lib/spec/lib/svn_spec.rb
+++ b/lib/spec/lib/svn_spec.rb
@@ -264,7 +264,7 @@ describe ASF::SVN do
 
     it "svn('info', path) should return 'Name: path'" do
       repo = File.join(ASF::SVN.svnurl('attic-xdocs'),'_template.xml')
-      out, err = ASF::SVN.svn('info',repo)
+      out, _err = ASF::SVN.svn('info',repo)
       expect(out).to match(/^Name: _template.xml$/)
     end
     it "svn('info', [path]) should return 'Name: path'" do
@@ -405,15 +405,15 @@ describe ASF::SVN do
   describe "ASF::SVN.getlisting" do
     set_svnroot # need local test data here
     it "getlisting('emeritus') returns array of 1" do
-      tag,list = ASF::SVN.getlisting('emeritus')
+      _tag, list = ASF::SVN.getlisting('emeritus')
       expect(list).to eq(['emeritus1.txt'])
     end
     it "getlisting('emeritus-requests-received') returns array of 1" do
-      tag,list = ASF::SVN.getlisting('emeritus-requests-received')
+      _tag, list = ASF::SVN.getlisting('emeritus-requests-received')
       expect(list).to eq(['emeritus3.txt'])
     end
     it "getlisting('emeritus-requests-received,nil,true,true') returns array 
of [epoch,name]" do
-      tag,list = 
ASF::SVN.getlisting('emeritus-requests-received',nil,true,true)
+      _tag, list = 
ASF::SVN.getlisting('emeritus-requests-received',nil,true,true)
       expect(list).to eq([['1594814364','emeritus3.txt']])
     end
   end
diff --git a/lib/whimsy/asf/podling.rb b/lib/whimsy/asf/podling.rb
index 812acbb..4bf90ff 100644
--- a/lib/whimsy/asf/podling.rb
+++ b/lib/whimsy/asf/podling.rb
@@ -31,9 +31,6 @@ module ASF
     # userid of the champion, from podlings.xml
     attr_accessor  :champion
 
-    # list of months in the normal reporting schedule for this podling.
-    attr_accessor  :reporting
-
     # if reporting monthly, a list of months reports are expected.  Can also
     # ge <tt>nil</tt> or an empty list.  From podlings.xml.
     attr_accessor  :monthly
@@ -55,6 +52,7 @@ module ASF
 
     # create a podling from a Nokogiri node built from podlings.xml
     def initialize(node)
+      @mtime = nil
       @name = node['name']
       @resource = node['resource']
       # Validate resource for later use resource can contain '-' and '.' 
(lucene.net)
@@ -70,11 +68,11 @@ module ASF
       @mentors = node.search('mentor').map { |mentor| mentor['username'] }
       @champion = node.at('champion')['availid'] if node.at('champion')
 
-      @reporting = node.at('reporting') if node.at('reporting')
-      @monthly = @reporting.text.split(/,\s*/) if @reporting&.text
+      @reporting = node.at('reporting') || nil # ensure variable is defined
+      @monthly = @reporting&.text&.split(/,\s*/)
 
-      @resolutionLink = node.at('resolution')['link'] if node.at('resolution')
-      @resolutionURL = node.at('resolution')['url'] if node.at('resolution')
+      @resolutionLink = node.at('resolution') ? node.at('resolution')['link'] 
: nil
+      @resolutionURL = node.at('resolution') ? node.at('resolution')['url'] : 
nil
 
       # Note: the following optional elements are not currently processed:
       # - resolution (except for resolution/@link)

Reply via email to