lib/dotenv/parser.rb in dotenv-2.0.1 vs lib/dotenv/parser.rb in dotenv-2.0.2
- old
+ new
@@ -39,11 +39,11 @@
@string = string
@hash = {}
end
def call
- @string.split("\n").each do |line|
+ @string.split(/[\n\r]+/).each do |line|
parse_line(line)
end
@hash
end
@@ -81,10 +81,10 @@
def unescape_characters(value)
value.gsub(/\\([^$])/, '\1')
end
def expand_newlines(value)
- value.gsub('\n', "\n")
+ value.gsub('\n', "\n").gsub('\r', "\r")
end
def variable_not_set?(line)
!line.split[1..-1].all? { |var| @hash.member?(var) }
end