vimrunner 0.3.4 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/vimrc +2 -0
- data/vim/{vimrunner_rc → vimrunner.vim} +9 -5
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5ba5ff396953188583a9254d735dd16e1158c8a1bb5b2b7fe3c425201e4912e7
|
4
|
+
data.tar.gz: 4a01f7fa5ebcbd22e57b6331ef4cf900db8b611e6f3dacdf018141d3dec74f33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: beec82a73e8a2b503a1b0515b60fb8dc453898f8b5a8b11550b2b0127be0375908f2a79b1a110aaa0c61c26a7812b79f9733ecc92ed26d0af585c3f8d4c8da85
|
7
|
+
data.tar.gz: ec2651366b35ceeb5e871ecf82f933f49ab42bf09878719d385b89fb4e35204ef9ee615ef23d7831538e4d053910c357f7aeb89682cea899996f12738029beef
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Vimrunner [](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
|
+

|
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
data/vim/vimrc
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.6
|
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: 2024-12-21 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,12 @@ 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
|
-
licenses:
|
97
|
+
licenses:
|
98
|
+
- MIT
|
98
99
|
metadata: {}
|
99
|
-
post_install_message:
|
100
|
+
post_install_message:
|
100
101
|
rdoc_options: []
|
101
102
|
require_paths:
|
102
103
|
- lib
|
@@ -111,9 +112,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
112
|
- !ruby/object:Gem::Version
|
112
113
|
version: 1.3.6
|
113
114
|
requirements: []
|
114
|
-
|
115
|
-
|
116
|
-
signing_key:
|
115
|
+
rubygems_version: 3.5.17
|
116
|
+
signing_key:
|
117
117
|
specification_version: 4
|
118
118
|
summary: Lets you control a Vim instance through Ruby
|
119
119
|
test_files: []
|