nvim 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/INFO.yaml +1 -1
- data/README.md +6 -2
- data/TODO +2 -0
- data/lib/neovim/connection.rb +19 -0
- data/lib/neovim/host.rb +1 -1
- data/lib/neovim/info.rb +2 -2
- data/lib/neovim/logging.rb +5 -0
- data/lib/neovim/output.rb +31 -0
- data/lib/neovim/tools/calculator.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee36b4c5053b9d05ab3a47d66b5b248aeacc3ffd340b282db719200c298a3fe1
|
4
|
+
data.tar.gz: aa714f06cd14114dfc406afbec1e38ce452ff3cdb935c0f2dfeecba6762c1ec3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7867c1fc7051d1776058d412e71c56f4127d06176fa3b9f0ce744ab2171e738626eb47916dc186551799be637d7eca565a48ed24b19014400818c805548be7d9
|
7
|
+
data.tar.gz: 8913f88061341f6282c05f041e8ac734bb664a775a711e00e1080af97d674a3b38e8988265fdb7d1ab38393615b48b08abd690cf1c8fbd6fa3d703f6d97c876a
|
data/INFO.yaml
CHANGED
data/README.md
CHANGED
@@ -215,17 +215,21 @@ let chan = jobstart('./demo_remote.rb', { 'rpc': v:true })
|
|
215
215
|
Logging is a easy as this:
|
216
216
|
|
217
217
|
```shell
|
218
|
-
export NVIM_RUBY_LOG_LEVEL=all NVIM_RUBY_LOG_FILE=
|
218
|
+
export NVIM_RUBY_LOG_LEVEL=all NVIM_RUBY_LOG_FILE=ruby.log
|
219
219
|
nvim +'ruby puts "hi"*10'
|
220
220
|
```
|
221
221
|
|
222
|
+
If the logfile isn't an absoulte path and doesn't start with `"./"`,
|
223
|
+
it will be relative to Neovim's `stdpath("log")`.
|
224
|
+
|
222
225
|
To show the log levels, simply run in Neovim:
|
223
226
|
|
224
227
|
```vim
|
225
228
|
ruby puts Neovim::Logging::LEVELS.keys
|
226
229
|
```
|
227
230
|
|
228
|
-
If you are inside a [Tmux](https://tmux.github.io), you might prefer to trace
|
231
|
+
If you are inside a [Tmux](https://tmux.github.io), you might prefer to trace
|
232
|
+
the colored log in a split window.
|
229
233
|
|
230
234
|
```shell
|
231
235
|
tmux split-window -fhd 'echo -e "\e[33m==== $$ ==== `tty` ====\e[m" ; ln -sf `tty` /tmp/tmux-`id -u`/debug ; exec cat >/dev/null 2>&1'
|
data/lib/neovim/connection.rb
CHANGED
@@ -113,6 +113,25 @@ module Neovim
|
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
116
|
+
def stdpath what
|
117
|
+
cmd = [ path, "--headless", ]
|
118
|
+
cmd.push "-c", "echo stdpath(#{what.to_s.inspect})"
|
119
|
+
cmd.push "-c", "q"
|
120
|
+
(pipe_stderr cmd)&.tap { |x| x.chomp! }
|
121
|
+
end
|
122
|
+
|
123
|
+
private
|
124
|
+
|
125
|
+
def pipe_stderr cmd
|
126
|
+
re, we = IO.pipe
|
127
|
+
fork do
|
128
|
+
re.close ; $stderr.reopen we ; we.close
|
129
|
+
exec *cmd
|
130
|
+
end
|
131
|
+
we.close
|
132
|
+
re.read
|
133
|
+
end
|
134
|
+
|
116
135
|
end
|
117
136
|
|
118
137
|
end
|
data/lib/neovim/host.rb
CHANGED
data/lib/neovim/info.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
require "neovim/meta.rb"
|
2
2
|
Neovim::INFO = Neovim::Meta.new "nvim",
|
3
|
-
version: "1.
|
3
|
+
version: "1.4.0",
|
4
4
|
license: "BSD-2-Clause+",
|
5
5
|
authors: ["Bertram Scharpf"],
|
6
6
|
email: "software@bertram-scharpf.de",
|
7
7
|
summary: "Yet another Ruby client for Neovim",
|
8
8
|
description: "A simple Ruby client for Neovim.\nClean code, minimal dependecies, no frills, no wokeness.",
|
9
9
|
homepage: "https://github.com/BertramScharpf/ruby-nvim",
|
10
|
-
commit: "
|
10
|
+
commit: "3318cce"
|
data/lib/neovim/logging.rb
CHANGED
@@ -103,6 +103,11 @@ module Neovim
|
|
103
103
|
v = kwargs.delete k
|
104
104
|
params[ k] = v if v
|
105
105
|
end
|
106
|
+
unless path =~ /\A(?:\.\/|~|\/)/ then
|
107
|
+
require "neovim/connection"
|
108
|
+
base = ConnectionChild.stdpath "log"
|
109
|
+
end
|
110
|
+
path = File.expand_path path, base
|
106
111
|
File.open path, "a", **params do |f|
|
107
112
|
yield (new f, **kwargs)
|
108
113
|
end
|
data/lib/neovim/output.rb
CHANGED
@@ -3,6 +3,37 @@
|
|
3
3
|
#
|
4
4
|
|
5
5
|
|
6
|
+
module Kernel
|
7
|
+
|
8
|
+
module_function def system *cmd
|
9
|
+
ro, wo = IO.pipe
|
10
|
+
re, we = IO.pipe
|
11
|
+
child = fork do
|
12
|
+
STDIN.close
|
13
|
+
ro.close ; STDOUT.reopen wo ; wo.close
|
14
|
+
re.close ; STDERR.reopen we ; we.close
|
15
|
+
exec *cmd
|
16
|
+
end
|
17
|
+
wo.close
|
18
|
+
we.close
|
19
|
+
h = { ro => $stdout, re => $stderr, }
|
20
|
+
until h.empty? do
|
21
|
+
h.keys.each { |r|
|
22
|
+
if r.eof? then
|
23
|
+
r.close
|
24
|
+
h.delete r
|
25
|
+
else
|
26
|
+
h[ r].puts r.readline
|
27
|
+
end
|
28
|
+
}
|
29
|
+
end
|
30
|
+
Process.waitpid child
|
31
|
+
$?.success?
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
|
6
37
|
module Neovim
|
7
38
|
|
8
39
|
class Write
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nvim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bertram Scharpf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: software@bertram-scharpf.de
|
@@ -21,6 +21,7 @@ files:
|
|
21
21
|
- LICENSE
|
22
22
|
- README.md
|
23
23
|
- Rakefile
|
24
|
+
- TODO
|
24
25
|
- bin/neovim-ruby-host
|
25
26
|
- lib/neovim.rb
|
26
27
|
- lib/neovim/client.rb
|
@@ -61,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
62
|
- !ruby/object:Gem::Version
|
62
63
|
version: '0'
|
63
64
|
requirements: []
|
64
|
-
rubygems_version: 3.5.
|
65
|
+
rubygems_version: 3.5.22
|
65
66
|
signing_key:
|
66
67
|
specification_version: 4
|
67
68
|
summary: Yet another Ruby client for Neovim
|