vimrunner 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +4 -2
- data/lib/vimrunner/errors.rb +1 -0
- data/lib/vimrunner/server.rb +8 -2
- data/lib/vimrunner/version.rb +1 -1
- data/vim/{vimrunner_rc → vimrunner.vim} +9 -5
- metadata +9 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: '053182acc5fa35793f7402da1a2a4662faeb6fe9720cc9adb6986177df24cd17'
|
4
|
+
data.tar.gz: 45e09ea1e10e2c8b9552afd61dcdb21f236b6f5e6c96add3526fd515a0172eae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8561ce79c6a82a5f0c5363268afb763a14b7133711f8565d07e007c5e83d570e2002be1a7aee2649d4e25c3eac9af05ce6c556c719f359f108efc8f6377ce156
|
7
|
+
data.tar.gz: 7632fb4c746ef5a9d0defd5484236d809533d33554f5a05802bd967271a1b9821f1ce833d3455e5daceba52004b1aa8aad796fa426a8b2e252b4fbf27204df3c
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Vimrunner [![Build Status](https://secure.travis-ci.org/AndrewRadev/vimrunner.
|
1
|
+
# Vimrunner [![Build Status](https://secure.travis-ci.org/AndrewRadev/vimrunner.svg?branch=master)](http://travis-ci.org/AndrewRadev/vimrunner)
|
2
2
|
|
3
3
|
Using Vim's
|
4
4
|
[client/server](http://vimdoc.sourceforge.net/htmldoc/remote.html#clientserver)
|
@@ -6,6 +6,8 @@ functionality, this library exposes a way to spawn a Vim instance and control
|
|
6
6
|
it programatically. Apart from being a fun party trick, this can be used to do
|
7
7
|
integration testing on Vimscript.
|
8
8
|
|
9
|
+
![Demo](http://i.andrewradev.com/cb035fee68a149c09c3a252fed91b177.gif)
|
10
|
+
|
9
11
|
The latest stable documentation can be found
|
10
12
|
[on rubydoc.info](http://rubydoc.info/gems/vimrunner/frames).
|
11
13
|
|
@@ -56,7 +58,7 @@ If you require an even more specific version of Vim, you can pass the path to
|
|
56
58
|
it by instantiating your own `Server` instance like so:
|
57
59
|
|
58
60
|
```ruby
|
59
|
-
Vimrunner::Server.new("/path/to/my/specific/vim").start do |vim|
|
61
|
+
Vimrunner::Server.new(:executable => "/path/to/my/specific/vim").start do |vim|
|
60
62
|
vim.edit "file.txt"
|
61
63
|
end
|
62
64
|
```
|
data/lib/vimrunner/errors.rb
CHANGED
data/lib/vimrunner/server.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "timeout"
|
2
2
|
require "pty"
|
3
|
+
require "open3"
|
3
4
|
|
4
5
|
require "vimrunner/errors"
|
5
6
|
require "vimrunner/client"
|
@@ -17,7 +18,7 @@ module Vimrunner
|
|
17
18
|
# to use a Server directly to invoke --remote commands on its Vim instance.
|
18
19
|
class Server
|
19
20
|
VIMRC = File.expand_path("../../../vim/vimrc", __FILE__)
|
20
|
-
VIMRUNNER_RC = File.expand_path("../../../vim/
|
21
|
+
VIMRUNNER_RC = File.expand_path("../../../vim/vimrunner.vim", __FILE__)
|
21
22
|
|
22
23
|
attr_reader :name, :executable, :vimrc, :gvimrc, :pid
|
23
24
|
|
@@ -168,7 +169,12 @@ module Vimrunner
|
|
168
169
|
end
|
169
170
|
|
170
171
|
def execute(command)
|
171
|
-
|
172
|
+
out, err, status = Open3.capture3(*command)
|
173
|
+
if not err.empty?
|
174
|
+
raise ExecutionError.new("Command failed (#{command}), output: #{err}")
|
175
|
+
end
|
176
|
+
|
177
|
+
out.chomp.gsub(/\A\n/, '')
|
172
178
|
end
|
173
179
|
|
174
180
|
def spawn
|
data/lib/vimrunner/version.rb
CHANGED
@@ -7,11 +7,15 @@ if has_error_handling_bugfix
|
|
7
7
|
let output = ''
|
8
8
|
|
9
9
|
try
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
if exists('*execute')
|
11
|
+
let output = execute(a:command, 'silent')
|
12
|
+
else
|
13
|
+
redir => output
|
14
|
+
silent exe a:command
|
15
|
+
redir END
|
16
|
+
|
17
|
+
let output = s:StripSilencedErrors(output)
|
18
|
+
endif
|
15
19
|
catch
|
16
20
|
let output = v:exception
|
17
21
|
endtry
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vimrunner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Radev
|
8
8
|
- Paul Mucur
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-06-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -59,14 +59,14 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '3.
|
62
|
+
version: '3.7'
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '3.
|
69
|
+
version: '3.7'
|
70
70
|
description: |2
|
71
71
|
Using Vim's client/server functionality, this library exposes a way to
|
72
72
|
spawn a Vim instance and control it programatically. Apart from being a fun
|
@@ -92,11 +92,11 @@ files:
|
|
92
92
|
- lib/vimrunner/testing.rb
|
93
93
|
- lib/vimrunner/version.rb
|
94
94
|
- vim/vimrc
|
95
|
-
- vim/
|
95
|
+
- vim/vimrunner.vim
|
96
96
|
homepage: http://github.com/AndrewRadev/vimrunner
|
97
97
|
licenses: []
|
98
98
|
metadata: {}
|
99
|
-
post_install_message:
|
99
|
+
post_install_message:
|
100
100
|
rdoc_options: []
|
101
101
|
require_paths:
|
102
102
|
- lib
|
@@ -111,9 +111,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: 1.3.6
|
113
113
|
requirements: []
|
114
|
-
|
115
|
-
|
116
|
-
signing_key:
|
114
|
+
rubygems_version: 3.1.6
|
115
|
+
signing_key:
|
117
116
|
specification_version: 4
|
118
117
|
summary: Lets you control a Vim instance through Ruby
|
119
118
|
test_files: []
|