Created
January 27, 2016 19:50
-
-
Save 0x0dea/6a06310137042bcb98f0 to your computer and use it in GitHub Desktop.
Revisions
-
0x0dea created this gist
Jan 27, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ require 'open3' i, o = Open3.popen2 'ruby repl.rb' line = nil puts 'Gimme Ruby expressions to evaluate (in another process).' Thread.new do i.puts line while line = gets i.close end puts line while line = o.gets This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ while line = gets p eval line $stdout.flush end