diff --git a/benchmark/benchmark-bootstrap.coffee b/benchmark/benchmark-bootstrap.coffee index 8d9a0ba4e..e6b4de693 100644 --- a/benchmark/benchmark-bootstrap.coffee +++ b/benchmark/benchmark-bootstrap.coffee @@ -1,7 +1,7 @@ require '../src/window' Atom = require '../src/atom' atom = new Atom() -atom.show() unless atom.getLoadSettings().exitWhenDone +atom.show() unless atom.loadSettings.exitWhenDone window.atom = atom {runSpecSuite} = require '../spec/jasmine-helper' diff --git a/benchmark/benchmark-helper.coffee b/benchmark/benchmark-helper.coffee index 312d2258d..bb7e329a5 100644 --- a/benchmark/benchmark-helper.coffee +++ b/benchmark/benchmark-helper.coffee @@ -40,7 +40,7 @@ window.benchmark = (args...) -> report = "#{fullname}: #{total} / #{count} = #{avg}ms" console.log(report) - if atom.getLoadSettings().exitWhenDone + if atom.loadSettings.exitWhenDone url = "https://github.com/_stats" data = [type: 'timing', metric: "atom.#{fullname}", ms: avg] $.ajax url, diff --git a/spec/jasmine-helper.coffee b/spec/jasmine-helper.coffee index 3d84e9d46..d279c35db 100644 --- a/spec/jasmine-helper.coffee +++ b/spec/jasmine-helper.coffee @@ -8,7 +8,7 @@ module.exports.runSpecSuite = (specSuite, logErrors=true) -> TimeReporter = require './time-reporter' timeReporter = new TimeReporter() - if atom.getLoadSettings().exitWhenDone + if atom.loadSettings.exitWhenDone {jasmineNode} = require 'jasmine-node/lib/jasmine-node/reporter' reporter = new jasmineNode.TerminalReporter print: (args...) -> diff --git a/spec/keymap-spec.coffee b/spec/keymap-spec.coffee index a74ede659..0749f0386 100644 --- a/spec/keymap-spec.coffee +++ b/spec/keymap-spec.coffee @@ -6,7 +6,7 @@ Keymap = require '../src/keymap' describe "Keymap", -> fragment = null keymap = null - resourcePath = atom.getLoadSettings().resourcePath + resourcePath = atom.loadSettings.resourcePath beforeEach -> keymap = new Keymap({configDirPath: atom.getConfigDirPath(), resourcePath}) diff --git a/spec/spec-bootstrap.coffee b/spec/spec-bootstrap.coffee index 8e877ce04..0ef64457e 100644 --- a/spec/spec-bootstrap.coffee +++ b/spec/spec-bootstrap.coffee @@ -5,13 +5,13 @@ try require '../src/window' Atom = require '../src/atom' window.atom = Atom.loadOrCreate('spec') - window.atom.show() unless atom.getLoadSettings().exitWhenDone + window.atom.show() unless atom.loadSettings.exitWhenDone {runSpecSuite} = require './jasmine-helper' document.title = "Spec Suite" runSpecSuite './spec-suite' catch error - if atom?.getLoadSettings().exitWhenDone + if atom?.loadSettings.exitWhenDone console.error(error.stack ? error) atom.exit(1) else diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index 8c66f6d76..629c99890 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -38,7 +38,7 @@ specPackageName = null specPackagePath = null specProjectPath = null -{specDirectory, resourcePath} = atom.getLoadSettings() +{specDirectory, resourcePath} = atom.loadSettings if specDirectory specPackagePath = path.resolve(specDirectory, '..') diff --git a/spec/spec-suite.coffee b/spec/spec-suite.coffee index 6beade358..1d345222d 100644 --- a/spec/spec-suite.coffee +++ b/spec/spec-suite.coffee @@ -23,7 +23,7 @@ setSpecDirectory = (specDirectory) -> setSpecField('specDirectory', specDirectory) runAllSpecs = -> - {resourcePath} = atom.getLoadSettings() + {resourcePath} = atom.loadSettings # Only run core specs when resource path is the Atom repository if Git.exists(resourcePath) requireSpecs(path.join(resourcePath, 'spec')) @@ -48,7 +48,7 @@ runAllSpecs = -> requireSpecs(path.join(packagePath, 'spec')) for packagePath in packagePaths.user ? [] setSpecType('user') -if specDirectory = atom.getLoadSettings().specDirectory +if specDirectory = atom.loadSettings.specDirectory requireSpecs(specDirectory) setSpecType('user') else diff --git a/spec/theme-manager-spec.coffee b/spec/theme-manager-spec.coffee index bb96a5b2a..ba2d76661 100644 --- a/spec/theme-manager-spec.coffee +++ b/spec/theme-manager-spec.coffee @@ -6,7 +6,7 @@ AtomPackage = require '../src/atom-package' describe "ThemeManager", -> themeManager = null - resourcePath = atom.getLoadSettings().resourcePath + resourcePath = atom.loadSettings.resourcePath configDirPath = atom.getConfigDirPath() beforeEach -> diff --git a/spec/window-spec.coffee b/spec/window-spec.coffee index 68f9adeb2..f98bb2f2d 100644 --- a/spec/window-spec.coffee +++ b/spec/window-spec.coffee @@ -7,7 +7,6 @@ describe "Window", -> beforeEach -> spyOn(atom, 'hide') - atom.getLoadSettings() # Causes atom.loadSettings to be initialized atom.loadSettings.initialPath = atom.project.getPath() atom.project.destroy() windowEventHandler = new WindowEventHandler() diff --git a/src/atom.coffee b/src/atom.coffee index 93d1bbd65..25431755c 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -122,6 +122,7 @@ class Atom extends Model created: -> DeserializerManager = require './deserializer-manager' @deserializers = new DeserializerManager() + @loadSettings = @constructor.getLoadSettings() # Public: Sets up the basic services that should be available in all modes # (both spec and application). Call after this instance has been assigned to @@ -140,7 +141,7 @@ class Atom extends Model ThemeManager = require './theme-manager' ContextMenuManager = require './context-menu-manager' MenuManager = require './menu-manager' - {devMode, resourcePath} = @getLoadSettings() + {devMode, resourcePath} = @loadSettings configDirPath = @getConfigDirPath() @config = new Config({configDirPath, resourcePath}) @@ -202,16 +203,10 @@ class Atom extends Model setBodyPlatformClass: -> document.body.classList.add("platform-#{process.platform}") - # Public: Get the load settings for the current window. - # - # Returns an object containing all the load setting key/value pairs. - getLoadSettings: -> - @constructor.getLoadSettings() - # Private: deserializeProject: -> Project = require './project' - @project ?= new Project(path: @getLoadSettings().initialPath) + @project ?= new Project(path: @loadSettings.initialPath) # Private: deserializeWorkspaceView: -> @@ -299,7 +294,7 @@ class Atom extends Model # Private: restoreWindowDimensions: -> windowDimensions = @state.getObject('windowDimensions') ? {} - {initialSize} = @getLoadSettings + {initialSize} = @loadSettings windowDimensions.height ?= initialSize?.height ? global.screen.availHeight windowDimensions.width ?= initialSize?.width ? Math.min(global.screen.availWidth, 1024) @setWindowDimensions(windowDimensions) @@ -407,11 +402,11 @@ class Atom extends Model # Public: Is the current window in development mode? inDevMode: -> - @getLoadSettings().devMode + @loadSettings.devMode # Public: Is the current window running specs? inSpecMode: -> - @getLoadSettings().isSpec + @loadSettings.isSpec # Public: Toggle the full screen state of the current window. toggleFullScreen: -> diff --git a/src/command-installer.coffee b/src/command-installer.coffee index b1515d46f..634b11c4b 100644 --- a/src/command-installer.coffee +++ b/src/command-installer.coffee @@ -54,7 +54,7 @@ module.exports = callback = resourcePath resourcePath = null - resourcePath ?= atom.getLoadSettings().resourcePath + resourcePath ?= atom.loadSettings.resourcePath commandPath = path.join(resourcePath, 'atom.sh') @install(commandPath, callback) @@ -63,6 +63,6 @@ module.exports = callback = resourcePath resourcePath = null - resourcePath ?= atom.getLoadSettings().resourcePath + resourcePath ?= atom.loadSettings.resourcePath commandPath = path.join(resourcePath, 'node_modules', '.bin', 'apm') @install(commandPath, callback)