Permit underscore for command name in Procfile.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -18,6 +18,8 @@ describe Foreman::Procfile, :fakefs do
|
||||
procfile = Foreman::Procfile.new("Procfile")
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user