Class: QDA::Filters::Win32Process::Win32popenIO
- Inherits:
-
Object
- Object
- QDA::Filters::Win32Process::Win32popenIO
- Defined in:
- lib/weft/filters/win32backtick.rb
Instance Method Summary collapse
-
#initialize(hRead, hWrite, hError) ⇒ Win32popenIO
constructor
A new instance of Win32popenIO.
- #read ⇒ Object
- #read_all ⇒ Object
- #read_all_err ⇒ Object
- #read_err ⇒ Object
- #write(data) ⇒ Object
Constructor Details
#initialize(hRead, hWrite, hError) ⇒ Win32popenIO
Returns a new instance of Win32popenIO.
176 177 178 179 180 |
# File 'lib/weft/filters/win32backtick.rb', line 176 def initialize (hRead, hWrite, hError) @hRead = hRead @hWrite = hWrite @hError = hError end |
Instance Method Details
#read ⇒ Object
186 187 188 189 |
# File 'lib/weft/filters/win32backtick.rb', line 186 def read sleep(0.01) while Win32Process::peek_named_pipe(@hRead).zero? Win32Process::read_file(@hRead) end |
#read_all ⇒ Object
191 192 193 194 195 196 197 |
# File 'lib/weft/filters/win32backtick.rb', line 191 def read_all all = '' until (buffer = read).empty? all << buffer end all end |
#read_all_err ⇒ Object
204 205 206 207 208 209 210 |
# File 'lib/weft/filters/win32backtick.rb', line 204 def read_all_err all = '' until (buffer = read_err).empty? all << buffer end all end |
#read_err ⇒ Object
199 200 201 202 |
# File 'lib/weft/filters/win32backtick.rb', line 199 def read_err sleep(0.01) while Win32Process::peek_named_pipe(@hError).zero? Win32Process::read_file(@hError) end |
#write(data) ⇒ Object
182 183 184 |
# File 'lib/weft/filters/win32backtick.rb', line 182 def write data Win32Process::write_file(@hWrite, data.to_s) end |