We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 79c0f1c commit bf87415Copy full SHA for bf87415
lib/dotenv/parser.rb
@@ -43,7 +43,7 @@ def call(...)
43
44
def initialize(string, overwrite: false)
45
# Convert line breaks to same format
46
- @string = string.gsub(/[\n\r]+/, "\n")
+ @string = string.gsub(/\r\n?/, "\n")
47
@hash = {}
48
@overwrite = overwrite
49
end
spec/dotenv/parser_spec.rb
@@ -158,6 +158,11 @@ def env(...)
158
.to eql("foo" => "bar", "fizz" => "buzz")
159
160
161
+ it "does not ignore empty lines in quoted string" do
162
+ value = "a\n\nb\n\nc"
163
+ expect(env("FOO=\"#{value}\"")).to eql("FOO" => value)
164
+ end
165
+
166
it "ignores inline comments" do
167
expect(env("foo=bar # this is foo")).to eql("foo" => "bar")
168
0 commit comments