Compare commits

...

2 Commits

Author SHA1 Message Date
David Dollar
fc95936327 0.30.0 2011-12-22 16:34:02 -05:00
David Dollar
0c27f78d46 compatibility with ruby 1.8 2011-12-22 16:33:49 -05:00
4 changed files with 17 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
PATH
remote: .
specs:
foreman (0.29.0)
foreman (0.30.0)
term-ansicolor (~> 1.0.5)
thor (>= 0.13.6)

View File

@@ -115,7 +115,7 @@ private ######################################################################
print "#{Time.now.strftime("%H:%M:%S")} #{pad_process_name(name)} | "
print Term::ANSIColor.reset
print message.chomp
puts
puts ""
end
def print(message=nil)

View File

@@ -27,9 +27,21 @@ class Foreman::Process
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)
io = IO.popen([Foreman.runner, replace_command_env(command)], "w+")
@pid = io.pid
io, @pid = fork_with_io(command)
trap("SIGTERM") { "got sigterm for %d" % @pid }
output pipe, "started with pid %d" % @pid
Thread.new do

View File

@@ -1,5 +1,5 @@
module Foreman
VERSION = "0.29.0"
VERSION = "0.30.0"
end