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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b95e32aec5d797781634ce2bc41d2b37b5b6cc86
4
- data.tar.gz: 12869cff8f60f39dfa07ebc4e95b708e479a1709
3
+ metadata.gz: 1b521b33ee6d995631b846afac8d980e945a3b77
4
+ data.tar.gz: 4dc980ec43aee4ca7ad5edec8ac9c43533f4360b
5
5
  SHA512:
6
- metadata.gz: ee2292511b60e1e09a6a4ade3413a725f28ce247e1fa6fdd960f97c66c94edbaec0b42f23beb8ae652eb8793c4b2dca901fdc702e1cf2a7bce34c247abd37d95
7
- data.tar.gz: 4f98337599eaebd926bf8ce6d5d055986ae02d4dda84b7c7808584e9c629ac32d02ca9feb78532d3a44f567d21819e44ebc90ba27a92aa23daa4609c3be70a88
6
+ metadata.gz: 063dd78b3f3e2eb439cf72b394186bbd355beae38b7c02e3280b5e988a299d1f793c19eb3eee11657ec824848a5ad88a8d45a0a138e0892d5b4f022777906963
7
+ data.tar.gz: bc855c0b6218cccd882fa64bcb0805f74c3cea66cd69a5a8187a175915111b7fd7efe760cd7f393acea5ee2337693562186f5373851fb7fd9ea237b08a9b9192
@@ -1,4 +1,4 @@
1
- require 'rake/tasklib' unless defined? (::Rake::TaskLib)
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 = 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]
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, { [:out, :err] => [log_file_path, "w"] })
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) rescue false
60
+ end)
61
+ rescue
62
+ false
61
63
  end
62
64
 
63
65
  def current_pid
64
- File.exists?(pid_file_path) ? File.read(pid_file_path).to_i : nil
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
@@ -1,3 +1,3 @@
1
1
  module HttpServerManager
2
- VERSION = "0.4.13"
2
+ VERSION = "0.4.14".freeze
3
3
  end
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.13
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-04-18 00:00:00.000000000 Z
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: '11.1'
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: '11.1'
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: travis-lint
57
+ name: rubocop
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - "~>"
60
+ - - ~>
61
61
  - !ruby/object:Gem::Version
62
- version: '2.0'
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: '2.0'
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.4'
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.4'
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.11'
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.11'
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
- - "./lib/http_server_manager.rb"
119
- - "./lib/http_server_manager/rake/server_tasks.rb"
120
- - "./lib/http_server_manager/rake/task_generators.rb"
121
- - "./lib/http_server_manager/server.rb"
122
- - "./lib/http_server_manager/stdout_logger.rb"
123
- - "./lib/http_server_manager/version.rb"
124
- - "./spec/lib/http_server_manager/rake/server_tasks_spec.rb"
125
- - "./spec/lib/http_server_manager/server_integration_spec.rb"
126
- - "./spec/lib/http_server_manager/server_spec.rb"
127
- - "./spec/lib/http_server_manager/stdout_logger_spec.rb"
128
- - "./spec/lib/http_server_manager/test/server_integration_examples_spec.rb"
129
- - "./spec/lib/http_server_manager_spec.rb"
130
- - "./spec/spec_helper.rb"
131
- - "./spec/support/http_server_manager/test/server_integration_examples.rb"
132
- - "./spec/support/http_server_manager/test/server_integration_utilities.rb"
133
- - "./spec/support/http_server_manager/test/server_integration_utilities_spec_context.rb"
134
- - "./spec/support/http_server_manager/test/silent_logger.rb"
135
- - "./spec/support/http_server_manager/test_support.rb"
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: 1.9.3
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.6
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
- - "./spec/lib/http_server_manager/rake/server_tasks_spec.rb"
163
- - "./spec/lib/http_server_manager/server_integration_spec.rb"
164
- - "./spec/lib/http_server_manager/server_spec.rb"
165
- - "./spec/lib/http_server_manager/stdout_logger_spec.rb"
166
- - "./spec/lib/http_server_manager/test/server_integration_examples_spec.rb"
167
- - "./spec/lib/http_server_manager_spec.rb"
168
- - "./spec/spec_helper.rb"
169
- - "./spec/support/http_server_manager/test/server_integration_examples.rb"
170
- - "./spec/support/http_server_manager/test/server_integration_utilities.rb"
171
- - "./spec/support/http_server_manager/test/server_integration_utilities_spec_context.rb"
172
- - "./spec/support/http_server_manager/test/silent_logger.rb"
173
- - "./spec/support/http_server_manager/test_support.rb"
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