fix EOFError repeatedly returned by HighLine::ask on stock osx ruby #95

Merged
merged 2 commits into from Aug 22, 2012

2 participants

@fgalassi

ruby 1.8.7 (2011-12-28 patchlevel 357) [universal-darwin11.0]

closes #94

@fgalassi fgalassi fix EOFError repeatedly returned by HighLine::ask on ruby 1.8.7 (2011…
…-12-28 patchlevel 357)

[universal-darwin11.0] (stock ruby on snow leopard)
c272fa0
@igrigorik igrigorik commented on the diff Jul 11, 2012
lib/vimgolf/ui.rb
@@ -58,7 +60,8 @@ def ask_question(message, options = {})
end
@hl.ask(message, options[:choices] || [], &details)
rescue EOFError
- return ''
+ # be sure to exit, don't loop
@igrigorik
Owner

It's probably worth logging something here to notify the user that there was an error. Otherwise you might end up with "auto-exit" behavior if something breaks, which is possibly even more frustrating.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@igrigorik igrigorik merged commit 0aee8d5 into igrigorik:master Aug 22, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment