Permalink
Browse files

Merge pull request #1 from hecticjeff/newline-at-eof

Skip blank lines in procfile
  • Loading branch information...
2 parents ed963dc + c6ec2f0 commit f13a8660166e29719bf41825d540691ac43e94c8 @indexzero committed Aug 22, 2012
Showing with 9 additions and 1 deletion.
  1. +1 −0 lib/procfile.js
  2. +2 −0 test/fixtures/newline.procfile
  3. +1 −1 test/helpers.js
  4. +5 −0 test/procfile-test.js
View
@@ -43,6 +43,7 @@ procfile.parse = function (lines) {
var procs = {};
lines.split('\n').forEach(function (line) {
+ if (line === '') return;
var parts = line.split(':'),
details = parts[1].trim().split(' '),
name = parts[0];
@@ -0,0 +1,2 @@
+web: node myapp.js -p 80 --some-option
+worker: node myworker.js --other-option
View
@@ -10,7 +10,7 @@ var fs = require('fs'),
path = require('path');
var fixtures = path.join(__dirname, 'fixtures'),
- files = [path.join(fixtures, 'ruby.procfile'), path.join(fixtures, 'node.procfile')],
+ files = [path.join(fixtures, 'ruby.procfile'), path.join(fixtures, 'node.procfile'), path.join(fixtures, 'newline.procfile')],
procfiles = {};
var helpers = exports;
View
@@ -42,6 +42,11 @@ vows.describe('procfile').addBatch({
});
helpers.putParsed('node', procs);
+ },
+ "with newline at end of file": function() {
+ assert.doesNotThrow(function() {
+ var procs = procfile.parse(procfiles.newline);
+ });
}
}
}

0 comments on commit f13a866

Please sign in to comment.