#!/usr/bin/env ruby
class CLI < Thor
def search
# ...
selected = gets.chomp.to_i # this will raise: Broken pipe (Errno::EPIPE)
# ...
end
end
CLI.start
Created
April 21, 2012 12:45
-
-
Save Jeweller-Tsai/2436935 to your computer and use it in GitHub Desktop.
How to take STDIN in the middle of a method execution?
Author
Jeweller-Tsai
commented
Apr 22, 2012
via email
Already fix it. but the test still not pass
ÔÚ 2012Äê4ÔÂ22ÈÕ ÏÂÎç1:46£¬Tower He <
[email protected]
… дµÀ£º
Sorry, for now I have no idea about it.
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/2436935
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment