Class: Ukiryu::StandardOutput

Inherits:
Object
  • Object
show all
Defined in:
lib/ukiryu/io.rb

Constant Summary collapse

FILENO =

The stdout file descriptor

1

Class Method Summary collapse

Class Method Details

.stdout?(path) ⇒ Boolean

Check if a path represents stdout

Examples:

Ukiryu::IO::StandardOutput.stdout?("-")  # => true
Ukiryu::IO::StandardOutput.stdout?(:stdout)  # => true

Parameters:

  • path (String, Symbol)

    the path to check

Returns:

  • (Boolean)

    true if the path represents stdout



177
178
179
180
# File 'lib/ukiryu/io.rb', line 177

def self.stdout?(path)
  path = path.to_s if path.is_a?(Symbol)
  [$stdout, '-', '/dev/stdout', '%stdout%'].include?(path)
end