rspec-interactive 0.9.11 → 0.9.12
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/rspec-interactive +2 -2
- data/lib/rspec-interactive/version.rb +1 -1
- data/lib/rspec-interactive.rb +24 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d723a8386eb4ed50df0bde9d90efacb2a8d6472f06faefa711afca46bdd87ae5
|
4
|
+
data.tar.gz: 79c582d886cc31909d7f43c46ec5f9cfffdc8d8f3f9371e85d4e15d496c9cf43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2bf91dd9111564260b331113842d0fc39991908f8e7707a91589ce6ddaee5ece21916f1aee89c70719cbb0da7854b668dca998f4caa17f488d6f8097e705d81
|
7
|
+
data.tar.gz: 3d24e2e9c3b7b17f87dd56252346b94e78da69abf023889d23b8e89258c8970ad239aebb91f6e507d0dd441a252636240147d70fcfb7a4a0fe93259be6a22fea
|
data/Gemfile.lock
CHANGED
data/bin/rspec-interactive
CHANGED
@@ -5,7 +5,7 @@ require 'rspec-interactive'
|
|
5
5
|
|
6
6
|
@options = {
|
7
7
|
server: true,
|
8
|
-
|
8
|
+
port: RSpec::Interactive::DEFAULT_PORT
|
9
9
|
}
|
10
10
|
|
11
11
|
parser = OptionParser.new do |opts|
|
@@ -26,4 +26,4 @@ parser = OptionParser.new do |opts|
|
|
26
26
|
|
27
27
|
end.parse!
|
28
28
|
|
29
|
-
RSpec::Interactive.start(config_file: @options[:config_file], server: @options[:server], port: @options[:
|
29
|
+
RSpec::Interactive.start(config_file: @options[:config_file], server: @options[:server], port: @options[:port])
|
data/lib/rspec-interactive.rb
CHANGED
@@ -64,9 +64,15 @@ module RSpec
|
|
64
64
|
|
65
65
|
@startup_thread = Thread.start do
|
66
66
|
Thread.current.report_on_exception = false
|
67
|
+
|
67
68
|
if server
|
68
69
|
@server_thread = Thread.start do
|
69
|
-
|
70
|
+
begin
|
71
|
+
server = TCPServer.new port
|
72
|
+
rescue StandardError => e
|
73
|
+
log_exception(@output_stream, e)
|
74
|
+
exit 1
|
75
|
+
end
|
70
76
|
|
71
77
|
while true
|
72
78
|
break unless client = server.accept
|
@@ -91,9 +97,12 @@ module RSpec
|
|
91
97
|
@startup_output = StringOutput.new
|
92
98
|
output = ThreadedOutput.new(thread_map: { Thread.current => @startup_output }, default: @output_stream)
|
93
99
|
|
100
|
+
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
94
101
|
Stdio.capture(stdout: output, stderr: output) do
|
95
102
|
@config_cache.record_configuration { @configuration.configure_rspec.call }
|
96
103
|
end
|
104
|
+
finish = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
105
|
+
@startup_duration = (finish - start).round
|
97
106
|
end
|
98
107
|
|
99
108
|
Pry.start
|
@@ -288,13 +297,23 @@ module RSpec
|
|
288
297
|
def self.await_startup(output: @output_stream)
|
289
298
|
return true unless @startup_thread
|
290
299
|
|
300
|
+
waited = false
|
291
301
|
if @startup_thread.alive?
|
292
302
|
output.puts 'waiting for configure_rspec...'
|
303
|
+
waited = true
|
293
304
|
end
|
294
305
|
|
295
306
|
begin
|
296
307
|
@startup_thread.join
|
297
308
|
@startup_thread = nil
|
309
|
+
if waited
|
310
|
+
if @startup_duration == 1
|
311
|
+
output.puts("configure_rspec took 1 second")
|
312
|
+
else
|
313
|
+
output.puts("configure_rspec took #{@startup_duration} seconds")
|
314
|
+
end
|
315
|
+
end
|
316
|
+
|
298
317
|
print_startup_output(output: output)
|
299
318
|
true
|
300
319
|
rescue Interrupt
|
@@ -313,9 +332,11 @@ module RSpec
|
|
313
332
|
end
|
314
333
|
|
315
334
|
def self.print_startup_output(output: @output_stream)
|
316
|
-
return if @startup_output.nil?
|
335
|
+
return if @startup_output.nil?
|
317
336
|
|
318
|
-
|
337
|
+
unless @startup_output.string.empty?
|
338
|
+
output.puts(@startup_output.string)
|
339
|
+
end
|
319
340
|
@startup_output = nil
|
320
341
|
end
|
321
342
|
|