Class: RuboBot::CLI
- Inherits:
-
Object
- Object
- RuboBot::CLI
- Defined in:
- lib/rubobot/cli.rb
Overview
Entrypoint for running RuboBot from the CLI
Constant Summary collapse
- STATUS_SUCCESS =
0
- STATUS_FAILURE =
1
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(paths, configuration) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(paths, configuration) ⇒ CLI
Returns a new instance of CLI.
14 15 16 17 |
# File 'lib/rubobot/cli.rb', line 14 def initialize(paths, configuration) @paths = paths @configuration = configuration end |
Class Method Details
.run(argv) ⇒ Object
9 10 11 12 |
# File 'lib/rubobot/cli.rb', line 9 def self.run(argv) = Options.new(argv) new([:paths], Configuration.new()).run end |
Instance Method Details
#run ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/rubobot/cli.rb', line 19 def run return output(VERSION) if configuration.version? = Bot.new(configuration).autocorrect(paths) output() if configuration. STATUS_SUCCESS rescue RuboBot::RuboCop::NoOffensesError STATUS_FAILURE end |