foreman 0.46.0-java → 0.48.0.pre1-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data/README.md +6 -0
  2. data/bin/foreman-runner +3 -7
  3. data/bin/taskman +8 -0
  4. data/data/example/Procfile +4 -3
  5. data/data/example/spawnee +14 -0
  6. data/data/example/spawner +7 -0
  7. data/data/export/bluepill/master.pill.erb +11 -10
  8. data/data/export/launchd/launchd.plist.erb +22 -0
  9. data/data/export/runit/log/run.erb +7 -0
  10. data/data/export/runit/run.erb +2 -2
  11. data/data/export/supervisord/app.conf.erb +12 -12
  12. data/data/export/upstart/master.conf.erb +2 -2
  13. data/data/export/upstart/process.conf.erb +3 -3
  14. data/lib/foreman/cli.rb +51 -22
  15. data/lib/foreman/engine.rb +209 -148
  16. data/lib/foreman/engine/cli.rb +98 -0
  17. data/lib/foreman/env.rb +27 -0
  18. data/lib/foreman/export.rb +1 -1
  19. data/lib/foreman/export/base.rb +58 -20
  20. data/lib/foreman/export/bluepill.rb +3 -17
  21. data/lib/foreman/export/inittab.rb +8 -11
  22. data/lib/foreman/export/launchd.rb +15 -0
  23. data/lib/foreman/export/runit.rb +14 -39
  24. data/lib/foreman/export/supervisord.rb +3 -13
  25. data/lib/foreman/export/upstart.rb +9 -27
  26. data/lib/foreman/process.rb +56 -67
  27. data/lib/foreman/procfile.rb +59 -25
  28. data/lib/foreman/version.rb +1 -1
  29. data/man/foreman.1 +5 -1
  30. data/spec/foreman/cli_spec.rb +38 -152
  31. data/spec/foreman/engine_spec.rb +47 -74
  32. data/spec/foreman/export/base_spec.rb +4 -7
  33. data/spec/foreman/export/bluepill_spec.rb +7 -6
  34. data/spec/foreman/export/inittab_spec.rb +7 -7
  35. data/spec/foreman/export/launchd_spec.rb +21 -0
  36. data/spec/foreman/export/runit_spec.rb +12 -17
  37. data/spec/foreman/export/supervisord_spec.rb +7 -56
  38. data/spec/foreman/export/upstart_spec.rb +22 -21
  39. data/spec/foreman/process_spec.rb +27 -110
  40. data/spec/foreman/procfile_spec.rb +26 -16
  41. data/spec/resources/Procfile +4 -0
  42. data/spec/resources/bin/echo +2 -0
  43. data/spec/resources/bin/env +2 -0
  44. data/spec/resources/bin/test +2 -0
  45. data/spec/resources/export/bluepill/app-concurrency.pill +6 -4
  46. data/spec/resources/export/bluepill/app.pill +6 -4
  47. data/spec/resources/export/launchd/launchd-a.default +22 -0
  48. data/spec/resources/export/launchd/launchd-b.default +22 -0
  49. data/spec/resources/export/runit/{app-alpha-1-log-run → app-alpha-1/log/run} +0 -0
  50. data/spec/resources/export/runit/{app-alpha-1-run → app-alpha-1/run} +0 -0
  51. data/spec/resources/export/runit/{app-alpha-2-log-run → app-alpha-2/log/run} +0 -0
  52. data/spec/resources/export/runit/{app-alpha-2-run → app-alpha-2/run} +0 -0
  53. data/spec/resources/export/runit/{app-bravo-1-log-run → app-bravo-1/log/run} +0 -0
  54. data/spec/resources/export/runit/{app-bravo-1-run → app-bravo-1/run} +0 -0
  55. data/spec/resources/export/supervisord/app-alpha-1.conf +24 -0
  56. data/spec/resources/export/supervisord/app-alpha-2.conf +4 -4
  57. data/spec/spec_helper.rb +58 -6
  58. metadata +32 -24
  59. data/data/export/runit/log_run.erb +0 -7
  60. data/lib/foreman/color.rb +0 -40
  61. data/lib/foreman/procfile_entry.rb +0 -26
  62. data/lib/foreman/utils.rb +0 -18
  63. data/spec/foreman/color_spec.rb +0 -31
  64. data/spec/foreman/procfile_entry_spec.rb +0 -13
  65. data/spec/resources/export/supervisord/app-env-with-comma.conf +0 -24
  66. data/spec/resources/export/supervisord/app-env.conf +0 -21
  67. data/spec/resources/export/supervisord/app.conf +0 -24
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.46.0
5
- prerelease:
4
+ version: 0.48.0.pre1
5
+ prerelease: 7
6
6
  platform: java
7
7
  authors:
8
8
  - David Dollar
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-02 00:00:00.000000000 Z
12
+ date: 2012-06-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &70202869871160 !ruby/object:Gem::Requirement
16
+ requirement: &70334595601080 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.13.6
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70202869871160
24
+ version_requirements: *70334595601080
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: posix-spawn
27
- requirement: &70202869870580 !ruby/object:Gem::Requirement
27
+ requirement: &70334595600420 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 0.3.6
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70202869870580
35
+ version_requirements: *70334595600420
36
36
  description: Process manager for applications with multiple components
37
37
  email: ddollar@gmail.com
38
38
  executables:
@@ -42,26 +42,32 @@ extra_rdoc_files: []
42
42
  files:
43
43
  - bin/foreman
44
44
  - bin/foreman-runner
45
+ - bin/taskman
45
46
  - data/example/error
46
47
  - data/example/log/neverdie.log
47
48
  - data/example/Procfile
48
49
  - data/example/Procfile.without_colon
50
+ - data/example/spawnee
51
+ - data/example/spawner
49
52
  - data/example/ticker
50
53
  - data/example/utf8
51
54
  - data/export/bluepill/master.pill.erb
52
- - data/export/runit/log_run.erb
55
+ - data/export/launchd/launchd.plist.erb
56
+ - data/export/runit/log/run.erb
53
57
  - data/export/runit/run.erb
54
58
  - data/export/supervisord/app.conf.erb
55
59
  - data/export/upstart/master.conf.erb
56
60
  - data/export/upstart/process.conf.erb
57
61
  - data/export/upstart/process_master.conf.erb
58
62
  - lib/foreman/cli.rb
59
- - lib/foreman/color.rb
60
63
  - lib/foreman/distribution.rb
64
+ - lib/foreman/engine/cli.rb
61
65
  - lib/foreman/engine.rb
66
+ - lib/foreman/env.rb
62
67
  - lib/foreman/export/base.rb
63
68
  - lib/foreman/export/bluepill.rb
64
69
  - lib/foreman/export/inittab.rb
70
+ - lib/foreman/export/launchd.rb
65
71
  - lib/foreman/export/runit.rb
66
72
  - lib/foreman/export/supervisord.rb
67
73
  - lib/foreman/export/upstart.rb
@@ -69,48 +75,49 @@ files:
69
75
  - lib/foreman/helpers.rb
70
76
  - lib/foreman/process.rb
71
77
  - lib/foreman/procfile.rb
72
- - lib/foreman/procfile_entry.rb
73
- - lib/foreman/utils.rb
74
78
  - lib/foreman/version.rb
75
79
  - lib/foreman.rb
76
80
  - README.md
77
81
  - spec/foreman/cli_spec.rb
78
- - spec/foreman/color_spec.rb
79
82
  - spec/foreman/engine_spec.rb
80
83
  - spec/foreman/export/base_spec.rb
81
84
  - spec/foreman/export/bluepill_spec.rb
82
85
  - spec/foreman/export/inittab_spec.rb
86
+ - spec/foreman/export/launchd_spec.rb
83
87
  - spec/foreman/export/runit_spec.rb
84
88
  - spec/foreman/export/supervisord_spec.rb
85
89
  - spec/foreman/export/upstart_spec.rb
86
90
  - spec/foreman/export_spec.rb
87
91
  - spec/foreman/helpers_spec.rb
88
92
  - spec/foreman/process_spec.rb
89
- - spec/foreman/procfile_entry_spec.rb
90
93
  - spec/foreman/procfile_spec.rb
91
94
  - spec/foreman_spec.rb
92
95
  - spec/helper_spec.rb
96
+ - spec/resources/bin/echo
97
+ - spec/resources/bin/env
98
+ - spec/resources/bin/test
93
99
  - spec/resources/bin/utf8
94
100
  - spec/resources/export/bluepill/app-concurrency.pill
95
101
  - spec/resources/export/bluepill/app.pill
96
102
  - spec/resources/export/inittab/inittab.concurrency
97
103
  - spec/resources/export/inittab/inittab.default
98
- - spec/resources/export/runit/app-alpha-1-log-run
99
- - spec/resources/export/runit/app-alpha-1-run
100
- - spec/resources/export/runit/app-alpha-2-log-run
101
- - spec/resources/export/runit/app-alpha-2-run
102
- - spec/resources/export/runit/app-bravo-1-log-run
103
- - spec/resources/export/runit/app-bravo-1-run
104
+ - spec/resources/export/launchd/launchd-a.default
105
+ - spec/resources/export/launchd/launchd-b.default
106
+ - spec/resources/export/runit/app-alpha-1/log/run
107
+ - spec/resources/export/runit/app-alpha-1/run
108
+ - spec/resources/export/runit/app-alpha-2/log/run
109
+ - spec/resources/export/runit/app-alpha-2/run
110
+ - spec/resources/export/runit/app-bravo-1/log/run
111
+ - spec/resources/export/runit/app-bravo-1/run
112
+ - spec/resources/export/supervisord/app-alpha-1.conf
104
113
  - spec/resources/export/supervisord/app-alpha-2.conf
105
- - spec/resources/export/supervisord/app-env-with-comma.conf
106
- - spec/resources/export/supervisord/app-env.conf
107
- - spec/resources/export/supervisord/app.conf
108
114
  - spec/resources/export/upstart/app-alpha-1.conf
109
115
  - spec/resources/export/upstart/app-alpha-2.conf
110
116
  - spec/resources/export/upstart/app-alpha.conf
111
117
  - spec/resources/export/upstart/app-bravo-1.conf
112
118
  - spec/resources/export/upstart/app-bravo.conf
113
119
  - spec/resources/export/upstart/app.conf
120
+ - spec/resources/Procfile
114
121
  - spec/spec_helper.rb
115
122
  - man/foreman.1
116
123
  homepage: http://github.com/ddollar/foreman
@@ -128,9 +135,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
128
135
  required_rubygems_version: !ruby/object:Gem::Requirement
129
136
  none: false
130
137
  requirements:
131
- - - ! '>='
138
+ - - ! '>'
132
139
  - !ruby/object:Gem::Version
133
- version: '0'
140
+ version: 1.3.1
134
141
  requirements: []
135
142
  rubyforge_project:
136
143
  rubygems_version: 1.8.11
@@ -138,3 +145,4 @@ signing_key:
138
145
  specification_version: 3
139
146
  summary: Process manager for applications with multiple components
140
147
  test_files: []
148
+ has_rdoc:
@@ -1,7 +0,0 @@
1
- #!/bin/sh
2
- set -e
3
-
4
- LOG=<%= log_root %>/<%= process.name %>-<%= num %>
5
-
6
- test -d "$LOG" || mkdir -p m2750 "$LOG" && chown <%= user %> "$LOG"
7
- exec chpst -u <%= user %> svlogd "$LOG"
data/lib/foreman/color.rb DELETED
@@ -1,40 +0,0 @@
1
- require "foreman"
2
-
3
- module Foreman::Color
4
-
5
- ANSI = {
6
- :reset => 0,
7
- :black => 30,
8
- :red => 31,
9
- :green => 32,
10
- :yellow => 33,
11
- :blue => 34,
12
- :magenta => 35,
13
- :cyan => 36,
14
- :white => 37,
15
- :bright_black => 30,
16
- :bright_red => 31,
17
- :bright_green => 32,
18
- :bright_yellow => 33,
19
- :bright_blue => 34,
20
- :bright_magenta => 35,
21
- :bright_cyan => 36,
22
- :bright_white => 37,
23
- }
24
-
25
- def self.enable(io)
26
- io.extend(self)
27
- end
28
-
29
- def color?
30
- return false unless self.respond_to?(:isatty)
31
- self.isatty && ENV["TERM"]
32
- end
33
-
34
- def color(name)
35
- return "" unless color?
36
- return "" unless ansi = ANSI[name.to_sym]
37
- "\e[#{ansi}m"
38
- end
39
-
40
- end
@@ -1,26 +0,0 @@
1
- require "foreman"
2
-
3
- class Foreman::ProcfileEntry
4
-
5
- attr_reader :name
6
- attr_reader :command
7
- attr_accessor :color
8
-
9
- def initialize(name, command)
10
- @name = name
11
- @command = command
12
- end
13
-
14
- def spawn(num, pipe, basedir, environment, base_port)
15
- (1..num).to_a.map do |n|
16
- process = Foreman::Process.new(self, n, base_port + (n-1))
17
- process.run(pipe, basedir, environment)
18
- process
19
- end
20
- end
21
-
22
- def to_s
23
- "#{name}: #{command}"
24
- end
25
-
26
- end
data/lib/foreman/utils.rb DELETED
@@ -1,18 +0,0 @@
1
- require "foreman"
2
-
3
- class Foreman::Utils
4
-
5
- def self.parse_concurrency(concurrency)
6
- begin
7
- pairs = concurrency.to_s.gsub(/\s/, "").split(",")
8
-
9
- default = concurrency.nil? ? 1 : 0
10
-
11
- pairs.inject(Hash.new(default)) do |hash, pair|
12
- process, amount = pair.split("=")
13
- hash.update(process => amount.to_i)
14
- end
15
- end
16
- end
17
-
18
- end
@@ -1,31 +0,0 @@
1
- require "spec_helper"
2
- require "foreman/color"
3
-
4
- describe Foreman::Color do
5
-
6
- let(:io) { Object.new }
7
-
8
- it "should extend an object with colorization" do
9
- Foreman::Color.enable(io)
10
- io.should respond_to(:color)
11
- end
12
-
13
- it "should not colorize if the object does not respond to isatty" do
14
- mock(io).respond_to?(:isatty) { false }
15
- Foreman::Color.enable(io)
16
- io.color(:white).should == ""
17
- end
18
-
19
- it "should not colorize if the object is not a tty" do
20
- mock(io).isatty { false }
21
- Foreman::Color.enable(io)
22
- io.color(:white).should == ""
23
- end
24
-
25
- it "should colorize if the object is a tty" do
26
- mock(io).isatty { true }
27
- Foreman::Color.enable(io)
28
- io.color(:white).should == "\e[37m"
29
- end
30
-
31
- end
@@ -1,13 +0,0 @@
1
- require 'spec_helper'
2
- require 'foreman/procfile_entry'
3
- require 'pathname'
4
- require 'tmpdir'
5
-
6
- describe Foreman::ProcfileEntry do
7
- subject { described_class.new('alpha', './alpha') }
8
-
9
- it "stringifies as a Procfile line" do
10
- subject.to_s.should == 'alpha: ./alpha'
11
- end
12
-
13
- end
@@ -1,24 +0,0 @@
1
-
2
- [program:app-alpha]
3
- command=./alpha
4
- autostart=true
5
- autorestart=true
6
- stopsignal=QUIT
7
- stdout_logfile=/var/log/app/alpha-1-out.log
8
- stderr_logfile=/var/log/app/alpha-1-err.log
9
- user=app
10
- directory=/tmp/app
11
- environment=QUEUE="fastqueue,slowqueue",VERBOSE="1",PORT="5000"
12
- [program:app-bravo]
13
- command=./bravo
14
- autostart=true
15
- autorestart=true
16
- stopsignal=QUIT
17
- stdout_logfile=/var/log/app/bravo-1-out.log
18
- stderr_logfile=/var/log/app/bravo-1-err.log
19
- user=app
20
- directory=/tmp/app
21
- environment=QUEUE="fastqueue,slowqueue",VERBOSE="1",PORT="5100"
22
-
23
- [group:app]
24
- programs=app-alpha,app-bravo
@@ -1,21 +0,0 @@
1
-
2
- [program:app-alpha]
3
- command=./alpha
4
- autostart=true
5
- autorestart=true
6
- stopsignal=QUIT
7
- stdout_logfile=/var/log/app/alpha-1-out.log
8
- stderr_logfile=/var/log/app/alpha-1-err.log
9
- user=app
10
- directory=/tmp/app
11
- environment=FOO="bar",PORT="5000"
12
- [program:app-bravo]
13
- command=./bravo
14
- autostart=true
15
- autorestart=true
16
- stopsignal=QUIT
17
- stdout_logfile=/var/log/app/bravo-1-out.log
18
- stderr_logfile=/var/log/app/bravo-1-err.log
19
- user=app
20
- directory=/tmp/app
21
- environment=FOO="bar",PORT="5100"
@@ -1,24 +0,0 @@
1
-
2
- [program:app-alpha]
3
- command=./alpha
4
- autostart=true
5
- autorestart=true
6
- stopsignal=QUIT
7
- stdout_logfile=/var/log/app/alpha-1-out.log
8
- stderr_logfile=/var/log/app/alpha-1-err.log
9
- user=app
10
- directory=/tmp/app
11
- environment=PORT="5000"
12
- [program:app-bravo]
13
- command=./bravo
14
- autostart=true
15
- autorestart=true
16
- stopsignal=QUIT
17
- stdout_logfile=/var/log/app/bravo-1-out.log
18
- stderr_logfile=/var/log/app/bravo-1-err.log
19
- user=app
20
- directory=/tmp/app
21
- environment=PORT="5100"
22
-
23
- [group:app]
24
- programs=app-alpha,app-bravo