bbatsov/rubocop — pull request #372 by edzhelyov (2013-07-17 17:52:26+00:00)
Title: Refactor autocorrect

These are the same commits as from the "restore-autocorrect" PR with one last addition where I extract the auto-correction logic into separate classes.

Changes summary:

1. Cops put the offensive nodes into the offence's node attribute. Is this private or public api for the Offence ?
2. After that, if auto-correct options is true, the Corrector will pass each offence to the corresponding correction object. This object is required to implement the #call method and will receive the `corrector` and the `node`.
3. Each correction object needs to register itself to the global singleton `Rubocop::AutoCorrection::Registry` by specifing the string corresponding to the cop. I don't like that we have to register in a singleton here and don't like that the instances are actually created in `Registry.all`.