Class: QuietQuality::Cli::Entrypoint

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/quiet_quality/cli/entrypoint.rb

Instance Method Summary collapse

Methods included from Logging

#debug, #info, #warn

Constructor Details

#initialize(argv:, output_stream: $stdout, error_stream: $stderr) ⇒ Entrypoint

Returns a new instance of Entrypoint.



6
7
8
9
10
# File 'lib/quiet_quality/cli/entrypoint.rb', line 6

def initialize(argv:, output_stream: $stdout, error_stream: $stderr)
  @argv = argv
  @output_stream = output_stream
  @error_stream = error_stream
end

Instance Method Details

#executeObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/quiet_quality/cli/entrypoint.rb', line 12

def execute
  if helping?
    log_help_text
  elsif printing_version?
    log_version_text
  elsif no_tools?
    log_no_tools_text
  else
    log_options
    execute!
    log_results
    annotate_messages
  end

  self
end

#successful?Boolean

Returns:

  • (Boolean)


29
30
31
32
33
# File 'lib/quiet_quality/cli/entrypoint.rb', line 29

def successful?
  return true if helping? || printing_version?
  return false if no_tools?
  !executed.any_failure?
end