Skip to content

Commit

Permalink
Permit underscore for command name in Procfile.
Browse files Browse the repository at this point in the history
  • Loading branch information
kentaro committed Feb 21, 2013
1 parent 4e84b92 commit 5ef8bbd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/foreman/procfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def to_s

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
Expand Down
6 changes: 4 additions & 2 deletions spec/foreman/procfile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
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
Expand Down
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5ef8bbd

Please sign in to comment.