From bc49be6c2c6ffbaa831352bdb337db482da5d8e9 Mon Sep 17 00:00:00 2001 From: Corey Johnson & Nathan Sobo Date: Mon, 17 Dec 2012 16:54:09 -0800 Subject: [PATCH] Move project.ignoredNames to config.core.ignoredNames --- spec/app/project-spec.coffee | 6 ++++-- src/app/project.coffee | 7 ++----- src/app/root-view.coffee | 1 + 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/app/project-spec.coffee b/spec/app/project-spec.coffee index 055118df8..0018403c9 100644 --- a/spec/app/project-spec.coffee +++ b/spec/app/project-spec.coffee @@ -152,7 +152,8 @@ describe "Project", -> it "ignores ignored.txt file", -> paths = null - project.ignoredNames.push 'ignored.txt' + config.get("core.ignoredNames").push("ignored.txt") + config.update("core.ignoredNames", config.get("core.ignoredNames")) waitsForPromise -> project.getFilePaths().done (foundPaths) -> paths = foundPaths @@ -171,7 +172,8 @@ describe "Project", -> it "ignores ignored folder", -> paths = null - project.ignoredNames.push 'ignored' + config.get("core.ignoredNames").push("ignored.txt") + config.update("core.ignoredNames", config.get("core.ignoredNames")) waitsForPromise -> project.getFilePaths().done (foundPaths) -> paths = foundPaths diff --git a/src/app/project.coffee b/src/app/project.coffee index 7f705ac1f..b24d98daf 100644 --- a/src/app/project.coffee +++ b/src/app/project.coffee @@ -23,10 +23,6 @@ class Project @setPath(path) @editSessions = [] @buffers = [] - @ignoredNames = [ - '.git' - '.DS_Store' - ] @repo = new Git(path) destroy: -> @@ -59,7 +55,8 @@ class Project isPathIgnored: (path) -> for segment in path.split("/") - return true if _.contains(@ignoredNames, segment) + ignoredNames = config.get("core.ignoredNames") or [] + return true if _.contains(ignoredNames, segment) @ignoreRepositoryPath(path) diff --git a/src/app/root-view.coffee b/src/app/root-view.coffee index baf648bc8..51892569b 100644 --- a/src/app/root-view.coffee +++ b/src/app/root-view.coffee @@ -16,6 +16,7 @@ TextMateTheme = require 'text-mate-theme' module.exports = class RootView extends View @configDefaults: + ignoredNames: [".git", ".svn", ".DS_Store"] extensions: [] @content: ->