Class: RuboBot::Bot

Inherits:
Object
  • Object
show all
Defined in:
lib/rubobot/bot.rb

Overview

Run rubobot

Instance Method Summary collapse

Constructor Details

#initialize(configuration = Configuration.new) ⇒ Bot

Returns a new instance of Bot.



6
7
8
# File 'lib/rubobot/bot.rb', line 6

def initialize(configuration = Configuration.new)
  @configuration = configuration
end

Instance Method Details

#autocorrect(paths) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/rubobot/bot.rb', line 10

def autocorrect(paths)
  loop do
    ac = RuboBot::RuboCop::AutoCorrect.new(next_cop(paths), paths)

    if ac.run
      configuration.stdout.puts(ac.commit_message)
      break
    end
  end
end