For some reason, warbler was failing catch the YAML load error when packaging with a Ruby gemspec. This flips the order. I'm not sure this is the final solution, but a conversation starter, perhaps.
Try loading gemspec first, fall back to YAML
I'm having what I think is a related error. The symptom is that the gemspec doesn't load, and instead I see "(): mapping values are not allowed here at line 5 column 43".
It seems to be related to me adding lines in the gemspec of the form 'add_runtime_dependency "cassandra" unless RUBY_PLATFORM == "java"', but I'm still narrowing it down. I don't know why adding "if" lines would cause problems, but if I revert several changes of that form then it works, and if I put them back then it fails.
"gem build" thinks it's a valid gemspec.
I think there is a problem with this is. Will it will ever reach the rescue if it's a yaml gemspec? See Gem::Specification.load, it traps the error and warns instead.
But I think this is very valuable because most gemspecs will be ruby. Can we get around the rubygems load?
I think this may be a catch 22, because no matter how you try to validate the gemspec, for example:
You will end up falling back on the yaml code. So you be back to square one if there is something invalid in your gemspec.
Can you provide an example of when it fails to catch the YAML load error?
I can't any more. That code is long since gone.
I'm closing this because I think it's handled better by 4de97e5 in #85