Specs run (but fail hardcore)

This commit is contained in:
probablycorey
2013-05-21 17:04:00 -07:00
parent d4b146d080
commit b58fcc5395
3 changed files with 19 additions and 5 deletions

View File

@@ -20,7 +20,7 @@ window.atom =
originalSendMessageToBrowserProcess: -> console.log 'this methods needs to be replaced'
getPathToOpen: ->
window.location.params.pathToOpen ? @getWindowState('pathToOpen')
window.location.params.pathToOpen
getPackageState: (name) ->
@packageStates[name]
@@ -223,7 +223,7 @@ window.atom =
fsUtils.join(config.userStoragePath, shasum.digest('hex'))
setWindowState: (keyPath, value) ->
return {} if @windowMode == 'config'
return {} if not @getPathToOpen()
windowState = @getWindowState()
_.setValueForKeyPath(windowState, keyPath, value)
@@ -231,7 +231,7 @@ window.atom =
windowState
getWindowState: (keyPath) ->
return {} if @windowMode == 'config' or not fsUtils.exists(@getWindowStatePath())
return {} if not @getPathToOpen() or not fsUtils.exists(@getWindowStatePath())
windowState = JSON.parse(fsUtils.read(@getWindowStatePath()) or '{}')
if keyPath

View File

@@ -36,6 +36,11 @@ window.setUpEnvironment = ->
if nativeStylesheetPath = fsUtils.resolveOnLoadPath(process.platform, ['css', 'less'])
requireStylesheet(nativeStylesheetPath)
dimensions = atom.getWindowState('dimensions')
dimensions = defaultWindowDimensions unless dimensions.width and dimensions.height
window.setDimensions(dimensions)
remote.getCurrentWindow().show()
# This method is only called when opening a real application window
window.startEditorWindow = ->
directory = _.find ['/opt/boxen', '/opt/github', '/usr/local'], (dir) -> fsUtils.isDirectory(dir)
@@ -55,7 +60,6 @@ window.startEditorWindow = ->
atom.activatePackages()
keymap.loadUserKeymaps()
atom.requireUserInitScript()
remote.getCurrentWindow().show()
$(window).on 'unload', -> unloadEditorWindow(); false
$(window).focus()
@@ -154,7 +158,6 @@ window.deserializeEditorWindow = ->
atom.packageStates = windowState.packageStates ? {}
window.project = deserialize(windowState.project) ? new Project(pathToOpen)
window.rootView = deserialize(windowState.rootView) ? new RootView
window.setDimensions(windowState.dimensions ? defaultWindowDimensions)
if !windowState.rootView and (!pathToOpen or fsUtils.isFile(pathToOpen))
rootView.open(pathToOpen)

View File

@@ -16,6 +16,7 @@ setupNodePath= ->
'vendor',
'static',
'node_modules',
'spec'
]
homeDir = process.env[if process.platform is 'win32' then 'USERPROFILE' else 'HOME']
@@ -75,6 +76,8 @@ class AtomApplication
{ label: 'Hide Others', accelerator: 'Command+Shift+H', selector: 'hideOtherApplications:' }
{ label: 'Show All', selector: 'unhideAllApplications:' }
{ type: 'separator' }
{ label: 'Run Specs', accelerator: 'Command+Alt+N', click: => @runSpecs() }
{ type: 'separator' }
{ label: 'Quit', accelerator: 'Command+Q', click: -> app.quit() }
]
@@ -140,6 +143,14 @@ class AtomApplication
@windows.push atomWindow
runSpecs: ->
specWindow = new AtomWindow
bootstrapScript: 'spec-bootstrap',
resourcePath: @resourcePath
specWindow.browserWindow.show()
@windows.push specWindow
class AtomWindow
browserWindow: null