http_server_manager 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,6 +8,7 @@ module HttpServerManager
8
8
  @name = options[:name]
9
9
  @host = options[:host]
10
10
  @port = options[:port]
11
+ @timeout_in_seconds = options[:timeout_in_seconds] || 20
11
12
  @deletable_artifacts = [pid_file_path]
12
13
  end
13
14
 
@@ -18,7 +19,7 @@ module HttpServerManager
18
19
  ensure_directories_exist
19
20
  pid = Process.spawn(start_command, { [:out, :err] => [log_file_path, "w"] })
20
21
  create_pid_file(pid)
21
- Wait.until_true!("#{@name} is running") { running? }
22
+ Wait.until_true!("#{@name} is running", timeout_in_seconds: @timeout_in_seconds) { running? }
22
23
  logger.info "#{@name} started on #{@host}:#{@port}"
23
24
  end
24
25
  end
@@ -53,7 +54,10 @@ module HttpServerManager
53
54
  private
54
55
 
55
56
  def running?
56
- !!Net::HTTP.get_response(@host, "/", @port) rescue false
57
+ !!(Net::HTTP.new(@host, @port).start do |http|
58
+ http.open_timeout = http.read_timeout = @timeout_in_seconds
59
+ http.request_get("/")
60
+ end) rescue false
57
61
  end
58
62
 
59
63
  def current_pid
@@ -1,3 +1,3 @@
1
1
  module HttpServerManager
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
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.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-28 00:00:00.000000000 Z
12
+ date: 2013-11-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: 0.0.1
53
+ version: '0.1'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 0.0.1
61
+ version: '0.1'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: metric_fu
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: '4.4'
69
+ version: '4.5'
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: '4.4'
77
+ version: '4.5'
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: rspec
80
80
  requirement: !ruby/object:Gem::Requirement
@@ -98,7 +98,7 @@ dependencies:
98
98
  requirements:
99
99
  - - ~>
100
100
  - !ruby/object:Gem::Version
101
- version: '0.7'
101
+ version: '0.8'
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
@@ -106,15 +106,15 @@ dependencies:
106
106
  requirements:
107
107
  - - ~>
108
108
  - !ruby/object:Gem::Version
109
- version: '0.7'
109
+ version: '0.8'
110
110
  - !ruby/object:Gem::Dependency
111
- name: travis-lint
111
+ name: rack
112
112
  requirement: !ruby/object:Gem::Requirement
113
113
  none: false
114
114
  requirements:
115
115
  - - ~>
116
116
  - !ruby/object:Gem::Version
117
- version: '1.7'
117
+ version: '1.5'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
@@ -122,15 +122,15 @@ dependencies:
122
122
  requirements:
123
123
  - - ~>
124
124
  - !ruby/object:Gem::Version
125
- version: '1.7'
125
+ version: '1.5'
126
126
  - !ruby/object:Gem::Dependency
127
- name: rack
127
+ name: travis-lint
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  none: false
130
130
  requirements:
131
131
  - - ~>
132
132
  - !ruby/object:Gem::Version
133
- version: '1.5'
133
+ version: '1.7'
134
134
  type: :development
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
@@ -138,7 +138,7 @@ dependencies:
138
138
  requirements:
139
139
  - - ~>
140
140
  - !ruby/object:Gem::Version
141
- version: '1.5'
141
+ version: '1.7'
142
142
  description: Manages the lifecycle of HTTP server processes
143
143
  email: matthew.ueckerman@myob.com
144
144
  executables: []