works for me. - Sam Ruby
On Thu, Jan 11, 2018 at 10:45 PM, Craig Russell <apache....@gmail.com> wrote: > >> On Jan 11, 2018, at 2:34 PM, Sam Ruby <ru...@intertwingly.net> wrote: >> >> On Thu, Jan 11, 2018 at 4:39 AM, sebb <seb...@gmail.com> wrote: >>> On 11 January 2018 at 03:03, Sam Ruby <ru...@intertwingly.net> wrote: >>>> On Wed, Jan 10, 2018 at 12:05 PM, Craig Russell <apache....@gmail.com> >>>> wrote: >>>>> tl;dr I'll push the below change to ldap.rb if no objections. >>>> >>>> If the change is to be made to the add/remove methods, there are 9 >>>> sets of these: >>>> >>>> $ egrep 'def (add|remove)' ldap.rb >>>> def remove(people) >>>> def add(people) >>>> def remove(people) >>>> def remove_owners(people) >>>> def remove_members(people) >>>> def add(people) >>>> def add_owners(people) >>>> def add_members(people) >>>> def remove_owners(people) >>>> def remove_committers(people) >>>> def add_owners(people) >>>> def add_committers(people) >>>> def remove(people) >>>> def add(people) >>>> def remove(people) >>>> def add(people) >>>> def remove(people) >>>> def add(people) >>>> >>>> Alternately, there is only one ASF::LDAP.modify method. Perhaps >>>> replacing the first line of that method with the following two would >>>> suffice? >>>> >>>> list = list.rejectt {|mod| mod.mod_vals.empty?} >>> >>> is that 'reject' or 'reject!' or ?? >> >> It was originally list.reject!, but I didn't like the idea of >> modifying a parameter that was passed in, so I tried to change it to >> list = list.reject (one 't'), but... oopsie! > > I think if you don't want to modify the parameter, you would do: > > sanitized = list.reject {|mod| mod.mod_vals.empty?} > ASF.ldap.modify(dn, sanitized) unless sanitized.empty? > > All done here? > > Craig > >> >>>> ASF.ldap.modify(dn, list) unless list.empty? >>>> >>>> - Sam Ruby >> >> - Sam Ruby > > Craig L Russell > Secretary, Apache Software Foundation > c...@apache.org http://db.apache.org/jdo >