Method: String#exec
- Defined in:
- lib/rwd/ruby.rb
#exec(input = nil, output = true) ⇒ Object
140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/rwd/ruby.rb', line 140 def exec(input=nil, output=true) res = [] IO.popen(self, "w+") do |f| f.puts input unless input.nil? f.close_write res = f.readlines if output end res.join("") end |