repla 0.10.3 → 0.10.4

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repla/repl.rb +5 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab0d680f0075d86c672570786fcc63e40ba5a6da
4
- data.tar.gz: d9341f31b3447b8c5f155e86b3c33f090612f018
3
+ metadata.gz: 5c5bb078d192626bf96e7ed37e701c8c42507189
4
+ data.tar.gz: 2e51addfbc888c3977179d23eaf98a79fb4f7dda
5
5
  SHA512:
6
- metadata.gz: ff036eefc59b9bea70b414785a5754c7956266087e00f69b7ab3c5b829fb0fbd4bc1efb65252cb1e4f9aaff49e73791d9b570bde6fe0ed4a6393c050b30feda0
7
- data.tar.gz: 94a25b49c33d510fd27b7cb4623e7bc4bd1c0cfc784ec9b61dac7dbcd195caa7ff6133c37df09e2fbde99c91f7a04a84dd473f7376cdbc1888c61d008ff25328
6
+ metadata.gz: cb222af0dd2460b9395dacf1228f3b5cc97dbb762be93fa400804ec335a7d9360b496dfa8c6ebc2730a4a6a291954658f3044bfa2dd6df79c573410cc07d7b54
7
+ data.tar.gz: e573f4bb1db46f5bfaa497f06a42d77c2c9c284a055fdda56ee9d856259b367722bb2160bcfd431258fa62fd228abe3a7ff5b5f6dcc8e645eaac4ae3fbec22c2
@@ -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
- @view ||= View.new
46
+ @mutex.synchronize do
47
+ @view = View.new if @view.nil?
48
+ end
49
+ @view
46
50
  end
47
51
  end
48
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: repla
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.3
4
+ version: 0.10.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roben Kleene