rspec-interactive 0.9.11 → 0.9.12

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: 8cced0f02ca892c718d8df21ce4098fb6ef1f8b2f2845e9795811147ee9b4bc0
4
- data.tar.gz: 23434b560c9f01d9c4c9342ba180ffb53e35134342e2a87522f913d51eb1d5dd
3
+ metadata.gz: d723a8386eb4ed50df0bde9d90efacb2a8d6472f06faefa711afca46bdd87ae5
4
+ data.tar.gz: 79c582d886cc31909d7f43c46ec5f9cfffdc8d8f3f9371e85d4e15d496c9cf43
5
5
  SHA512:
6
- metadata.gz: a3057fd377b3862bd39962ad7864b7cfed2605ca2a87bb0aae9d5fef24c286cf5804fa86e6edb494152025a79a68e092994f6a176b245612c61de93dc7d085dd
7
- data.tar.gz: 79c345903c78993722af61c4294423f733a4f92136f6219e173c494956268ab8bf94f9b8fdbe05e967ffe13ddb62c642047942e46d30c182b3b60771d0505a31
6
+ metadata.gz: d2bf91dd9111564260b331113842d0fc39991908f8e7707a91589ce6ddaee5ece21916f1aee89c70719cbb0da7854b668dca998f4caa17f488d6f8097e705d81
7
+ data.tar.gz: 3d24e2e9c3b7b17f87dd56252346b94e78da69abf023889d23b8e89258c8970ad239aebb91f6e507d0dd441a252636240147d70fcfb7a4a0fe93259be6a22fea
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rspec-interactive (0.9.10)
4
+ rspec-interactive (0.9.11)
5
5
  pry
6
6
  rspec-core
7
7
  rspec-teamcity (= 1.0.0)
@@ -5,7 +5,7 @@ require 'rspec-interactive'
5
5
 
6
6
  @options = {
7
7
  server: true,
8
- server_port: RSpec::Interactive::DEFAULT_PORT
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[:server_port])
29
+ RSpec::Interactive.start(config_file: @options[:config_file], server: @options[:server], port: @options[:port])
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  module Interactive
5
- VERSION = "0.9.11"
5
+ VERSION = "0.9.12"
6
6
  end
7
7
  end
@@ -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
- server = TCPServer.new port
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? || @startup_output.string.empty?
335
+ return if @startup_output.nil?
317
336
 
318
- output.puts(@startup_output.string)
337
+ unless @startup_output.string.empty?
338
+ output.puts(@startup_output.string)
339
+ end
319
340
  @startup_output = nil
320
341
  end
321
342
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-interactive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.11
4
+ version: 0.9.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Dower