voxpupuli / puppet-ghostbuster

👻 Dead code detector for Puppet
Apache License 2.0
93 stars 27 forks source link

Module path with ending slash cause an error #13

Closed tuxinaut closed 8 years ago

tuxinaut commented 8 years ago

If the _module path ends_ with a slash you get an error.

✔ 12:51 ~/workspace/puppet-ghostbuster [ master | ✚ 1 …3 ] $ puppet-ghostbuster --key ssl/private.pem --cert ssl/public.pem --ca ssl/ca.pem -s http://localhost:8080 ~/workspace/puppet/modules/module_name_with_ending_slash/
I, [2016-01-04T12:51:29.207418 #17394]  INFO -- PuppetGhostbuster: Now trying to find unused classes
I, [2016-01-04T12:51:29.224780 #17394]  INFO -- PuppetGhostbuster: Now trying to find unused defines
I, [2016-01-04T12:51:29.225225 #17394]  INFO -- PuppetGhostbuster: Now trying to find unused templates
/home/tuxinaut/workspace/puppet/modules/module_name_with_ending_slash//templates/env.erb
/home/tuxinaut/workspace/puppet-ghostbuster/lib/puppet-ghostbuster.rb:127:in `block in find_unused_templates': undefined method `captures' for nil:NilClass (NoMethodError)
    from /home/tuxinaut/workspace/puppet-ghostbuster/lib/puppet-ghostbuster.rb:124:in `each'
    from /home/tuxinaut/workspace/puppet-ghostbuster/lib/puppet-ghostbuster.rb:124:in `find_unused_templates'
    from /home/tuxinaut/workspace/puppet-ghostbuster/lib/puppet-ghostbuster.rb:180:in `run'
    from /home/tuxinaut/workspace/puppet-ghostbuster/lib/puppet-ghostbuster/bin.rb:26:in `run'
    from /home/tuxinaut/workspace/puppet-ghostbuster/bin/puppet-ghostbuster:7:in `<top (required)>'
    from /home/tuxinaut/.rvm/gems/ruby-2.2-head@puppet_ghostbuster/bin/puppet-ghostbuster:23:in `load'
    from /home/tuxinaut/.rvm/gems/ruby-2.2-head@puppet_ghostbuster/bin/puppet-ghostbuster:23:in `<main>'
    from /home/tuxinaut/.rvm/gems/ruby-2.2-head@puppet_ghostbuster/bin/ruby_executable_hooks:15:in `eval'
    from /home/tuxinaut/.rvm/gems/ruby-2.2-head@puppet_ghostbuster/bin/ruby_executable_hooks:15:in `<main>'
✔ 12:51 ~/workspace/puppet-ghostbuster [ master | ✚ 1 …3 ] $
mcanevet commented 8 years ago

@tuxinaut I close this issue as it is not relevant anymore after the major rewrite of v0.5.0