He-he-hey!
I'm experimenting with running specs and other Ruby files inside the Vagrant box from the Sublime Text 2 editor, without the SSH connection delay (which was taking ~5s).
So I managed to run these files by using the Virtualbox API. The requirement for running specs for Rails apps is creating a project file. This will the the $project_path
variable, which is the root directory.
Another thing I did is mapping my projects directory to the same path inside Vagrant. This can be done by using something like the following on your Vagrantfile:
Vagrant::Config.run do |config|
config.vm.box = "hellobits"
config.vm.network :hostonly, "192.168.33.2"
config.vm.share_folder "v-root", "/Users/fnando/Projects", ".", :nfs => true
end
Also remember to put vagrant-run
on your $PATH
and make it executable.
The vagrant-run
file requires you to set the name of your VirtualBox machine. Your best bet is getting the VM id with something like cat /path/to/.vagrant
.
That's it! If you prefer you can assign these custom builders only for your project. See the Sublime Text 2 documentation for instructions.