Class: RubocopDirector::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop_director/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Runner

Returns a new instance of Runner.



9
10
11
12
13
# File 'lib/rubocop_director/runner.rb', line 9

def initialize(args)
  @options = {}
  arg_parser.parse(args, into: @options)
  verify_options
end

Instance Method Details

#performObject



15
16
17
18
19
20
# File 'lib/rubocop_director/runner.rb', line 15

def perform
  command.run.either(
    ->(success_message) { puts success_message },
    ->(failure_message) { puts "\nFailure: #{failure_message}" }
  )
end