class Reviewer::Command::Verbosity

Defines the possible verbosity options for running commands

Constants

LEVELS

For validation and casting purposes

NO_SILENCE

Let the output scroll for eternity

TOOL_SILENCE

Just the quiet flag for the tool. Basically, let the tool determine the useful output.

TOTAL_SILENCE

Use the quiet flag and send everything to dev/null. For some tools “quiet” means “less noisy” rather than truly silent. So in those cases, dev/null handles lingering noise.

Attributes

level[RW]

Public Class Methods

new(level) click to toggle source

Create an instance of verbosity @param level [Symbol] one of the values of verbosity defined by LEVELS

@return [Command::Verbosity] an instance of verbosity

# File lib/reviewer/command/verbosity.rb, line 35
def initialize(level)
  @level = level.to_sym

  verify_level!
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/reviewer/command/verbosity.rb, line 41
def <=>(other)
  level <=> other.level
end
key()
Alias for: to_sym
to_i() click to toggle source
# File lib/reviewer/command/verbosity.rb, line 49
def to_i
  LEVELS.index(level)
end
to_s() click to toggle source
# File lib/reviewer/command/verbosity.rb, line 45
def to_s
  level.to_s
end
to_sym() click to toggle source
# File lib/reviewer/command/verbosity.rb, line 53
def to_sym
  level
end
Also aliased as: key

Private Instance Methods

verify_level!() click to toggle source
# File lib/reviewer/command/verbosity.rb, line 60
def verify_level!
  raise InvalidLevelError, "Invalid Verbosity Level: '#{level}'" unless LEVELS.include?(level)
end