Permalink
Browse files

Merge pull request #280 from BIAINC/windows/host-support

Strip Windows Line Endings
  • Loading branch information...
2 parents fe65c75 + 89bdc3a commit 21dd610eaf2ebe080370eef406f8b584e435cdad @ddollar committed Jan 14, 2013
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/foreman/env.rb
  2. +1 −1 lib/foreman/procfile.rb
View
@@ -5,7 +5,7 @@ class Foreman::Env
attr_reader :entries
def initialize(filename)
- @entries = File.read(filename).split("\n").inject({}) do |ax, line|
+ @entries = File.read(filename).gsub("\r\n","\n").split("\n").inject({}) do |ax, line|
if line =~ /\A([A-Za-z_0-9]+)=(.*)\z/
key = $1
case val = $2
View
@@ -82,7 +82,7 @@ def to_s
private
def parse(filename)
- File.read(filename).split("\n").map do |line|
+ File.read(filename).gsub("\r\n","\n").split("\n").map do |line|
if line =~ /^([A-Za-z0-9_]+):\s*(.+)$/
[$1, $2]
end

0 comments on commit 21dd610

Please sign in to comment.