Class: Ruboclean::Runner::Options::Output

Inherits:
Object
  • Object
show all
Defined in:
lib/ruboclean/runner/options/output.rb

Overview

Determines the output stream

Instance Method Summary collapse

Constructor Details

#initialize(cli_arguments:, input:) ⇒ Output

Returns a new instance of Output.



8
9
10
11
# File 'lib/ruboclean/runner/options/output.rb', line 8

def initialize(cli_arguments:, input:)
  @cli_arguments = cli_arguments
  @input = input
end

Instance Method Details

#stdout?Boolean

Returns:

  • (Boolean)


17
18
19
20
# File 'lib/ruboclean/runner/options/output.rb', line 17

def stdout?
  (cli_arguments.output.nil? && input.stdin?) ||
    cli_arguments.output == "STDOUT"
end

#streamObject



13
14
15
# File 'lib/ruboclean/runner/options/output.rb', line 13

def stream
  @stream ||= determine_output_stream
end