if resource[:name] couldn't be found by the pkginfo call it returns an empty string, but not nil.
If some reason the pkginfo call were to fail we would end up with the expected `undefined method chomp! for nil:NilClass`. Were this to happen the user would have a broken pkginfo.

However, for the sake of clarity, how about moving the `#chomp!` to an `else` block after the `#nil?` and `#size` calls?