chrislee35/passivedns-client

pdnstool: letter_map used before being defined?

Closed this issue · 2 comments

I don't have much ruby experience, so I could have done something wrong, but I can't get the pdnstool tool to work. I installed it today using gem install passivedns-client. It is version 2.0.0

It looks like letter_map is being defined in usage, but being referenced in the main body.

$ pdnstool -d3 www.google.com
/Library/Ruby/Gems/2.0.0/gems/passivedns-client-2.0.0/bin/pdnstool:127:in `block (2 levels) in <top (required)>': undefined local variable or method `letter_map' for main:Object (NameError)
    from /Library/Ruby/Gems/2.0.0/gems/passivedns-client-2.0.0/bin/pdnstool:124:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/passivedns-client-2.0.0/bin/pdnstool:124:in `block in <top (required)>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/getoptlong.rb:604:in `block in each'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/getoptlong.rb:601:in `loop'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/getoptlong.rb:601:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/passivedns-client-2.0.0/bin/pdnstool:117:in `<top (required)>'
    from /usr/bin/pdnstool:23:in `load'
    from /usr/bin/pdnstool:23:in `<main>'

My ruby version. Running on MacOS X.

$ ruby --version
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]

@jt6211 Thanks so much for catching that. It seems that when I re-engineered that entire component, I left out the last part of processing the arguments. The rubygem bundler tools give me built in ways to test the libraries, but I need to go the extra step and figure out a way to test the tools in ./bin as well. This isn't the first command-line tool that I've bungled in this fashion
I have released 2.0.1 with the fixes to the pdnstool command-line tool. Please test it and let me know if I can close this pull request.

your fixed worked great. Thanks Chris.