I completely agree that the ivar is brittle and resetting it after use feels a little bit like patching around a problem.

I am currently attempting to refactor this code to clean it up and remove the ivar altogether, but it's taking me a while to get to grips with the complexity of Bundler's source, and I think that without the cheap hack that I've already implemented this may get a lot more complicated ;)

thanks for the feedback folks, hopefully I'll have something I'm happy with soon.