Module: Groonga::QueryLog::CommandLineUtils

Included in:
Analyzer, Extractor
Defined in:
lib/groonga/query-log/commandline-utils.rb

Instance Method Summary collapse

Instance Method Details

#log_via_stdin?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/groonga/query-log/commandline-utils.rb', line 21

def log_via_stdin?
  stdin_with_pipe? or stdin_with_redirect?
end

#stdin_with_pipe?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/groonga/query-log/commandline-utils.rb', line 25

def stdin_with_pipe?
  File.pipe?($stdin)
end

#stdin_with_redirect?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/groonga/query-log/commandline-utils.rb', line 29

def stdin_with_redirect?
  not File.select([$stdin], [], [], 0).nil?
end