Class: RuboCop::Git::Runner
- Inherits:
-
Object
- Object
- RuboCop::Git::Runner
- Defined in:
- lib/rubocop/git/runner.rb
Overview
Instance Method Summary collapse
-
#initialize(exit_on_offence: true) ⇒ Runner
constructor
A new instance of Runner.
- #run(options = {}) ⇒ Object
Constructor Details
#initialize(exit_on_offence: true) ⇒ Runner
Returns a new instance of Runner.
7 8 9 |
# File 'lib/rubocop/git/runner.rb', line 7 def initialize(exit_on_offence: true) @exit_on_offence = exit_on_offence end |
Instance Method Details
#run(options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rubocop/git/runner.rb', line 11 def run( = {}) = Options.new() unless .is_a?(Options) @options = @files = DiffParser.parse(git_diff()) display_violations($stdout) ok = violations_with_valid_offences.none? exit(1) if @exit_on_offence && !ok ok end |