Trying to replicate run package specs interface for RSpec specs


#1

Hey guys,

Im trying to replicate the way Atom show the results for package specs.
However, I can’t figure out how to open a new window. Is a special view class?
Can someone point me in the right direction?

Thanks,


#2

You can open a new window using the atom.open(options) API.

There are many options supported, but the one you want is bootstrapScript, this will be the script that gets run in the newly opened window.

So something like:

atom.open(bootstrapScript: '/path/to/your/startup/script')

atom.open creates a new AtomWindow object that you can see the source for at: /Applications/Atom.app/Contents/Resources/app/src/browser/atom-window.js.

The /Applications/Atom.app/Contents/Resources/app/static/index.js file is run each time a window is opened and if you look at it you will see it just requires the bootstrapScript path from the load settings for the window.

This should definitely be documented better.