Method: Vimrunner::Server#start
- Defined in:
- lib/vimrunner/server.rb
#start ⇒ Object
Public: Start a Server. This spawns a background process.
Examples
client = Vimrunner::Server.new("vim").start
# => #<Vimrunner::Client>
Vimrunner::Server.new("vim").start do |client|
client.edit("foo")
end
Returns a new Client instance initialized with this Server. Yields a new Client instance initialized with this Server.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/vimrunner/server.rb', line 58 def start @r, @w, @pid = spawn if block_given? begin @result = yield(connect!) ensure kill end @result else connect! end end |