Permit underscore for command name in Procfile.
This commit is contained in:
@@ -83,7 +83,7 @@ private
|
|||||||
|
|
||||||
def parse(filename)
|
def parse(filename)
|
||||||
File.read(filename).gsub("\r\n","\n").split("\n").map do |line|
|
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]
|
[$1, $2]
|
||||||
end
|
end
|
||||||
end.compact
|
end.compact
|
||||||
|
|||||||
@@ -16,8 +16,10 @@ describe Foreman::Procfile, :fakefs do
|
|||||||
it "loads a passed-in Procfile" do
|
it "loads a passed-in Procfile" do
|
||||||
write_procfile
|
write_procfile
|
||||||
procfile = Foreman::Procfile.new("Procfile")
|
procfile = Foreman::Procfile.new("Procfile")
|
||||||
procfile["alpha"].should == "./alpha"
|
procfile["alpha"].should == "./alpha"
|
||||||
procfile["bravo"].should == "./bravo"
|
procfile["bravo"].should == "./bravo"
|
||||||
|
procfile["foo-bar"].should == "./foo-bar"
|
||||||
|
procfile["foo_bar"].should == "./foo_bar"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "can have a process appended to it" do
|
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 "alpha: ./alpha" + " #{alpha_env}".rstrip
|
||||||
file.puts "\n"
|
file.puts "\n"
|
||||||
file.puts "bravo:\t./bravo"
|
file.puts "bravo:\t./bravo"
|
||||||
|
file.puts "foo_bar:\t./foo_bar"
|
||||||
|
file.puts "foo-bar:\t./foo-bar"
|
||||||
end
|
end
|
||||||
File.expand_path(procfile)
|
File.expand_path(procfile)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user