class PipeWrapper

Attributes

active[RW]

Public Class Methods

new(command, mode="a+") click to toggle source
# File lib/logstash/outputs/pipe.rb, line 108
def initialize(command, mode="a+")
  @pipe = IO.popen(command, mode)
  @active = false
end

Public Instance Methods

method_missing(m, *args) click to toggle source
# File lib/logstash/outputs/pipe.rb, line 113
def method_missing(m, *args)
  if @pipe.respond_to? m
    @pipe.send(m, *args)
  else
    raise NoMethodError
  end
end
puts(txt) click to toggle source
# File lib/logstash/outputs/pipe.rb, line 121
def puts(txt)
  @pipe.puts(txt)
  @pipe.flush
  @active = true
end
write(txt) click to toggle source
# File lib/logstash/outputs/pipe.rb, line 127
def write(txt)
  @pipe.write(txt)
  @active = true
end