Class: Slimembedcop::Cli
- Inherits:
-
Object
- Object
- Slimembedcop::Cli
- Defined in:
- lib/slimembedcop/cli.rb
Overview
Command line interface for Slimembedcop.
Instance Method Summary collapse
-
#initialize(argv) ⇒ Cli
constructor
A new instance of Cli.
- #run ⇒ Object
Constructor Details
#initialize(argv) ⇒ Cli
Returns a new instance of Cli.
8 9 10 |
# File 'lib/slimembedcop/cli.rb', line 8 def initialize(argv) @argv = argv end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/slimembedcop/cli.rb', line 12 def run = Option.new(@argv) formatter = ::RuboCop::Formatter::ProgressFormatter.new($stdout, color: .color) config = ConfigGenerator.new().run paths = PathFinder.new(, config).run offenses = Runner.new(paths, formatter, , config).run exit(offenses.empty? ? 0 : 1) end |