Class: Project

Defined in: ../atom/src/project.coffee
Inherits: Model

Overview

Represents a project that's opened in Atom.

An instance of this class is always available as the atom.project global.

Class Method Summary

Instance Method Summary

Class Method Details

.pathForRepositoryUrl(repoUrl) Source

Find the local path for the given repository URL.

Instance Method Details

::contains(pathToCheck) Source

Returns whether the given path is inside this project.

::getPath() Source

Returns the project's fullpath.

::getRepo() Source

Returns the {Git} repository if available.

::getRootDirectory() Source

Returns the root {Directory} object for this project.

::relativize(fullPath) Source

Make the given path relative to the project directory.

::replace(regex, replacementText, filePaths, iterator) Source

Performs a replace across all the specified files in the project.

Parameters:

  • (RegExp) regexA RegExp to search with.
  • replacementTextText to replace all matches of regex with
  • filePathsList of file path strings to run the replace on.
  • (Function) iteratorA Function callback on each file with replacements: ({filePath, replacements}) ->.

String ::resolve(uri) Source

Given a uri, this resolves it relative to the project directory. If the path is already absolute or if it is prefixed with a scheme, it is returned unchanged.

Parameters:

  • (String) uriThe String name of the path to convert.

Returns:

  • (String) — Returns a String or undefined if the uri is not missing or empty.

::scan(regex, options = {}, iterator) Source

Performs a search across all the files in the project.

Parameters:

  • (RegExp) regexA RegExp to search with.
  • (Object) optionsAn optional options Object (default: {}):
    • (Array) pathsAn Array of glob patterns to search within
  • (Function) iteratorA Function callback on each file found

::setPath(projectPath) Source

Sets the project's fullpath.