nrepl-lazuli 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nrepl-lazuli/connection.rb +8 -2
- data/lib/nrepl-lazuli/server.rb +13 -3
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c38f3cd330d07e579fff5971c656a12c4ee9f9a1488aba33d8183dd80b1236c
|
4
|
+
data.tar.gz: a63be29edddccc449e4a5bbdd9f80a05e2fb2fa0b3ca0b271ee50830da521118
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d75413ea25c513b6107daacd4f4128649c7696fc170f8536d8f636a166ce5fcb9ba675a4c218de9b9ec906f488c7cc9dfbdd48afbce0e828677d08c0bc96283
|
7
|
+
data.tar.gz: a3bb98a1bc7d9ba46d9bbc0cd1ea3b30dfa186da9444a80acf03015c427430962d4bf3f14dfc0d695b7050fe8caf632b14c1bac0a92edbe65ee9fd0f04a803c5
|
@@ -16,10 +16,11 @@ module NREPL
|
|
16
16
|
@binding = binding
|
17
17
|
@bindings = bindings
|
18
18
|
@bindings_by_id = bindings_by_id
|
19
|
+
@retries = 0
|
19
20
|
end
|
20
21
|
|
21
22
|
def treat_messages!
|
22
|
-
bencode = BEncode
|
23
|
+
bencode = BEncode.new(@in)
|
23
24
|
loop do
|
24
25
|
break if @in.eof?
|
25
26
|
msg = bencode.parse!
|
@@ -30,6 +31,8 @@ module NREPL
|
|
30
31
|
@pending_evals.each { |(i, _)| clear_eval!(i) }
|
31
32
|
rescue Errno::ECONNRESET
|
32
33
|
@pending_evals.each { |(i, _)| clear_eval!(i) }
|
34
|
+
rescue => e
|
35
|
+
STDOUT.puts "CRASH! #{e}"
|
33
36
|
end
|
34
37
|
|
35
38
|
def treat_msg(msg)
|
@@ -296,8 +299,11 @@ module NREPL
|
|
296
299
|
|
297
300
|
def send_msg(msg)
|
298
301
|
debug "Sending", msg
|
299
|
-
@out.
|
302
|
+
@out.write_nonblock(BEncode.encode(msg))
|
300
303
|
@out.flush
|
304
|
+
rescue IO::EAGAINWaitWritable
|
305
|
+
@retries += 1
|
306
|
+
@out.close if @retries > 50
|
301
307
|
end
|
302
308
|
end
|
303
309
|
end
|
data/lib/nrepl-lazuli/server.rb
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
# A Ruby port of ogion https://gitlab.com/technomancy/ogion &
|
4
4
|
# https://github.com/borkdude/nrepl-server/blob/master/src/borkdude/nrepl_server.clj
|
5
5
|
|
6
|
-
require 'bencode'
|
7
6
|
require 'socket'
|
7
|
+
require_relative 'bencode'
|
8
8
|
require_relative 'connection'
|
9
9
|
require_relative 'fake_stdout'
|
10
10
|
|
@@ -43,8 +43,18 @@ module NREPL
|
|
43
43
|
@debug = debug
|
44
44
|
@connections = Set.new
|
45
45
|
@binding = binding
|
46
|
-
|
47
|
-
|
46
|
+
loc = caller_locations.reject { |x| x.absolute_path =~ /nrepl\-lazuli/ }[0]
|
47
|
+
loc = caller_locations[0] if(!loc)
|
48
|
+
path = loc.absolute_path
|
49
|
+
line = loc.lineno - 1
|
50
|
+
@bindings = {path => {line => {"NREPL::Server.start" => binding}}}
|
51
|
+
@bindings_by_id = {
|
52
|
+
"NREPL::Server.start" => {
|
53
|
+
binding: binding,
|
54
|
+
file: path,
|
55
|
+
row: line
|
56
|
+
}
|
57
|
+
}
|
48
58
|
@tracing = tracing
|
49
59
|
Thread.current[:nrepl_server] = self
|
50
60
|
NREPL.class_variable_set(:@@connections, @connections)
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nrepl-lazuli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maurício Szabo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bencode
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 0.8.2
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - '='
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 0.8.2
|
11
|
+
date: 2024-11-13 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
27
13
|
description: A Ruby nREPL server, made to be used with Lazuli plug-in (but can be
|
28
14
|
used with any nREPL client too)
|
29
15
|
email: mauricio@szabo.link
|
@@ -55,7 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
41
|
- !ruby/object:Gem::Version
|
56
42
|
version: '0'
|
57
43
|
requirements: []
|
58
|
-
rubygems_version: 3.5.
|
44
|
+
rubygems_version: 3.5.11
|
59
45
|
signing_key:
|
60
46
|
specification_version: 4
|
61
47
|
summary: A Ruby nREPL server
|