From 2042de7732d871c3825406006de66e4438f0a3d1 Mon Sep 17 00:00:00 2001 From: Matt Haynes Date: Thu, 28 Jul 2011 11:40:31 +0100 Subject: [PATCH] Fix bug where blank lines in Procfile break Foreman. --- lib/foreman/engine.rb | 2 +- spec/spec_helper.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/foreman/engine.rb b/lib/foreman/engine.rb index 471f3df..c4938f1 100644 --- a/lib/foreman/engine.rb +++ b/lib/foreman/engine.rb @@ -25,7 +25,7 @@ class Foreman::Engine @processes ||= begin @order = [] procfile.split("\n").inject({}) do |hash, line| - next if line.strip == "" + next hash if line.strip == "" name, command = line.split(/ *: +/, 2) unless command warn_deprecated_procfile! diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index dbd2468..3dc2a7f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -27,6 +27,7 @@ end def write_procfile(procfile="Procfile") File.open(procfile, "w") do |file| file.puts "alpha: ./alpha" + file.puts "\n" file.puts "bravo: ./bravo" end File.expand_path(procfile)