foreman 0.37.0 → 0.37.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -1
- data/data/example/Procfile +1 -0
- data/data/example/utf8 +11 -0
- data/lib/foreman/engine.rb +13 -9
- data/lib/foreman/version.rb +1 -1
- data/man/foreman.1 +1 -1
- data/spec/foreman/engine_spec.rb +19 -0
- data/spec/foreman/process_spec.rb +1 -1
- data/spec/resources/bin/utf8 +2 -0
- data/spec/spec_helper.rb +5 -1
- metadata +9 -7
data/README.md
CHANGED
@@ -25,6 +25,7 @@ Manage Procfile-based applications
|
|
25
25
|
|
26
26
|
* [man page](http://ddollar.github.com/foreman)
|
27
27
|
* [wiki](http://github.com/ddollar/foreman/wiki)
|
28
|
+
* [changelog](https://github.com/ddollar/foreman/blob/master/Changelog.md)
|
28
29
|
|
29
30
|
## Authors
|
30
31
|
|
@@ -32,7 +33,7 @@ Manage Procfile-based applications
|
|
32
33
|
David Dollar
|
33
34
|
|
34
35
|
#### Patches contributed by
|
35
|
-
Adam Wiggins, Chris Continanza, Chris Lowder, Craig R Webster, Dan Farina, Dan Peterson, David Dollar, Fletcher Nichol, Gabriel Burt, Gamaliel Toro, Greg Reinacker, Hugues Le Gendre, Hunter Nield, Iain Hecker, Jay Zeschin, Keith Rarick, Khaja Minhajuddin, Lincoln Stoll, Marcos Muino Garcia, Mark McGranaghan, Matt Griffin, Matt Haynes, Matthijs Langenberg, Michael Dwan, Michael van Rooijen, Mike Javorski, Nathan Broadbent, Nathan L Smith, Nick Zadrozny, Phil Hagelberg, Ricardo Chimal, Jr, Thom May, Tom Ward, brainopia, clifff, jc00ke
|
36
|
+
Adam Wiggins, Chris Continanza, Chris Lowder, Craig R Webster, Dan Farina, Dan Peterson, David Dollar, Fletcher Nichol, Florian Apolloner, Gabriel Burt, Gamaliel Toro, Greg Reinacker, Hugues Le Gendre, Hunter Nield, Iain Hecker, Jay Zeschin, Keith Rarick, Khaja Minhajuddin, Lincoln Stoll, Marcos Muino Garcia, Mark McGranaghan, Matt Griffin, Matt Haynes, Matthijs Langenberg, Michael Dwan, Michael van Rooijen, Mike Javorski, Nathan Broadbent, Nathan L Smith, Nick Zadrozny, Phil Hagelberg, Ricardo Chimal, Jr, Thom May, Tom Ward, brainopia, clifff, jc00ke
|
36
37
|
|
37
38
|
## License
|
38
39
|
|
data/data/example/Procfile
CHANGED
data/data/example/utf8
ADDED
data/lib/foreman/engine.rb
CHANGED
@@ -58,7 +58,7 @@ private ######################################################################
|
|
58
58
|
concurrency = Foreman::Utils.parse_concurrency(@options[:concurrency])
|
59
59
|
|
60
60
|
procfile.entries.each do |entry|
|
61
|
-
reader, writer = IO.pipe
|
61
|
+
reader, writer = (IO.method(:pipe).arity == 0 ? IO.pipe : IO.pipe("BINARY"))
|
62
62
|
entry.spawn(concurrency[entry.name], writer, @directory, @environment, port_for(entry, 1, base_port)).each do |process|
|
63
63
|
running_processes[process.pid] = process
|
64
64
|
readers[process] = reader
|
@@ -94,19 +94,23 @@ private ######################################################################
|
|
94
94
|
kill_all "SIGKILL"
|
95
95
|
end
|
96
96
|
|
97
|
+
def poll_readers
|
98
|
+
rs, ws = IO.select(readers.values, [], [], 1)
|
99
|
+
(rs || []).each do |r|
|
100
|
+
data = r.gets
|
101
|
+
next unless data
|
102
|
+
ps, message = data.split(",", 2)
|
103
|
+
color = colors[ps.split(".").first]
|
104
|
+
info message, ps, color
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
97
108
|
def watch_for_output
|
98
109
|
Thread.new do
|
99
110
|
require "win32console" if Foreman.windows?
|
100
111
|
begin
|
101
112
|
loop do
|
102
|
-
|
103
|
-
(rs || []).each do |r|
|
104
|
-
data = r.gets
|
105
|
-
next unless data
|
106
|
-
ps, message = data.split(",", 2)
|
107
|
-
color = colors[ps.split(".").first]
|
108
|
-
info message, ps, color
|
109
|
-
end
|
113
|
+
poll_readers
|
110
114
|
end
|
111
115
|
rescue Exception => ex
|
112
116
|
puts ex.message
|
data/lib/foreman/version.rb
CHANGED
data/man/foreman.1
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "FOREMAN" "1" "January 2012" "Foreman 0.
|
4
|
+
.TH "FOREMAN" "1" "January 2012" "Foreman 0.37.1" "Foreman Manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBforeman\fR \- manage Procfile\-based applications
|
data/spec/foreman/engine_spec.rb
CHANGED
@@ -83,4 +83,23 @@ describe "Foreman::Engine", :fakefs do
|
|
83
83
|
engine.start
|
84
84
|
end
|
85
85
|
end
|
86
|
+
|
87
|
+
describe "utf8" do
|
88
|
+
before(:each) do
|
89
|
+
File.open("Procfile", "w") do |file|
|
90
|
+
file.puts "utf8: #{resource_path("bin/utf8")}"
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
it "should spawn" do
|
95
|
+
stub(subject).watch_for_output
|
96
|
+
stub(subject).watch_for_termination
|
97
|
+
subject.start
|
98
|
+
sleep 1
|
99
|
+
mock(subject).info(/started with pid \d+/, "utf8.1", anything)
|
100
|
+
mock(subject).info("\xff\x03\n", "utf8.1", anything)
|
101
|
+
subject.send(:poll_readers)
|
102
|
+
subject.send(:poll_readers)
|
103
|
+
end
|
104
|
+
end
|
86
105
|
end
|
@@ -36,6 +36,7 @@ describe Foreman::Process do
|
|
36
36
|
def run_file(executable, code)
|
37
37
|
file = File.open("#{basedir}/script", 'w') {|it| it << code }
|
38
38
|
run "#{executable} #{file.path}"
|
39
|
+
sleep 1
|
39
40
|
end
|
40
41
|
|
41
42
|
context 'options' do
|
@@ -98,7 +99,6 @@ describe Foreman::Process do
|
|
98
99
|
trap "TERM", "IGNORE"
|
99
100
|
loop { sleep 1 }
|
100
101
|
CODE
|
101
|
-
sleep 1 # wait for ruby to start
|
102
102
|
subject.should be_alive
|
103
103
|
subject.kill 'TERM'
|
104
104
|
subject.should be_alive
|
data/spec/spec_helper.rb
CHANGED
@@ -68,9 +68,13 @@ def load_export_templates_into_fakefs(type)
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
+
def resource_path(filename)
|
72
|
+
File.expand_path("../resources/#{filename}", __FILE__)
|
73
|
+
end
|
74
|
+
|
71
75
|
def example_export_file(filename)
|
72
76
|
FakeFS.deactivate!
|
73
|
-
data = File.read(File.expand_path("
|
77
|
+
data = File.read(File.expand_path(resource_path("export/#{filename}"), __FILE__))
|
74
78
|
FakeFS.activate!
|
75
79
|
data
|
76
80
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.37.
|
4
|
+
version: 0.37.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-29 00:00:00.
|
12
|
+
date: 2012-01-29 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: term-ansicolor
|
16
|
-
requirement: &
|
16
|
+
requirement: &70308501708100 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.0.7
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70308501708100
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: thor
|
27
|
-
requirement: &
|
27
|
+
requirement: &70308501704660 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: 0.13.6
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70308501704660
|
36
36
|
description: Process manager for applications with multiple components
|
37
37
|
email: ddollar@gmail.com
|
38
38
|
executables:
|
@@ -47,6 +47,7 @@ files:
|
|
47
47
|
- data/example/Procfile
|
48
48
|
- data/example/Procfile.without_colon
|
49
49
|
- data/example/ticker
|
50
|
+
- data/example/utf8
|
50
51
|
- data/export/bluepill/master.pill.erb
|
51
52
|
- data/export/runit/log_run.erb
|
52
53
|
- data/export/runit/run.erb
|
@@ -82,6 +83,7 @@ files:
|
|
82
83
|
- spec/foreman/process_spec.rb
|
83
84
|
- spec/foreman_spec.rb
|
84
85
|
- spec/helper_spec.rb
|
86
|
+
- spec/resources/bin/utf8
|
85
87
|
- spec/resources/export/bluepill/app-concurrency.pill
|
86
88
|
- spec/resources/export/bluepill/app.pill
|
87
89
|
- spec/resources/export/inittab/inittab.concurrency
|
@@ -120,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
122
|
version: '0'
|
121
123
|
requirements: []
|
122
124
|
rubyforge_project:
|
123
|
-
rubygems_version: 1.8.
|
125
|
+
rubygems_version: 1.8.10
|
124
126
|
signing_key:
|
125
127
|
specification_version: 3
|
126
128
|
summary: Process manager for applications with multiple components
|