sebb wrote on 5/11/18 11:18 AM:
> On 11 May 2018 at 14:58, Sam Ruby <[email protected]> wrote:
>> On Fri, May 11, 2018 at 9:05 AM, Shane Curcuru <[email protected]> wrote:
>>> Macbook:tools curcuru$ ruby ./site-scan.rb sites.json pods.json
>>>
>>> ~/src/whimsy/lib/whimsy/asf/committee.rb:428:in `pmcs': undefined method
>>> `-' for nil:NilClass (NoMethodError)
>>>         from ./site-scan.rb:198:in `<main>'
>>>
>>> Help?  Is this related to the issue with the whimsy asf gem wrong
>>> version / not using things from source / wrong path or whatever sebb and
>>> rubys have been investigating?
>>>
>>> Macbook:tools curcuru$ irb
>>>
>>> irb(main):001:0> require_relative "../lib/whimsy/asf"
>>> => true
>>> irb(main):002:0> x = ASF::Committee.load_committee_info
>>> => nil
>>
>> For me, I get an array:
>>
>> irb(main):002:0> x = ASF::Committee.load_committee_info.length
>> => 201
>>
>> Looking at the source to load_committee_info, I see:
>>
>>         board = ASF::SVN.find('board')
>>         return unless board
>>         file = File.join(board, 'committee-info.txt')
>>         return unless File.exist? file
>>
>> What does ASF::SVN.find('board') return for you?

There was an ASF::SVN bug in directory searching, fixed by Sam here:


https://github.com/apache/whimsy/commit/e30526daa23c052473d5b5243fbd9f33aac4fe00

> Should load_committee_info throw rather than returning nil?
> 
> Is there any use case where nil is OK as a return?

Interesting question.  Also note that there are differences in some ASF
module classes between .find(), .find!(), and .[] in terms of if they
return nil or throw an exception if an item isn't actually found.  It's
not terribly important, but if anyone is doing doc updates across files,
it's worth better explaining.

In other news, I'm reorganizing site-scan.rb to be simpler and use
SiteStandards for the regexes to check (in most cases, not all).  It
will also return an :errors hash key when it barfs on trying to read the
homepage.

-- 

- Shane
  Director & Member
  The Apache Software Foundation

Reply via email to