Class: Lynx::Pipe::POpen
Instance Method Summary collapse
-
#initialize(logger) ⇒ POpen
constructor
A new instance of POpen.
- #perform(command) ⇒ Object
Methods inherited from Basic
Constructor Details
#initialize(logger) ⇒ POpen
Returns a new instance of POpen.
7 8 9 |
# File 'lib/lynx/pipe/p_open.rb', line 7 def initialize(logger) @logger = logger end |
Instance Method Details
#perform(command) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/lynx/pipe/p_open.rb', line 11 def perform(command) IO.popen(command.to_s) do |io| while (line = io.gets) do @logger.info("[Lynx:POpen] #{line}") if @logger end end end |