repla 0.10.3 → 0.10.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/repla/repl.rb +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c5bb078d192626bf96e7ed37e701c8c42507189
|
4
|
+
data.tar.gz: 2e51addfbc888c3977179d23eaf98a79fb4f7dda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb222af0dd2460b9395dacf1228f3b5cc97dbb762be93fa400804ec335a7d9360b496dfa8c6ebc2730a4a6a291954658f3044bfa2dd6df79c573410cc07d7b54
|
7
|
+
data.tar.gz: e573f4bb1db46f5bfaa497f06a42d77c2c9c284a055fdda56ee9d856259b367722bb2160bcfd431258fa62fd228abe3a7ff5b5f6dcc8e645eaac4ae3fbec22c2
|
data/lib/repla/repl.rb
CHANGED
@@ -12,6 +12,7 @@ module Repla
|
|
12
12
|
require 'pty'
|
13
13
|
|
14
14
|
def initialize(command)
|
15
|
+
@mutex = Mutex.new
|
15
16
|
PTY.spawn(command) do |output, input, _pid|
|
16
17
|
Thread.new do
|
17
18
|
output.each do |line|
|
@@ -42,7 +43,10 @@ module Repla
|
|
42
43
|
end
|
43
44
|
|
44
45
|
def view
|
45
|
-
@
|
46
|
+
@mutex.synchronize do
|
47
|
+
@view = View.new if @view.nil?
|
48
|
+
end
|
49
|
+
@view
|
46
50
|
end
|
47
51
|
end
|
48
52
|
end
|