This is a pretty old question, but I will answer it anyway. There are two main ways to get data from pry commands. First, if the command sets the keep_retval parameter to true, which the shell command is missing. The second is to use a virtual channel. In your example, this can be done as:
fizz = [] .ls | {|listing| fizz = listing.split("\n")} # can also be written as .ls do |listing| fizz = listing.split("\n") end
bmatheny
source share