rack_check 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack_check/server_manager.rb +16 -9
- data/lib/rack_check/spec/env.rb +3 -0
- data/lib/rack_check/spec.rb +6 -3
- data/lib/rack_check/version.rb +1 -1
- data/rack_check.gemspec +1 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51a5f8038bf2d6a1eec85fc2541bb28a79a5f4b5
|
4
|
+
data.tar.gz: 9fddcb754b84d4be178967f2cf3c36e58bd929b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f296542b7adcdf240c6eba71f994a538fe119494fb15f0683bd8e54de88dfb484a3b3ca3425bfa635d97ac8ea6ca0146c49ffbf19ee49b2a05a352ebca9b471e
|
7
|
+
data.tar.gz: b1f8e490981615f260a13e9380034969b167edeb06be6de530a8243aa8604e417f0655ac6de9f2ccd27e0565f0141fe0dafd36de1a9be4e845058d7e2585acca
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'socket'
|
2
|
+
require 'open4'
|
2
3
|
|
3
4
|
module RackCheck
|
4
5
|
|
@@ -17,15 +18,13 @@ class ServerManager
|
|
17
18
|
Thread.new do
|
18
19
|
begin
|
19
20
|
with_environment(ru_file) do |dir|
|
20
|
-
|
21
|
-
in
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
Process.wait @pid
|
28
|
-
@pid = nil
|
21
|
+
Dir.chdir(dir) do
|
22
|
+
@pid, @in, @out, @err = Open4.popen4 context.app_server_command
|
23
|
+
@stop_var.take
|
24
|
+
Process.kill 'TERM', @pid
|
25
|
+
Process.wait @pid
|
26
|
+
@pid = nil
|
27
|
+
end
|
29
28
|
end
|
30
29
|
rescue => e
|
31
30
|
$stderr.puts "App server thread exited: #{e.message}\n#{e.backtrace.join("\n")}"
|
@@ -44,6 +43,14 @@ class ServerManager
|
|
44
43
|
end
|
45
44
|
end
|
46
45
|
|
46
|
+
def errors
|
47
|
+
@err&.read.strip
|
48
|
+
end
|
49
|
+
|
50
|
+
def output
|
51
|
+
@out&.read.strip
|
52
|
+
end
|
53
|
+
|
47
54
|
private
|
48
55
|
|
49
56
|
def wait_for_port
|
data/lib/rack_check/spec/env.rb
CHANGED
data/lib/rack_check/spec.rb
CHANGED
@@ -14,6 +14,7 @@ module RackCheck::Spec
|
|
14
14
|
STARTUP_TIMEOUT = 10
|
15
15
|
|
16
16
|
def self.run(app_server_command, app_server_port)
|
17
|
+
load_tests
|
17
18
|
@@context = Context.new(app_server_command, app_server_port, STARTUP_TIMEOUT)
|
18
19
|
|
19
20
|
# TODO there must be a better way to pass context to a rspec suite
|
@@ -23,7 +24,9 @@ module RackCheck::Spec
|
|
23
24
|
def self.server_context
|
24
25
|
@@context
|
25
26
|
end
|
26
|
-
end
|
27
27
|
|
28
|
-
|
29
|
-
require 'rack_check/spec/
|
28
|
+
def self.load_tests
|
29
|
+
require 'rack_check/spec/rackup'
|
30
|
+
require 'rack_check/spec/env'
|
31
|
+
end
|
32
|
+
end
|
data/lib/rack_check/version.rb
CHANGED
data/rack_check.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack_check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tinco Andringa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '2.2'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: open4
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.3'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.3'
|
83
97
|
description:
|
84
98
|
email:
|
85
99
|
- tinco@phusion.nl
|
@@ -127,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
141
|
version: '0'
|
128
142
|
requirements: []
|
129
143
|
rubyforge_project:
|
130
|
-
rubygems_version: 2.
|
144
|
+
rubygems_version: 2.5.1
|
131
145
|
signing_key:
|
132
146
|
specification_version: 4
|
133
147
|
summary: Tool that checks a Ruby application server for Rack compliancy
|