foreman 0.51.0-java → 0.52.0-java

Sign up to get free protection for your applications and to get access to all the features.
data/bin/foreman-runner CHANGED
@@ -1,6 +1,6 @@
1
- #!/bin/sh
1
+ #!/bin/bash
2
2
  #
3
- #/ Usage: foreman-runner [-d <dir>] <command> [<args>...]
3
+ #/ Usage: foreman-runner [-d <dir>] [-p] <command> [<args>...]
4
4
  #/
5
5
  #/ Run a command with exec, optionally changing directory first
6
6
 
@@ -16,9 +16,12 @@ usage() {
16
16
  exit
17
17
  }
18
18
 
19
- while getopts ":hd:" OPT; do
19
+ read_profiled=""
20
+
21
+ while getopts ":hd:p" OPT; do
20
22
  case $OPT in
21
23
  d) cd "$OPTARG" ;;
24
+ p) read_profiled="1" ;;
22
25
  h) usage ;;
23
26
  \?) error "invalid option: -$OPTARG" ;;
24
27
  :) error "option -$OPTARG requires an argument" ;;
@@ -29,4 +32,13 @@ shift $((OPTIND-1))
29
32
 
30
33
  [ -z "$1" ] && usage
31
34
 
35
+ if [ "$read_profiled" == "1" ]; then
36
+ shopt -s nullglob
37
+ for script in .profile.d/*; do
38
+ echo "sourcing $script"
39
+ source $script
40
+ done
41
+ shopt -u nullglob
42
+ fi
43
+
32
44
  exec "$@"
@@ -6,3 +6,6 @@ bash << "EOF"
6
6
  EOF
7
7
 
8
8
  end script
9
+
10
+ start on started network
11
+ stop on stopping network
@@ -43,23 +43,20 @@ class Foreman::Process
43
43
  Process.spawn env, expanded_command, :out => output, :err => output
44
44
  end
45
45
  elsif Foreman.jruby?
46
- Dir.chdir(cwd) do
47
- require "posix/spawn"
48
- POSIX::Spawn.spawn env, command, :out => output, :err => output
49
- end
46
+ require "posix/spawn"
47
+ wrapped_command = "#{Foreman.runner} -d '#{cwd}' -p -- #{command}"
48
+ POSIX::Spawn.spawn env, wrapped_command, :out => output, :err => output
50
49
  elsif Foreman.ruby_18?
51
- Dir.chdir(cwd) do
52
- fork do
53
- $stdout.reopen output
54
- $stderr.reopen output
55
- env.each { |k,v| ENV[k] = v }
56
- exec command
57
- end
50
+ fork do
51
+ $stdout.reopen output
52
+ $stderr.reopen output
53
+ env.each { |k,v| ENV[k] = v }
54
+ wrapped_command = "#{Foreman.runner} -d '#{cwd}' -p -- #{command}"
55
+ exec wrapped_command
58
56
  end
59
57
  else
60
- Dir.chdir(cwd) do
61
- Process.spawn env, command, :out => output, :err => output
62
- end
58
+ wrapped_command = "#{Foreman.runner} -d '#{cwd}' -p -- #{command}"
59
+ Process.spawn env, wrapped_command, :out => output, :err => output
63
60
  end
64
61
  end
65
62
 
@@ -96,7 +93,7 @@ class Foreman::Process
96
93
  private
97
94
 
98
95
  def cwd
99
- @options[:cwd] || "."
96
+ File.expand_path(@options[:cwd] || ".")
100
97
  end
101
98
 
102
99
  end
@@ -1,5 +1,5 @@
1
1
  module Foreman
2
2
 
3
- VERSION = "0.51.0"
3
+ VERSION = "0.52.0"
4
4
 
5
5
  end
@@ -6,3 +6,6 @@ bash << "EOF"
6
6
  EOF
7
7
 
8
8
  end script
9
+
10
+ start on started network
11
+ stop on stopping network
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.51.0
4
+ version: 0.52.0
5
5
  prerelease:
6
6
  platform: java
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-11 00:00:00.000000000 Z
12
+ date: 2012-07-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &70203687847680 !ruby/object:Gem::Requirement
16
+ requirement: &70211491658580 !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: *70203687847680
24
+ version_requirements: *70211491658580
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: posix-spawn
27
- requirement: &70203687840660 !ruby/object:Gem::Requirement
27
+ requirement: &70211491674340 !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: *70203687840660
35
+ version_requirements: *70211491674340
36
36
  description: Process manager for applications with multiple components
37
37
  email: ddollar@gmail.com
38
38
  executables: