lib/foreman/engine.rb in foreman-0.10.1 vs lib/foreman/engine.rb in foreman-0.11.0
- old
+ new
@@ -23,11 +23,15 @@
def processes
@processes ||= begin
@order = []
procfile.split("\n").inject({}) do |hash, line|
next if line.strip == ""
- name, command = line.split(/:? +/, 2)
+ name, command = line.split(/ *: +/, 2)
+ unless command
+ warn_deprecated_procfile!
+ name, command = line.split(/ +/, 2)
+ end
process = Foreman::Process.new(name, command)
process.color = next_color
@order << process.name
hash.update(process.name => process)
end
@@ -174,8 +178,16 @@
def next_color
@current_color ||= -1
@current_color += 1
@current_color >= COLORS.length ? "" : COLORS[@current_color]
+ end
+
+ def warn_deprecated_procfile!
+ return if @already_warned_deprecated
+ @already_warned_deprecated = true
+ puts "!!! This format of Procfile is deprecated, and will not work starting in v0.12"
+ puts "!!! Use a colon to separate the process name from the command"
+ puts "!!! e.g. web: thin start"
end
end