Skip to content

Commit

Permalink
fix styling issue
Browse files Browse the repository at this point in the history
  • Loading branch information
flyfy1 committed Jun 19, 2015
1 parent e9bc4a0 commit 693023f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/dotenv/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def unescape_characters(value)
end

def expand_newlines(value)
value.gsub('\n', "\n").gsub('\r',"\r")
value.gsub('\n', "\n").gsub('\r', "\r")
end

def variable_not_set?(line)
Expand Down
5 changes: 2 additions & 3 deletions spec/dotenv/parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,17 @@ def env(string)
end

it "supports carriage return" do
expect(env("FOO=bar\rbaz=fbb")).to eql("FOO" => "bar", "baz" => 'fbb')
expect(env("FOO=bar\rbaz=fbb")).to eql("FOO" => "bar", "baz" => "fbb")
end

it "supports carriage return combine with new line" do
expect(env("FOO=bar\r\nbaz=fbb")).to eql("FOO" => "bar", "baz" => 'fbb')
expect(env("FOO=bar\r\nbaz=fbb")).to eql("FOO" => "bar", "baz" => "fbb")
end

it "expands carriage return in quoted strings" do
expect(env('FOO="bar\rbaz"')).to eql("FOO" => "bar\rbaz")
end


# This functionality is not supported on JRuby or Rubinius
if (!defined?(RUBY_ENGINE) || RUBY_ENGINE != "jruby") &&
!defined?(Rubinius)
Expand Down

0 comments on commit 693023f

Please sign in to comment.