rspec_runner 0.2.3 → 0.2.5

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
  SHA1:
3
- metadata.gz: b9f223a31a9d33a0dfce68140e0db6cf9dd91c68
4
- data.tar.gz: 3c197e21d30b779dae0222914c4ed10ab7de0d51
3
+ metadata.gz: 3205e584b68e22ef9f1f846403932b2dfa811358
4
+ data.tar.gz: 3abd84c589eb4894149b7eadd440b20d39486646
5
5
  SHA512:
6
- metadata.gz: a525736660dcbf8f3aa0c5f13f90f60e4285a7e1157eed6a4a83a13e21dafb843c5290fba7498738676c6bd146dea6b1e89c70839bff895b82af9e7132257515
7
- data.tar.gz: 37855c8a5288bf61528ab9db7de265a924ce2744b7a15978d9c4c41c7ae1389d41f99cd20ed7778a1eeb4a1048e7ab92352f734cf90e10646b2877732aea7e04
6
+ metadata.gz: 25190b8044bd58b428b4ffdcc5c1a959d0bab32d85c22ab46df4e65c9bb80d0cd89dbce9b5c21fbd4ab1a1241b411d50a87e7a94a59d31ca48fd2ac2d8efa71d
7
+ data.tar.gz: 59279ac2c7a2c4fc649e8d516017d09bed8916f4b60d93b0477e4020037752ade2b0826a688d06692656fc7b771b968fd8f9d94b70775fbc1826d9121af5c7d9
@@ -6,6 +6,8 @@ module RspecRunner
6
6
  class Server
7
7
  class << self
8
8
  def start
9
+ create_uri_file
10
+
9
11
  puts 'Preloading gems...'
10
12
  require 'rubygems'
11
13
  require 'bundler'
@@ -48,7 +50,7 @@ module RspecRunner
48
50
  # TODO: try to kill without -9
49
51
  send_signal('KILL')
50
52
  end
51
- File.delete(RspecRunner.configuration.uri_filepath) if File.exist?(RspecRunner.configuration.uri_filepath)
53
+ delete_uri_file
52
54
  end
53
55
 
54
56
  private
@@ -76,15 +78,27 @@ module RspecRunner
76
78
  Process.kill(signal, @pid)
77
79
  end
78
80
 
81
+ def create_uri_file(uri = nil)
82
+ dirname = File.dirname(RspecRunner.configuration.uri_filepath)
83
+ FileUtils.mkdir_p(dirname) unless File.directory?(dirname)
84
+ File.write(RspecRunner.configuration.uri_filepath, uri)
85
+ end
86
+
87
+ def delete_uri_file
88
+ File.delete(RspecRunner.configuration.uri_filepath) if File.exist?(RspecRunner.configuration.uri_filepath)
89
+ end
90
+
79
91
  def assign_uri
80
92
  socket = Socket.new(:INET, :STREAM, 0)
81
93
  socket.bind(Addrinfo.tcp('127.0.0.1'.freeze, 0))
82
94
  free_port = socket.local_address.ip_port
83
95
  uri = "druby://localhost:#{free_port}"
84
96
 
85
- dirname = File.dirname(RspecRunner.configuration.uri_filepath)
86
- FileUtils.mkdir_p(dirname) unless File.directory?(dirname)
87
- File.write(RspecRunner.configuration.uri_filepath, uri)
97
+ if File.exist?(RspecRunner.configuration.uri_filepath)
98
+ File.write(RspecRunner.configuration.uri_filepath, uri)
99
+ else
100
+ create_uri_file(uri)
101
+ end
88
102
 
89
103
  uri
90
104
  end
@@ -1,3 +1,3 @@
1
1
  module RspecRunner
2
- VERSION = '0.2.3'
2
+ VERSION = '0.2.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - exAspArk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-21 00:00:00.000000000 Z
11
+ date: 2016-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec