dotenv 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dotenv.rb +3 -3
- data/lib/dotenv/environment.rb +1 -1
- data/lib/dotenv/parser.rb +2 -2
- data/lib/dotenv/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5508950dd1e5103013a6bfe56b9397e41c40f11e
|
4
|
+
data.tar.gz: ee3ccf9b9429d44b7ad9482159dc300407a52847
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6550d4890592e8cb8afb5cda664cb07fb89477784ea112887716f81d8f4a5020e46e222648dbc7b4c034254eb230d4185b577a0897a34cfa5e0220bd70ce891e
|
7
|
+
data.tar.gz: 083105855f61a20b42f1f2423dfa8fd8dc30efcd6760a2789d5cd0b7c0d85beb759bb574016bf2833c71055191cba6ccb70bcc55e5f525513618b6f359b612ad
|
data/lib/dotenv.rb
CHANGED
@@ -39,11 +39,11 @@ module Dotenv
|
|
39
39
|
# Internal: Helper to expand list of filenames.
|
40
40
|
#
|
41
41
|
# Returns a hash of all the loaded environment variables.
|
42
|
-
def with(*filenames
|
42
|
+
def with(*filenames)
|
43
43
|
filenames << ".env" if filenames.empty?
|
44
44
|
|
45
45
|
filenames.reduce({}) do |hash, filename|
|
46
|
-
hash.merge!
|
46
|
+
hash.merge!(yield(File.expand_path(filename)) || {})
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
@@ -51,7 +51,7 @@ module Dotenv
|
|
51
51
|
if instrumenter
|
52
52
|
instrumenter.instrument(name, payload, &block)
|
53
53
|
else
|
54
|
-
|
54
|
+
yield
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
data/lib/dotenv/environment.rb
CHANGED
data/lib/dotenv/parser.rb
CHANGED
@@ -55,10 +55,10 @@ module Dotenv
|
|
55
55
|
@hash[key] = parse_value(value || "")
|
56
56
|
elsif line.split.first == "export"
|
57
57
|
if variable_not_set?(line)
|
58
|
-
|
58
|
+
raise FormatError, "Line #{line.inspect} has an unset variable"
|
59
59
|
end
|
60
60
|
elsif line !~ /\A\s*(?:#.*)?\z/ # not comment or blank line
|
61
|
-
|
61
|
+
raise FormatError, "Line #{line.inspect} doesn't match format"
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
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: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Keepers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: rubocop
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.37.2
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.37.2
|
55
55
|
description: Loads environment variables from `.env`.
|
56
56
|
email:
|
57
57
|
- brandon@opensoul.org
|