dotenv 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dotenv/rails.rb +2 -2
- data/lib/dotenv/replay_logger.rb +8 -8
- data/lib/dotenv/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2ff4f17537b901cd35363188bcf31b756e7eab87039d76a43ffcf4196c474e2
|
4
|
+
data.tar.gz: a7703a4ccf3f72491896e8ded3289b457e610323ce0b8276bdd96eb2af15be18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fdb56b5a23015afb5e86de500a0a14e57fb07332317d552052f200aa4a86e57e6f452b24f6195dc910258d78d467f98748cefbfb225cc3a8c1ddbbf0c145795
|
7
|
+
data.tar.gz: c7cce79b3636e16388a4e1573865933c0f12a111316404d475d87cd1c06dc4f27565a6e1ffa34b34483aa577f57c42ea614cf75b33752fcc8985fe540a421488
|
data/lib/dotenv/rails.rb
CHANGED
@@ -4,7 +4,6 @@ unless Gem::Requirement.new(">= 6.1").satisfied_by?(Gem::Version.new(Rails.versi
|
|
4
4
|
return
|
5
5
|
end
|
6
6
|
|
7
|
-
require "dotenv"
|
8
7
|
require "dotenv/replay_logger"
|
9
8
|
require "dotenv/log_subscriber"
|
10
9
|
|
@@ -90,7 +89,8 @@ module Dotenv
|
|
90
89
|
|
91
90
|
initializer "dotenv", after: :initialize_logger do |app|
|
92
91
|
# Set up a new logger once Rails has initialized the logger and replay logs
|
93
|
-
new_logger =
|
92
|
+
new_logger = ::Rails.logger
|
93
|
+
new_logger = new_logger.tagged("dotenv") if new_logger.respond_to?(:tagged)
|
94
94
|
logger.replay new_logger if logger.respond_to?(:replay)
|
95
95
|
self.logger = new_logger
|
96
96
|
end
|
data/lib/dotenv/replay_logger.rb
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
module Dotenv
|
2
2
|
# A logger that can be used before the apps real logger is initialized.
|
3
|
-
class ReplayLogger
|
3
|
+
class ReplayLogger < Logger
|
4
4
|
def initialize
|
5
|
+
super(nil) # Doesn't matter what this is, it won't be used.
|
5
6
|
@logs = []
|
6
7
|
end
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
def respond_to_missing?(name, include_private = false)
|
13
|
-
(include_private ? Logger.instance_methods : Logger.public_instance_methods).include?(name) || super
|
9
|
+
# Override the add method to store logs so we can replay them to a real logger later.
|
10
|
+
def add(*args, &block)
|
11
|
+
@logs.push([args, block])
|
14
12
|
end
|
15
13
|
|
14
|
+
# Replay the store logs to a real logger.
|
16
15
|
def replay(logger)
|
17
|
-
@logs.each { |
|
16
|
+
@logs.each { |args, block| logger.add(*args, &block) }
|
17
|
+
@logs.clear
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
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.0.
|
4
|
+
version: 3.0.3
|
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-02-
|
11
|
+
date: 2024-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -84,7 +84,7 @@ homepage: https://github.com/bkeepers/dotenv
|
|
84
84
|
licenses:
|
85
85
|
- MIT
|
86
86
|
metadata: {}
|
87
|
-
post_install_message:
|
87
|
+
post_install_message:
|
88
88
|
rdoc_options: []
|
89
89
|
require_paths:
|
90
90
|
- lib
|
@@ -99,8 +99,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
|
-
rubygems_version: 3.
|
103
|
-
signing_key:
|
102
|
+
rubygems_version: 3.4.10
|
103
|
+
signing_key:
|
104
104
|
specification_version: 4
|
105
105
|
summary: Loads environment variables from `.env`.
|
106
106
|
test_files: []
|