     @subscriptions.add(bufferSavedSubscription)
     @subscriptions.add(editorDestroyedSubscription)
 
-  autoCorrect: (options)  ->
+  autoCorrect: (editor)  ->
+    options = @getOptions(editor.getPath())
     which options.command, (err) ->
       if (err)
         return atom.notifications.addFatalError(

      return atom.notifications.addError("Only use source.ruby")
    if editor.isModified()
      editor.save()
    @autoCorrect(@getOptions(editor.getPath()))

  getOptions: (filePath) ->
    command = atom.config.get('rubocop-auto-correct.rubocopCommandPath')

{BufferedProcess, CompositeDisposable} = require 'atom'
which = require 'which'
path = require 'path'
fs = require 'fs-plus'
temp = require 'temp'

module.exports =
class RubocopAutoCorrect
