From: Francis Cianfrocca Date: 2006-08-17T09:00:09+09:00 Subject: Re: Net::LDAP 0.0.4 filter warnings On 8/16/06, barjunk wrote: > I'm writing some new code and using #!/usr/bin/ruby -w as the bang line > in the script. > > The code looks like: > > require 'rubygems' > require 'net/ldap' > > > > filter = Net::LDAP::Filter.eq( "key","value" ) > ldap.search (:base =>treebase, :filter => filter) > > > > I get: > > /usr/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib/net/ldap/filter.rb:310: > warning: ambiguous first argument; put parentheses or even spaces > /usr/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib/net/ldap/filter.rb:311: > warning: ambiguous first argument; put parentheses or even spaces > /usr/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib/net/ldap/filter.rb:324: > warning: ambiguous first argument; put parentheses or even spaces > /usr/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib/net/ldap/filter.rb:338: > warning: ambiguous first argument; put parentheses or even spaces > /usr/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib/net/ldap/filter.rb:356: > warning: ambiguous first argument; put parentheses or even spaces > /usr/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib/net/ldap/filter.rb:358: > warning: ambiguous first argument; put parentheses or even spaces > /usr/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib/net/ldap/filter.rb:360: > warning: ambiguous first argument; put parentheses or even spaces > > > These warnings occurs after the filter line but before the search line. > > This looks like it is at the lines that have: > > scanner.scan > > What needs to be done to make those warnings go away? > > Mike B. > > > Well that's odd! Never saw that in any of my testing. What version of Ruby are you using? I've patched the code in Rubyforge. Sync to the latest and see if the problem goes away. Come to think of it, I don't like this very much. There should have been no warnings. The code path you're looking at is a recursive descent parser, and it got touched a few days ago. If you're feeling frisky, would you please get version 0.0.3 of Net::LDAP and see if you get the same problem? Perhaps a regression crept into 0.0.4.