Class: RubocopChallenger::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/rubocop_challenger/cli.rb

Overview

To define CLI commands

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Workaround to return exit code 1 when an error occurs

Returns:

  • (Boolean)

See Also:



98
99
100
# File 'lib/rubocop_challenger/cli.rb', line 98

def self.exit_on_failure?
  true
end

Instance Method Details

#goObject



82
83
84
85
86
87
88
89
# File 'lib/rubocop_challenger/cli.rb', line 82

def go
  Go.new(options).exec
rescue Errors::NoAutoCorrectableRule => e
  puts Rainbow(e.message).yellow
rescue StandardError => e
  puts Rainbow(e.message).red
  exit_process!
end

#versionObject



92
93
94
# File 'lib/rubocop_challenger/cli.rb', line 92

def version
  puts RubocopChallenger::VERSION
end