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:



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

def self.exit_on_failure?
  true
end

Instance Method Details

#goObject



77
78
79
80
81
82
83
84
# File 'lib/rubocop_challenger/cli.rb', line 77

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



87
88
89
# File 'lib/rubocop_challenger/cli.rb', line 87

def version
  puts RubocopChallenger::VERSION
end