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 +4 -4
- data/lib/rspec_runner/server.rb +18 -4
- data/lib/rspec_runner/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3205e584b68e22ef9f1f846403932b2dfa811358
|
4
|
+
data.tar.gz: 3abd84c589eb4894149b7eadd440b20d39486646
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25190b8044bd58b428b4ffdcc5c1a959d0bab32d85c22ab46df4e65c9bb80d0cd89dbce9b5c21fbd4ab1a1241b411d50a87e7a94a59d31ca48fd2ac2d8efa71d
|
7
|
+
data.tar.gz: 59279ac2c7a2c4fc649e8d516017d09bed8916f4b60d93b0477e4020037752ade2b0826a688d06692656fc7b771b968fd8f9d94b70775fbc1826d9121af5c7d9
|
data/lib/rspec_runner/server.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
86
|
-
|
87
|
-
|
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
|
data/lib/rspec_runner/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|