neovim 0.6.1 → 0.6.2
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -0
- data/appveyor.yml +21 -0
- data/lib/neovim/buffer.rb +1 -1
- data/lib/neovim/client.rb +1 -1
- data/lib/neovim/event_loop/connection.rb +5 -5
- data/lib/neovim/tabpage.rb +1 -1
- data/lib/neovim/version.rb +1 -1
- data/lib/neovim/window.rb +1 -1
- data/neovim.gemspec +1 -1
- data/spec/acceptance/ruby_spec.vim +1 -1
- data/spec/acceptance/rubyfile/set_pwd_before.rb +1 -1
- data/spec/acceptance/runtime/init.vim +2 -2
- data/spec/acceptance/runtime/rplugin/ruby/commands.rb +1 -1
- data/spec/acceptance_spec.rb +10 -2
- data/spec/neovim/event_loop/connection_spec.rb +35 -9
- data/spec/neovim/executable_spec.rb +2 -2
- data/spec/neovim_spec.rb +10 -6
- data/spec/support.rb +8 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6717c82510d557b7fc3f15bd291654a609ffc53d
|
4
|
+
data.tar.gz: e263dccd48b0a244cd67ea6c690eeddd06def246
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b5b1452da5d319b6587a1dba774de9123df333f9793d3f59cde1f730282f6334193174fd812f68d4c9b90117d39252ffaa9ba16b10db4802fe504516022b0e7
|
7
|
+
data.tar.gz: 2b190ba96a1383acbf3ca2b6e968b7ac0a7ffdb9655b3605a2741ab6c7e213f681d178aa2543484501aeef603b9eb0ba8dfd885dbe322851ee7f0f3562cea997
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Neovim Ruby
|
2
2
|
|
3
3
|
[](https://travis-ci.org/alexgenco/neovim-ruby)
|
4
|
+
[](https://ci.appveyor.com/project/alexgenco/neovim-ruby/branch/master)
|
4
5
|
[](https://coveralls.io/r/alexgenco/neovim-ruby)
|
5
6
|
[](https://codeclimate.com/github/alexgenco/neovim-ruby)
|
6
7
|
[](https://badge.fury.io/rb/neovim)
|
data/appveyor.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
install:
|
2
|
+
- set PATH=C:\Ruby24-x64\bin;C:\tools\neovim\Neovim\bin;%PATH%
|
3
|
+
- set NVIM_RUBY_LOG_LEVEL=DEBUG
|
4
|
+
- set NVIM_RUBY_LOG_FILE=%cd%\ci.log
|
5
|
+
- choco install neovim --pre -fy --ignore-dependencies
|
6
|
+
- bundle install
|
7
|
+
|
8
|
+
build: off
|
9
|
+
|
10
|
+
branches:
|
11
|
+
only:
|
12
|
+
- master
|
13
|
+
|
14
|
+
before_test:
|
15
|
+
- ruby -v
|
16
|
+
- gem -v
|
17
|
+
- bundle -v
|
18
|
+
- nvim -v
|
19
|
+
|
20
|
+
test_script:
|
21
|
+
- bundle exec rake
|
data/lib/neovim/buffer.rb
CHANGED
@@ -4,7 +4,7 @@ require "neovim/line_range"
|
|
4
4
|
module Neovim
|
5
5
|
# Class representing an +nvim+ buffer.
|
6
6
|
#
|
7
|
-
# The methods documented here were generated using NVIM v0.2.
|
7
|
+
# The methods documented here were generated using NVIM v0.2.2
|
8
8
|
class Buffer < RemoteObject
|
9
9
|
attr_reader :lines
|
10
10
|
|
data/lib/neovim/client.rb
CHANGED
@@ -8,7 +8,7 @@ module Neovim
|
|
8
8
|
# +RemoteObject+ subclasses (i.e. +Buffer+, +Window+, or +Tabpage+),
|
9
9
|
# which similarly have dynamically generated interfaces.
|
10
10
|
#
|
11
|
-
# The methods documented here were generated using NVIM v0.2.
|
11
|
+
# The methods documented here were generated using NVIM v0.2.2
|
12
12
|
#
|
13
13
|
# @see Buffer
|
14
14
|
# @see Window
|
@@ -11,12 +11,12 @@ module Neovim
|
|
11
11
|
|
12
12
|
def self.tcp(host, port)
|
13
13
|
socket = Socket.tcp(host, port)
|
14
|
-
new(socket)
|
14
|
+
new(socket, socket)
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.unix(path)
|
18
18
|
socket = Socket.unix(path)
|
19
|
-
new(socket)
|
19
|
+
new(socket, socket)
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.child(_argv)
|
@@ -26,15 +26,15 @@ module Neovim
|
|
26
26
|
Process.detach(_io.pid)
|
27
27
|
end
|
28
28
|
|
29
|
-
new(io)
|
29
|
+
new(io, io)
|
30
30
|
end
|
31
31
|
|
32
32
|
def self.stdio
|
33
33
|
new(STDIN, STDOUT)
|
34
34
|
end
|
35
35
|
|
36
|
-
def initialize(rd, wr
|
37
|
-
@rd, @wr = rd, wr
|
36
|
+
def initialize(rd, wr)
|
37
|
+
@rd, @wr = [rd, wr].map(&:binmode)
|
38
38
|
@running = false
|
39
39
|
end
|
40
40
|
|
data/lib/neovim/tabpage.rb
CHANGED
@@ -3,7 +3,7 @@ require "neovim/remote_object"
|
|
3
3
|
module Neovim
|
4
4
|
# Class representing an +nvim+ tabpage.
|
5
5
|
#
|
6
|
-
# The methods documented here were generated using NVIM v0.2.
|
6
|
+
# The methods documented here were generated using NVIM v0.2.2
|
7
7
|
class Tabpage < RemoteObject
|
8
8
|
# The following methods are dynamically generated.
|
9
9
|
=begin
|
data/lib/neovim/version.rb
CHANGED
data/lib/neovim/window.rb
CHANGED
@@ -3,7 +3,7 @@ require "neovim/remote_object"
|
|
3
3
|
module Neovim
|
4
4
|
# Class representing an +nvim+ window.
|
5
5
|
#
|
6
|
-
# The methods documented here were generated using NVIM v0.2.
|
6
|
+
# The methods documented here were generated using NVIM v0.2.2
|
7
7
|
class Window < RemoteObject
|
8
8
|
# Get the buffer displayed in the window
|
9
9
|
#
|
data/neovim.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^spec/})
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.add_dependency "msgpack", "~> 1.
|
20
|
+
spec.add_dependency "msgpack", "~> 1.1"
|
21
21
|
spec.add_dependency "multi_json", "~> 1.0"
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler"
|
@@ -1 +1 @@
|
|
1
|
-
Vim.command("let g:pwd_before = '#{Dir.pwd}'")
|
1
|
+
Vim.command("let g:pwd_before = '#{Dir.pwd.sub(/^C:/, '')}'")
|
@@ -1,5 +1,5 @@
|
|
1
|
-
let s:lib_path = getcwd() . "/../../lib
|
2
|
-
let s:bin_path = getcwd() . "/../../bin/neovim-ruby-host"
|
1
|
+
let s:lib_path = fnamemodify(getcwd() . "/../../lib", ":p")
|
2
|
+
let s:bin_path = fnamemodify(getcwd() . "/../../bin/neovim-ruby-host", ":p")
|
3
3
|
let g:ruby_host_prog = printf("ruby -I %s %s", s:lib_path, s:bin_path)
|
4
4
|
|
5
5
|
ruby require "rspec/expectations"
|
@@ -45,7 +45,7 @@ Neovim.plugin do |plug|
|
|
45
45
|
|
46
46
|
plug.command(:RPluginCommandCompletion, :complete => "buffer") do |nvim|
|
47
47
|
attrs = nvim.command_output("silent command RPluginCommandCompletion")
|
48
|
-
compl = attrs.split(
|
48
|
+
compl = attrs.split($/).last.split[2]
|
49
49
|
nvim.set_var("rplugin_command_completion", compl)
|
50
50
|
end
|
51
51
|
|
data/spec/acceptance_spec.rb
CHANGED
@@ -26,6 +26,13 @@ RSpec.describe "Acceptance", :timeout => 10 do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
describe "Remote plugin DSL" do
|
29
|
+
before do
|
30
|
+
run_nvim(
|
31
|
+
{"NVIM_RPLUGIN_MANIFEST" => manifest},
|
32
|
+
"-c", "silent UpdateRemotePlugins", "-c", "qa!"
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
29
36
|
["command", "function", "autocmd"].each do |feature|
|
30
37
|
specify "##{feature}" do
|
31
38
|
run_vader("rplugin_#{feature}_spec.vim") do |status, output|
|
@@ -40,16 +47,17 @@ RSpec.describe "Acceptance", :timeout => 10 do
|
|
40
47
|
begin
|
41
48
|
url = "https://api.github.com/repos/neovim/neovim/releases/latest"
|
42
49
|
response = open(url) { |json| JSON.load(json) }
|
50
|
+
release_version = response["name"][/NVIM v?(.+)$/, 1]
|
43
51
|
|
44
52
|
client_file = File.read(
|
45
53
|
File.expand_path("../../lib/neovim/client.rb", __FILE__)
|
46
54
|
)
|
47
55
|
docs_version = client_file[
|
48
|
-
/The methods documented here were generated using (.+)$/,
|
56
|
+
/The methods documented here were generated using NVIM v?(.+)$/,
|
49
57
|
1
|
50
58
|
]
|
51
59
|
|
52
|
-
expect(docs_version).to eq(
|
60
|
+
expect(docs_version).to eq(release_version)
|
53
61
|
rescue SocketError, OpenURI::HTTPError => e
|
54
62
|
skip "Skipping: #{e}"
|
55
63
|
end
|
@@ -3,10 +3,12 @@ require "helper"
|
|
3
3
|
module Neovim
|
4
4
|
class EventLoop
|
5
5
|
RSpec.describe Connection do
|
6
|
+
let(:nil_io) { StringIO.new }
|
7
|
+
|
6
8
|
describe "#write" do
|
7
9
|
it "writes to the underlying file descriptor" do
|
8
10
|
rd, wr = IO.pipe
|
9
|
-
connection = Connection.new(
|
11
|
+
connection = Connection.new(nil_io, wr)
|
10
12
|
connection.write("some data")
|
11
13
|
wr.close
|
12
14
|
|
@@ -14,15 +16,39 @@ module Neovim
|
|
14
16
|
end
|
15
17
|
|
16
18
|
it "writes large amounts of data" do
|
17
|
-
|
18
|
-
|
19
|
-
|
19
|
+
port = Support.tcp_port
|
20
|
+
|
21
|
+
server_thr = Thread.new do
|
22
|
+
read_result = ""
|
20
23
|
|
21
|
-
|
22
|
-
|
24
|
+
TCPServer.open("127.0.0.1", port) do |server|
|
25
|
+
client = server.accept
|
23
26
|
|
24
|
-
|
27
|
+
loop do
|
28
|
+
begin
|
29
|
+
read_result << client.readpartial(1024 * 16)
|
30
|
+
rescue EOFError
|
31
|
+
break
|
32
|
+
end
|
33
|
+
end
|
34
|
+
client.close
|
35
|
+
end
|
36
|
+
|
37
|
+
read_result
|
25
38
|
end
|
39
|
+
|
40
|
+
begin
|
41
|
+
socket = Socket.tcp("127.0.0.1", port)
|
42
|
+
rescue Errno::ECONNREFUSED
|
43
|
+
retry
|
44
|
+
end
|
45
|
+
|
46
|
+
big_data = Array.new(1024 * 16) { SecureRandom.hex(4) }.join
|
47
|
+
connection = Connection.new(nil_io, socket)
|
48
|
+
|
49
|
+
connection.write(big_data)
|
50
|
+
socket.close
|
51
|
+
expect(server_thr.value).to eq(big_data)
|
26
52
|
end
|
27
53
|
end
|
28
54
|
|
@@ -32,7 +58,7 @@ module Neovim
|
|
32
58
|
wr.write("some data")
|
33
59
|
wr.close
|
34
60
|
|
35
|
-
connection = Connection.new(rd,
|
61
|
+
connection = Connection.new(rd, nil_io)
|
36
62
|
|
37
63
|
expect do |y|
|
38
64
|
connection.read(&y)
|
@@ -54,7 +80,7 @@ module Neovim
|
|
54
80
|
pid = io.pid
|
55
81
|
expect(pid).to respond_to(:to_int)
|
56
82
|
|
57
|
-
Connection.new(io).close
|
83
|
+
Connection.new(io, nil_io).close
|
58
84
|
expect { Process.kill(0, pid) }.to raise_error(Errno::ESRCH)
|
59
85
|
end
|
60
86
|
end
|
@@ -21,11 +21,11 @@ module Neovim
|
|
21
21
|
end
|
22
22
|
|
23
23
|
it "raises with an invalid executable path" do
|
24
|
-
executable = Executable.new(
|
24
|
+
executable = Executable.new(File::NULL)
|
25
25
|
|
26
26
|
expect {
|
27
27
|
executable.version
|
28
|
-
}.to raise_error(Executable::Error,
|
28
|
+
}.to raise_error(Executable::Error, Regexp.new(File::NULL))
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
data/spec/neovim_spec.rb
CHANGED
@@ -4,11 +4,11 @@ RSpec.describe Neovim do
|
|
4
4
|
describe ".attach_tcp" do
|
5
5
|
it "attaches to a TCP socket" do
|
6
6
|
port = Support.tcp_port
|
7
|
-
env = {"NVIM_LISTEN_ADDRESS" => "
|
8
|
-
pid = Process.spawn(env, *Support.child_argv, [:out, :err] =>
|
7
|
+
env = {"NVIM_LISTEN_ADDRESS" => "127.0.0.1:#{port}"}
|
8
|
+
pid = Process.spawn(env, *Support.child_argv, [:out, :err] => File::NULL)
|
9
9
|
|
10
10
|
begin
|
11
|
-
client = Neovim.attach_tcp("
|
11
|
+
client = Neovim.attach_tcp("127.0.0.1", port)
|
12
12
|
rescue Errno::ECONNREFUSED
|
13
13
|
retry
|
14
14
|
end
|
@@ -16,17 +16,21 @@ RSpec.describe Neovim do
|
|
16
16
|
begin
|
17
17
|
expect(client.strwidth("hi")).to eq(2)
|
18
18
|
ensure
|
19
|
-
|
19
|
+
Support.kill(pid)
|
20
20
|
Process.waitpid(pid)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
describe ".attach_unix" do
|
26
|
+
before do
|
27
|
+
skip("Not supported on this platform") if Support.windows?
|
28
|
+
end
|
29
|
+
|
26
30
|
it "attaches to a UNIX socket" do
|
27
31
|
socket_path = Support.socket_path
|
28
32
|
env = {"NVIM_LISTEN_ADDRESS" => socket_path}
|
29
|
-
pid = Process.spawn(env, *Support.child_argv, [:out, :err] =>
|
33
|
+
pid = Process.spawn(env, *Support.child_argv, [:out, :err] => File::NULL)
|
30
34
|
|
31
35
|
begin
|
32
36
|
client = Neovim.attach_unix(socket_path)
|
@@ -37,7 +41,7 @@ RSpec.describe Neovim do
|
|
37
41
|
begin
|
38
42
|
expect(client.strwidth("hi")).to eq(2)
|
39
43
|
ensure
|
40
|
-
|
44
|
+
Support.kill(pid)
|
41
45
|
Process.waitpid(pid)
|
42
46
|
end
|
43
47
|
end
|
data/spec/support.rb
CHANGED
@@ -37,6 +37,14 @@ module Support
|
|
37
37
|
[Neovim.executable.path, "--headless", "-i", "NONE", "-u", "NONE", "-n"]
|
38
38
|
end
|
39
39
|
|
40
|
+
def self.windows?
|
41
|
+
Gem.win_platform?
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.kill(pid)
|
45
|
+
windows? ? Process.kill(:KILL, pid) : Process.kill(:TERM, pid)
|
46
|
+
end
|
47
|
+
|
40
48
|
begin
|
41
49
|
self.nvim_version = Neovim.executable.version
|
42
50
|
rescue => e
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neovim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Genco
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: multi_json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -113,6 +113,7 @@ files:
|
|
113
113
|
- LICENSE.txt
|
114
114
|
- README.md
|
115
115
|
- Rakefile
|
116
|
+
- appveyor.yml
|
116
117
|
- bin/neovim-ruby-host
|
117
118
|
- lib/neovim.rb
|
118
119
|
- lib/neovim/api.rb
|