class Lumise::Commands::Rubocop::UpdateTodo

Attributes

plugins[R]

Public Class Methods

call(plugins:) click to toggle source
# File lib/lumise/services/commands/rubocop/update_todo.rb, line 11
def self.call(plugins:)
  new(plugins: plugins).send :perform
end
new(plugins:) click to toggle source
# File lib/lumise/services/commands/rubocop/update_todo.rb, line 15
def initialize(plugins:)
  @plugins = plugins
end

Private Instance Methods

autogen_command() click to toggle source
# File lib/lumise/services/commands/rubocop/update_todo.rb, line 42
        def autogen_command
          <<~AUTOGEN
            bundle exec rubocop --config .rubocop.yml \
            --auto-gen-config --auto-gen-only-exclude \
            --exclude-limit $(bundle exec rubocop -L | wc -l)
          AUTOGEN
        end
bundle_update() click to toggle source
# File lib/lumise/services/commands/rubocop/update_todo.rb, line 30
def bundle_update
  command(printer: :quiet).run autogen_command
end
perform() click to toggle source
# File lib/lumise/services/commands/rubocop/update_todo.rb, line 23
def perform
  if yes?
    logger.info "#Running #{autogen_command}"
    bundle_update
  end
end
yes?() click to toggle source
# File lib/lumise/services/commands/rubocop/update_todo.rb, line 34
def yes?
  if l.update_todo.nil?
    prompt.yes? 'Update rubocop TODO file?', suffix: 'Yeah/nah'
  else
    l.update_todo
  end
end