AndrewRadev/vimrunner — pull request #8 by mudge (2012-04-24 21:00:14+00:00)
Title: Initial attempt to extract Vim selection logic

This isn't particularly ready but might be a good point for us to start collaborating on extracting the Vim selection logic into separate classes.

To summarise, I created a `Vimrunner::Vim` module which has `server`, `client` and `gui` methods to return the appropriate binary for each selection. The different permutations should be covered in `spec/vimrunner/vim_spec.rb`. The result of this selection is not just a string (e.g. `"mvim"`) but a `Vimrunner::VimInstance` (for want of a better name) which is either a `Vimrunner::HeadlessVim` or a `Vimrunner::GuiVim`: the difference being how they spawn. These `VimInstance`s are then passed around and interrogated by both `Client` and `Server` classes.

The reason I created an abstract parent class of both `HeadlessVim` and `GuiVim` was to avoid violating the Liskov substitution principle where possible by changing the behaviour of `spawn` between parent and child.

I'd be keen to get your feedback to see how we can simplify this (particularly the initialisation logic in `Server`).