Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #95 from fgalassi/fix_eoferror_exception

fix EOFError repeatedly returned by HighLine::ask on stock osx ruby
  • Loading branch information...
commit 0aee8d5b440584fa82b340bc5d49735df5839e52 2 parents 132ba8b + 14c45f2
Ilya Grigorik authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/vimgolf/ui.rb
6 lib/vimgolf/ui.rb
View
@@ -1,5 +1,7 @@
require 'highline'
+HighLine.track_eof = false
+
module VimGolf
class CLI
class UI < Thor::Base.shell
@@ -58,7 +60,9 @@ def ask_question(message, options = {})
end
@hl.ask(message, options[:choices] || [], &details)
rescue EOFError
- return ''
+ # be sure to exit, don't loop
+ error "Argh! Forced quit due to EOF error. Please report this problem so we can fix it!"
+ return :quit
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.