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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 158e8a35e42f9dd6fcd0695d45ef7cd60770b504
4
- data.tar.gz: 9bd2ebb4c9ac0833aa2668be2ac559fee53e3fb8
3
+ metadata.gz: 6717c82510d557b7fc3f15bd291654a609ffc53d
4
+ data.tar.gz: e263dccd48b0a244cd67ea6c690eeddd06def246
5
5
  SHA512:
6
- metadata.gz: 16ac27b5a60f05a2d5545d908b3266adebaa279cc88126c21d2656827a108e95e7951b68f595c35cbb6d50d5c7253dbac7d3439268371c15ca7f1a9617aad3fb
7
- data.tar.gz: 3ac3632ff818488690607337e449344756bb8b5bfa66cdd287d8e4362adb2b35a6bd684488d025e60c1dbf67181fd1a796dc0cf028bcc87ddb182e38551a0c5e
6
+ metadata.gz: 6b5b1452da5d319b6587a1dba774de9123df333f9793d3f59cde1f730282f6334193174fd812f68d4c9b90117d39252ffaa9ba16b10db4802fe504516022b0e7
7
+ data.tar.gz: 2b190ba96a1383acbf3ca2b6e968b7ac0a7ffdb9655b3605a2741ab6c7e213f681d178aa2543484501aeef603b9eb0ba8dfd885dbe322851ee7f0f3562cea997
@@ -1,3 +1,8 @@
1
+ # 0.6.2
2
+ - Put IOs into binary mode (fixes windows bugs)
3
+ - Various build fixes for appveyor
4
+ - Update generated docs to v0.2.2
5
+
1
6
  # 0.6.1
2
7
  - Add `multi_json` dependency to fix load error in certain envs
3
8
 
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Neovim Ruby
2
2
 
3
3
  [![Travis](https://travis-ci.org/alexgenco/neovim-ruby.svg?branch=master)](https://travis-ci.org/alexgenco/neovim-ruby)
4
+ [![Build status](https://ci.appveyor.com/api/projects/status/wp7agvgcxxcguj6h/branch/master?svg=true)](https://ci.appveyor.com/project/alexgenco/neovim-ruby/branch/master)
4
5
  [![Coverage Status](https://coveralls.io/repos/alexgenco/neovim-ruby/badge.svg)](https://coveralls.io/r/alexgenco/neovim-ruby)
5
6
  [![Code Climate](https://codeclimate.com/github/alexgenco/neovim-ruby/badges/gpa.svg)](https://codeclimate.com/github/alexgenco/neovim-ruby)
6
7
  [![Gem Version](https://badge.fury.io/rb/neovim.svg)](https://badge.fury.io/rb/neovim)
@@ -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
@@ -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.1
7
+ # The methods documented here were generated using NVIM v0.2.2
8
8
  class Buffer < RemoteObject
9
9
  attr_reader :lines
10
10
 
@@ -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.1
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=rd)
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
 
@@ -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.1
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
@@ -1,3 +1,3 @@
1
1
  module Neovim
2
- VERSION = Gem::Version.new("0.6.1")
2
+ VERSION = Gem::Version.new("0.6.2")
3
3
  end
@@ -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.1
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
  #
@@ -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.0"
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"
@@ -27,7 +27,7 @@ Then:
27
27
 
28
28
  Execute (Change the working directory explicitly):
29
29
  cd /
30
- ruby Vim.command("let g:ruby_pwd = '#{Dir.pwd}'")
30
+ ruby Vim.command("let g:ruby_pwd = '#{Dir.pwd.sub(/^C:/, '')}'")
31
31
  cd -
32
32
 
33
33
  Then:
@@ -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("\n").last.split[2]
48
+ compl = attrs.split($/).last.split[2]
49
49
  nvim.set_var("rplugin_command_completion", compl)
50
50
  end
51
51
 
@@ -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(response["name"])
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(nil, wr)
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
- File.open(Support.file_path("io"), "w+") do |io|
18
- connection = Connection.new(nil, io)
19
- big_data = Array.new(1024 * 16) { SecureRandom.hex(4) }.join
19
+ port = Support.tcp_port
20
+
21
+ server_thr = Thread.new do
22
+ read_result = ""
20
23
 
21
- connection = Connection.new(nil, io)
22
- connection.write(big_data)
24
+ TCPServer.open("127.0.0.1", port) do |server|
25
+ client = server.accept
23
26
 
24
- expect(File.read(io.path)).to eq(big_data)
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, nil)
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("/dev/null")
24
+ executable = Executable.new(File::NULL)
25
25
 
26
26
  expect {
27
27
  executable.version
28
- }.to raise_error(Executable::Error, /\/dev\/null/)
28
+ }.to raise_error(Executable::Error, Regexp.new(File::NULL))
29
29
  end
30
30
  end
31
31
  end
@@ -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" => "0.0.0.0:#{port}"}
8
- pid = Process.spawn(env, *Support.child_argv, [:out, :err] => "/dev/null")
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("0.0.0.0", port)
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
- Process.kill(:TERM, pid)
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] => "/dev/null")
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
- Process.kill(:TERM, pid)
44
+ Support.kill(pid)
41
45
  Process.waitpid(pid)
42
46
  end
43
47
  end
@@ -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.1
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-13 00:00:00.000000000 Z
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.0'
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.0'
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