http_server_manager 0.4.13 → 0.4.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/http_server_manager/rake/server_tasks.rb +16 -1
- data/lib/http_server_manager/server.rb +10 -8
- data/lib/http_server_manager/version.rb +1 -1
- metadata +73 -59
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b521b33ee6d995631b846afac8d980e945a3b77
|
4
|
+
data.tar.gz: 4dc980ec43aee4ca7ad5edec8ac9c43533f4360b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 063dd78b3f3e2eb439cf72b394186bbd355beae38b7c02e3280b5e988a299d1f793c19eb3eee11657ec824848a5ad88a8d45a0a138e0892d5b4f022777906963
|
7
|
+
data.tar.gz: bc855c0b6218cccd882fa64bcb0805f74c3cea66cd69a5a8187a175915111b7fd7efe760cd7f393acea5ee2337693562186f5373851fb7fd9ea237b08a9b9192
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'rake/tasklib' unless defined?
|
1
|
+
require 'rake/tasklib' unless defined? ::Rake::TaskLib
|
2
2
|
|
3
3
|
module HttpServerManager
|
4
4
|
module Rake
|
@@ -6,21 +6,36 @@ module HttpServerManager
|
|
6
6
|
class ServerTasks < ::Rake::TaskLib
|
7
7
|
|
8
8
|
def initialize(server)
|
9
|
+
define_start_task(server)
|
10
|
+
define_stop_task(server)
|
11
|
+
define_restart_task(server)
|
12
|
+
define_status_task(server)
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def define_start_task(server)
|
9
18
|
desc "Start a #{server.name} as a background process"
|
10
19
|
task :start do
|
11
20
|
server.start!
|
12
21
|
end
|
22
|
+
end
|
13
23
|
|
24
|
+
def define_stop_task(server)
|
14
25
|
desc "Stop a running #{server.name}"
|
15
26
|
task :stop do
|
16
27
|
server.stop!
|
17
28
|
end
|
29
|
+
end
|
18
30
|
|
31
|
+
def define_restart_task(server)
|
19
32
|
desc "Restart an potentially running #{server.name}"
|
20
33
|
task :restart do
|
21
34
|
server.restart!
|
22
35
|
end
|
36
|
+
end
|
23
37
|
|
38
|
+
def define_status_task(server)
|
24
39
|
desc "Display the status of a #{server.name} process"
|
25
40
|
task :status do
|
26
41
|
puts "#{server.name} is #{server.status}"
|
@@ -5,11 +5,11 @@ module HttpServerManager
|
|
5
5
|
attr_reader :name, :host, :port
|
6
6
|
|
7
7
|
def initialize(options)
|
8
|
-
@name
|
9
|
-
@host
|
10
|
-
@port
|
11
|
-
@timeout_in_seconds
|
12
|
-
@deletable_artifacts = [pid_file_path]
|
8
|
+
@name = options[:name]
|
9
|
+
@host = options[:host]
|
10
|
+
@port = options[:port]
|
11
|
+
@timeout_in_seconds = options[:timeout_in_seconds] || (ENV["timeout"] ? ENV["timeout"].to_i : 20)
|
12
|
+
@deletable_artifacts = [ pid_file_path ]
|
13
13
|
end
|
14
14
|
|
15
15
|
def start!
|
@@ -17,7 +17,7 @@ module HttpServerManager
|
|
17
17
|
logger.info "#{@name} already running on #{@host}:#{@port}"
|
18
18
|
else
|
19
19
|
ensure_directories_exist
|
20
|
-
pid = Process.spawn(start_command,
|
20
|
+
pid = Process.spawn(start_command, [:out, :err] => [ log_file_path, "w" ])
|
21
21
|
create_pid_file(pid)
|
22
22
|
Wait.until_true!(description: "#{@name} is running", timeout_in_seconds: @timeout_in_seconds) { running? }
|
23
23
|
logger.info "#{@name} started on #{@host}:#{@port}"
|
@@ -57,11 +57,13 @@ module HttpServerManager
|
|
57
57
|
!!(Net::HTTP.new(@host, @port).start do |http|
|
58
58
|
http.open_timeout = http.read_timeout = @timeout_in_seconds
|
59
59
|
http.request_get("/")
|
60
|
-
end)
|
60
|
+
end)
|
61
|
+
rescue
|
62
|
+
false
|
61
63
|
end
|
62
64
|
|
63
65
|
def current_pid
|
64
|
-
File.
|
66
|
+
File.exist?(pid_file_path) ? File.read(pid_file_path).to_i : nil
|
65
67
|
end
|
66
68
|
|
67
69
|
def pid_file_path
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http_server_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Ueckerman
|
@@ -9,130 +9,144 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-07-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - '>='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '10.4'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - '>='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '10.4'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: sys-proctree
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ~>
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '0.0'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ~>
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0.0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: wait_until
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ~>
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0.3'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ~>
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0.3'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
|
-
name:
|
57
|
+
name: rubocop
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - ~>
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
62
|
+
version: '0.41'
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
69
|
+
version: '0.41'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: rspec
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - ~>
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '3.
|
76
|
+
version: '3.5'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- -
|
81
|
+
- - ~>
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '3.
|
83
|
+
version: '3.5'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: simplecov
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- -
|
88
|
+
- - ~>
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: '0.
|
90
|
+
version: '0.12'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- -
|
95
|
+
- - ~>
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: '0.
|
97
|
+
version: '0.12'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: rack
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- -
|
102
|
+
- - ~>
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '1.6'
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- -
|
109
|
+
- - ~>
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '1.6'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: travis-lint
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ~>
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '2.0'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '2.0'
|
112
126
|
description: Manages the lifecycle of HTTP server processes
|
113
127
|
email: matthew.ueckerman@myob.com
|
114
128
|
executables: []
|
115
129
|
extensions: []
|
116
130
|
extra_rdoc_files: []
|
117
131
|
files:
|
118
|
-
-
|
119
|
-
-
|
120
|
-
-
|
121
|
-
-
|
122
|
-
-
|
123
|
-
-
|
124
|
-
-
|
125
|
-
-
|
126
|
-
-
|
127
|
-
-
|
128
|
-
-
|
129
|
-
-
|
130
|
-
-
|
131
|
-
-
|
132
|
-
-
|
133
|
-
-
|
134
|
-
-
|
135
|
-
-
|
132
|
+
- ./lib/http_server_manager.rb
|
133
|
+
- ./lib/http_server_manager/rake/server_tasks.rb
|
134
|
+
- ./lib/http_server_manager/rake/task_generators.rb
|
135
|
+
- ./lib/http_server_manager/server.rb
|
136
|
+
- ./lib/http_server_manager/stdout_logger.rb
|
137
|
+
- ./lib/http_server_manager/version.rb
|
138
|
+
- ./spec/lib/http_server_manager/rake/server_tasks_spec.rb
|
139
|
+
- ./spec/lib/http_server_manager/server_integration_spec.rb
|
140
|
+
- ./spec/lib/http_server_manager/server_spec.rb
|
141
|
+
- ./spec/lib/http_server_manager/stdout_logger_spec.rb
|
142
|
+
- ./spec/lib/http_server_manager/test/server_integration_examples_spec.rb
|
143
|
+
- ./spec/lib/http_server_manager_spec.rb
|
144
|
+
- ./spec/spec_helper.rb
|
145
|
+
- ./spec/support/http_server_manager/test/server_integration_examples.rb
|
146
|
+
- ./spec/support/http_server_manager/test/server_integration_utilities.rb
|
147
|
+
- ./spec/support/http_server_manager/test/server_integration_utilities_spec_context.rb
|
148
|
+
- ./spec/support/http_server_manager/test/silent_logger.rb
|
149
|
+
- ./spec/support/http_server_manager/test_support.rb
|
136
150
|
homepage: http://github.com/MYOB-Technology/http_server_manager
|
137
151
|
licenses:
|
138
152
|
- MIT
|
@@ -144,30 +158,30 @@ require_paths:
|
|
144
158
|
- spec/support
|
145
159
|
required_ruby_version: !ruby/object:Gem::Requirement
|
146
160
|
requirements:
|
147
|
-
- -
|
161
|
+
- - '>='
|
148
162
|
- !ruby/object:Gem::Version
|
149
|
-
version:
|
163
|
+
version: '2.0'
|
150
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
165
|
requirements:
|
152
|
-
- -
|
166
|
+
- - '>='
|
153
167
|
- !ruby/object:Gem::Version
|
154
168
|
version: '0'
|
155
169
|
requirements: []
|
156
170
|
rubyforge_project: http_server_manager
|
157
|
-
rubygems_version: 2.4.
|
171
|
+
rubygems_version: 2.4.8
|
158
172
|
signing_key:
|
159
173
|
specification_version: 4
|
160
174
|
summary: Manages the lifecycle of HTTP server processes
|
161
175
|
test_files:
|
162
|
-
-
|
163
|
-
-
|
164
|
-
-
|
165
|
-
-
|
166
|
-
-
|
167
|
-
-
|
168
|
-
-
|
169
|
-
-
|
170
|
-
-
|
171
|
-
-
|
172
|
-
-
|
173
|
-
-
|
176
|
+
- ./spec/lib/http_server_manager/rake/server_tasks_spec.rb
|
177
|
+
- ./spec/lib/http_server_manager/server_integration_spec.rb
|
178
|
+
- ./spec/lib/http_server_manager/server_spec.rb
|
179
|
+
- ./spec/lib/http_server_manager/stdout_logger_spec.rb
|
180
|
+
- ./spec/lib/http_server_manager/test/server_integration_examples_spec.rb
|
181
|
+
- ./spec/lib/http_server_manager_spec.rb
|
182
|
+
- ./spec/spec_helper.rb
|
183
|
+
- ./spec/support/http_server_manager/test/server_integration_examples.rb
|
184
|
+
- ./spec/support/http_server_manager/test/server_integration_utilities.rb
|
185
|
+
- ./spec/support/http_server_manager/test/server_integration_utilities_spec_context.rb
|
186
|
+
- ./spec/support/http_server_manager/test/silent_logger.rb
|
187
|
+
- ./spec/support/http_server_manager/test_support.rb
|