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.
On 8/16/06, barjunk [email protected] wrote:
filter = Net::LDAP::Filter.eq( “key”,“value” )
/usr/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib/net/ldap/filter.rb:324:
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.
On 8/16/06, barjunk [email protected] wrote:
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?
Umm… any feedback, Barjunk? If this is not a real problem, I want to
rollback the code changes I made.
On 8/16/06, barjunk [email protected] wrote:
filter = Net::LDAP::Filter.eq( “key”,“value” )
/usr/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib/net/ldap/filter.rb:324:
I can’t get those warnings to appear, and I tried all kinds of ways.
Also, they occur in a code path that is not exercised by your code
sample. Can you send me a whole program that exhibits the flaw?
(Private email is fine.)
Francis C. wrote:
Umm… any feedback, Barjunk? If this is not a real problem, I want to
rollback the code changes I made.
They show up if you run with -w. Personally, I think the parens help
with readability in this case.
Just my .02.
Regards,
Dan
Francis C. wrote:
Regards,
The current version in Rubyforge SVN does not give the warnings. I’ll
hold off another release for a few days in case anything else turns
up.
Sorry for the late response…I only get digests and have been busy on
a project. I will update to the latest and see what happens.
Mike B.
On 8/17/06, Daniel B. [email protected] wrote:
Dan
Got it. Thanks, Dan. I outsmarted myself- I thought about -w (which
barjunk mentioned) but instead of testing it the easy way, I added
$VERBOSE=true to my test script, and that didn’t produce any warnings.
The current version in Rubyforge SVN does not give the warnings. I’ll
hold off another release for a few days in case anything else turns
up.
barjunk wrote:
What needs to be done to make those warnings go away?
The current version in Rubyforge SVN does not give the warnings. I’ll
hold off another release for a few days in case anything else turns
up.
Sorry for the late response…I only get digests and have been busy on
a project. I will update to the latest and see what happens.
Mike B.
I don’t have an svn client at the moment and not going to be able to
(time wise) be able to get to that any time soon…if you can build a
gem for me, I’ll be able to test it easily. Sorry about that.
Mike B.
On 8/17/06, barjunk [email protected] wrote:
I don’t have an svn client at the moment and not going to be able to
(time wise) be able to get to that any time soon…if you can build a
gem for me, I’ll be able to test it easily. Sorry about that.
I think the ML bounced it. I emailed it to your private email.