dotenv 3.1.5 → 3.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dotenv/parser.rb +7 -7
- data/lib/dotenv/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ef0c37e3854d57f689650f8dd106baf862506689c27a3151f19d1e56c8c205d
|
4
|
+
data.tar.gz: 933c17a9b3974de22f762da60230f449a8b7b75b94949995301905d146289591
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a8fed1ea223636257222b690ca9320328d382671fe4023015ddd3aebbd0c778b8f904dab59e80c89309fc01c97e7bb0981c3c2b61833a4884b0c3744608a54b
|
7
|
+
data.tar.gz: 1cbe9de7f7587cb500464130cc1069f064630eff8ba905fc438080830aec6d7bd193dd5b97b22f71446f78313e1840c4fd147677be2b134e00853f58dafe8ec2
|
data/lib/dotenv/parser.rb
CHANGED
@@ -52,11 +52,11 @@ module Dotenv
|
|
52
52
|
@string.scan(LINE) do
|
53
53
|
match = $LAST_MATCH_INFO
|
54
54
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
55
|
+
if existing?(match[:key])
|
56
|
+
# Use value from already defined variable
|
57
|
+
@hash[match[:key]] = ENV[match[:key]]
|
58
|
+
elsif match[:export] && !match[:value]
|
59
|
+
# Check for exported variable with no value
|
60
60
|
if !@hash.member?(match[:key])
|
61
61
|
raise FormatError, "Line #{match.to_s.inspect} has an unset variable"
|
62
62
|
end
|
@@ -70,8 +70,8 @@ module Dotenv
|
|
70
70
|
|
71
71
|
private
|
72
72
|
|
73
|
-
# Determine if
|
74
|
-
def
|
73
|
+
# Determine if a variable is already defined and should not be overwritten.
|
74
|
+
def existing?(key)
|
75
75
|
!@overwrite && key != "DOTENV_LINEBREAK_MODE" && ENV.key?(key)
|
76
76
|
end
|
77
77
|
|
data/lib/dotenv/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dotenv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Keepers
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -85,7 +85,7 @@ licenses:
|
|
85
85
|
- MIT
|
86
86
|
metadata:
|
87
87
|
changelog_uri: https://github.com/bkeepers/dotenv/releases
|
88
|
-
post_install_message:
|
88
|
+
post_install_message:
|
89
89
|
rdoc_options: []
|
90
90
|
require_paths:
|
91
91
|
- lib
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
103
|
rubygems_version: 3.5.22
|
104
|
-
signing_key:
|
104
|
+
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: Loads environment variables from `.env`.
|
107
107
|
test_files: []
|