 module.exports =
   activate: ->
     @pkgName = 'levels-language-ruby'
-    @pkgDirPath = atom.packages.resolvePackagePath @pkgName
+    pkgDirPath = atom.packages.resolvePackagePath @pkgName
+    @pkgLanguageDirPath = path.join pkgDirPath, 'language'
 
-    @configFilePath = CSON.resolve path.join @pkgDirPath, 'language', 'config'
+    @configFilePath = CSON.resolve path.join @pkgLanguageDirPath, 'config'
     @executablePath = @getExecutablePath()
 
     pkgSubscription = atom.packages.onDidActivatePackage (pkg) =>

    @activated = false

  getExecutablePath: ->
    executableDirPath = path.join @pkgDirPath, 'language', 'executables'
    executable = if process.platform == 'win32' then 'run.exe' else 'run'
    return path.join executableDirPath, process.platform, executable



  onDidStartUsingLevels: ->
    @setUpConfigManagement()
    process.env['LRB_WHITELIST_PATH'] = path.join @pkgLanguageDirPath, 'whitelist'

  onDidStopUsingLevels: ->
    @configSubscription.dispose()
