Closed candlerb closed 9 years ago
@candlerb Thanks for the patch, and sorry I haven't had a chance to get to this yet. The main two things on my mind are that I'd want to add tests for this change and I'm worried about dropping 1.8 support since it's a small library and I don't want to exclude people as was the issue in #9
I'll think about this a little more as soon as I can.
No problem. I did try using $? after open3 but it didn't seem to give the right result code consistently.
I think some sort of error handling is necessary really though. I spent a good 45 minutes racking my brains for complicated reasons that this wasn't working a few days ago until I realised that I had made a typo in one of the pandoc arguments calling for a .bib file that didn't exist, and pandoc-ruby was just failing silently and not ouputting any html to the files I was trying to create! Are there really many people still using 1.8.x versions of Ruby? Even OSX now ships with 1.9.x...
@davepwsmith Ugh. Sorry about that. You are absolutely right. It's been almost a year since 1.8 was EOL, so it's time to revisit this.
This is finally available in the current version on RubyGems (1.0.0) and the minimum supported Ruby version is now 1.9.3. Sorry for the delay and thanks for the fix!
At the moment if pandoc fails (e.g. you pass invalid options) then pandoc-ruby silently returns an empty string with no indication of the error. This patch detects the return code and raises an error if it is non-zero.