Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fcfa913fb0 | ||
|
|
fc438472f9 | ||
|
|
fc95936327 | ||
|
|
0c27f78d46 |
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
foreman (0.29.0)
|
foreman (0.30.1)
|
||||||
term-ansicolor (~> 1.0.5)
|
term-ansicolor (~> 1.0.5)
|
||||||
thor (>= 0.13.6)
|
thor (>= 0.13.6)
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ require "tempfile"
|
|||||||
require "timeout"
|
require "timeout"
|
||||||
require "term/ansicolor"
|
require "term/ansicolor"
|
||||||
require "fileutils"
|
require "fileutils"
|
||||||
|
require "thread"
|
||||||
|
|
||||||
class Foreman::Engine
|
class Foreman::Engine
|
||||||
|
|
||||||
@@ -115,7 +116,7 @@ private ######################################################################
|
|||||||
print "#{Time.now.strftime("%H:%M:%S")} #{pad_process_name(name)} | "
|
print "#{Time.now.strftime("%H:%M:%S")} #{pad_process_name(name)} | "
|
||||||
print Term::ANSIColor.reset
|
print Term::ANSIColor.reset
|
||||||
print message.chomp
|
print message.chomp
|
||||||
puts
|
puts ""
|
||||||
end
|
end
|
||||||
|
|
||||||
def print(message=nil)
|
def print(message=nil)
|
||||||
|
|||||||
+14
-2
@@ -27,9 +27,21 @@ class Foreman::Process
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def fork_with_io(command)
|
||||||
|
io = case RUBY_VERSION
|
||||||
|
when /^1\.9\./
|
||||||
|
IO.popen([Foreman.runner, replace_command_env(command)], "w+")
|
||||||
|
when /^1\.8\./
|
||||||
|
full_command = replace_command_env(command).gsub("'", "\\'")
|
||||||
|
IO.popen("#{Foreman.runner} '#{full_command}'", "w+")
|
||||||
|
else
|
||||||
|
raise "Unknown Ruby version: #{RUBY_VERSION}"
|
||||||
|
end
|
||||||
|
[ io, io.pid ]
|
||||||
|
end
|
||||||
|
|
||||||
def run_process(command, pipe)
|
def run_process(command, pipe)
|
||||||
io = IO.popen([Foreman.runner, replace_command_env(command)], "w+")
|
io, @pid = fork_with_io(command)
|
||||||
@pid = io.pid
|
|
||||||
trap("SIGTERM") { "got sigterm for %d" % @pid }
|
trap("SIGTERM") { "got sigterm for %d" % @pid }
|
||||||
output pipe, "started with pid %d" % @pid
|
output pipe, "started with pid %d" % @pid
|
||||||
Thread.new do
|
Thread.new do
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
module Foreman
|
module Foreman
|
||||||
|
|
||||||
VERSION = "0.29.0"
|
VERSION = "0.30.1"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user