nrepl-lazuli 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01bda1a2be06171508f3a03d476dd5d108939b703af0b039fd4e050a07622c1f
4
- data.tar.gz: f85343da3cce42d114abbb1141705fa46aee8dcebe4b18198ef983a127cc2455
3
+ metadata.gz: e8c7b738b28d8706af9ab59acf572433ead185ba273a7112628cff68c8125c7f
4
+ data.tar.gz: 9c7aac117b7990da308c140a00623c5e8fa641c10e1caa72c68105dd8606ffad
5
5
  SHA512:
6
- metadata.gz: 153895cd6a45830613cf7ebb0b7fa4fb61e45e8ee4d588e5d60b02669c12f5d3469a520e4fa80b0f9690785337e15d6db80ec2084c3330e8c609beb39ca268cb
7
- data.tar.gz: b5a887a6b2fe214476828fbdd600d4d3be16846074e7e01e371d5a85f72253730e3e8ee3046effa7897a9e115f3a7d02cfa79e4917f5f04901caa963f87ae3c6
6
+ metadata.gz: 667c1a317abc19e990c5c8d98426101ec26145e0d2c468d089714739844ea8d8acad01aaf4b048552a6198a0d3505ac4d29e7898dde42c1a4898712143bf726c
7
+ data.tar.gz: e4c9bb03661a59935a37d77dc348beb0053e99776aacdf10b89a83694dbc7eddd4d14cb27ccbe352921de332d8bdbeeb144a245a8285a424715aec9407b15adf
@@ -1,18 +1,46 @@
1
1
  module NREPL
2
2
  class FakeStdout
3
- def initialize(connections, kind)
3
+ def initialize(connections, io, kind)
4
4
  @connections = connections
5
+ @io = io
5
6
  @kind = kind
6
7
  end
7
8
 
9
+ def <<(text)
10
+ print(text)
11
+ end
12
+
13
+ def print(text)
14
+ write(text.to_s)
15
+ end
16
+
17
+ def puts(text)
18
+ write("#{text}\n")
19
+ end
20
+
8
21
  def write(text)
9
- STDOUT.write "#{@connections}\n"
10
- STDOUT.write(text)
22
+ @io.write(text)
11
23
  @connections.each do |conn|
12
24
  conn.send_msg(
13
25
  @kind => text
14
26
  )
15
27
  end
16
28
  end
29
+
30
+ def flush
31
+ @io.flush
32
+ end
33
+
34
+ def close
35
+ @io.close
36
+ end
37
+
38
+ def sync
39
+ @io.sync
40
+ end
41
+
42
+ def sync=(val)
43
+ @io.sync = val
44
+ end
17
45
  end
18
46
  end
data/lib/nrepl/server.rb CHANGED
@@ -36,8 +36,8 @@ module NREPL
36
36
  puts "Running in debug mode" if debug?
37
37
  record_port
38
38
 
39
- $stdout = FakeStdout.new(@connections, "out")
40
- $stderr = FakeStdout.new(@connections, "err")
39
+ $stdout = FakeStdout.new(@connections, STDOUT, "out")
40
+ $stderr = FakeStdout.new(@connections, STDERR, "err")
41
41
 
42
42
  Signal.trap("INT") { stop }
43
43
  Signal.trap("TERM") { stop }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nrepl-lazuli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
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-03-17 00:00:00.000000000 Z
11
+ date: 2024-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bencode
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  requirements: []
57
- rubygems_version: 3.4.10
57
+ rubygems_version: 3.5.3
58
58
  signing_key:
59
59
  specification_version: 4
60
60
  summary: A Ruby nREPL server