Permit underscore for command name in Procfile.

This commit is contained in:
Kentaro Kuribayashi
2013-02-21 11:30:59 +09:00
parent 4e84b92536
commit 5ef8bbdbe3
3 changed files with 7 additions and 3 deletions

View File

@@ -83,7 +83,7 @@ private
def parse(filename)
File.read(filename).gsub("\r\n","\n").split("\n").map do |line|
if line =~ /^([A-Za-z0-9_]+):\s*(.+)$/
if line =~ /^([A-Za-z0-9_-]+):\s*(.+)$/
[$1, $2]
end
end.compact

View File

@@ -16,8 +16,10 @@ describe Foreman::Procfile, :fakefs do
it "loads a passed-in Procfile" do
write_procfile
procfile = Foreman::Procfile.new("Procfile")
procfile["alpha"].should == "./alpha"
procfile["bravo"].should == "./bravo"
procfile["alpha"].should == "./alpha"
procfile["bravo"].should == "./bravo"
procfile["foo-bar"].should == "./foo-bar"
procfile["foo_bar"].should == "./foo_bar"
end
it "can have a process appended to it" do

View File

@@ -79,6 +79,8 @@ def write_procfile(procfile="Procfile", alpha_env="")
file.puts "alpha: ./alpha" + " #{alpha_env}".rstrip
file.puts "\n"
file.puts "bravo:\t./bravo"
file.puts "foo_bar:\t./foo_bar"
file.puts "foo-bar:\t./foo-bar"
end
File.expand_path(procfile)
end