       pack.activate(options)
       pack
 
+  # Private: Deactivate all packages
   deactivatePackages: ->
     @deactivatePackage(pack.name) for pack in @getActivePackages()
     @unobserveDisabledPackages()
 
+  # Private: Deactivate the package with the given name
   deactivatePackage: (name) ->
     if pack = @getActivePackage(name)
       @setPackageState(pack.name, state) if state = pack.serialize?()


    _.uniq(packagePaths)

  getAvailablePackageNames: ->
    _.uniq _.map @getAvailablePackagePaths(), (packagePath) -> path.basename(packagePath)

  getAvailablePackageMetadata: ->
    packages = []
    for packagePath in @getAvailablePackagePaths()

    else
      throw new Error("No loaded package for name '#{name}'")

  # Public: Get the loaded package with the given name
  getLoadedPackage: (name) ->
    @loadedPackages[name]

  # Public: Is the package with the given name loaded?
  isPackageLoaded: (name) ->
    @getLoadedPackage(name)?

  # Public: Get an array of all the loaded packages
  getLoadedPackages: ->
    _.values(@loadedPackages)

