Merge pull request #250 from szimek/249_multiline_strings

Handle multiline strings in .env file
This commit is contained in:
David Dollar
2012-09-14 01:34:10 -07:00
2 changed files with 11 additions and 1 deletions
+3 -1
View File
@@ -9,8 +9,10 @@ class Foreman::Env
if line =~ /\A([A-Za-z_0-9]+)=(.*)\z/
key = $1
case val = $2
# Remove single quotes
when /\A'(.*)'\z/ then ax[key] = $1
when /\A"(.*)"\z/ then ax[key] = $1.gsub(/\\(.)/, '\1')
# Remove double quotes and unescape string preserving newline characters
when /\A"(.*)"\z/ then ax[key] = $1.gsub('\n', "\n").gsub(/\\(.)/, '\1')
else ax[key] = val
end
end