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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bab83f38498b4f584932febd979ddd617e4e76616b1b47ebcc59de286397583d
4
- data.tar.gz: c7aeaec1a28c5e6241d16678ea2e02110f90afbab3a756859af6785287499181
3
+ metadata.gz: e2ff4f17537b901cd35363188bcf31b756e7eab87039d76a43ffcf4196c474e2
4
+ data.tar.gz: a7703a4ccf3f72491896e8ded3289b457e610323ce0b8276bdd96eb2af15be18
5
5
  SHA512:
6
- metadata.gz: 1b5237c6135b36730bd5527e4afde96eae8fd3088b3375c8e0e467bc25130bbeb1916ec8b8e0134821c2eca517649b1105e44cdb298753e4b6762edc794e5fbb
7
- data.tar.gz: 60e75a879959e13210d02096ddcc477ce5f133069be8584ea8995694dc4192ba9d0fd7e97bf5f73ba6d227d4ee016a80b465a08b6080baca9225d5f33a8a1730
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 = ActiveSupport::TaggedLogging.new(::Rails.logger).tagged("dotenv")
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
@@ -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
- def method_missing(name, *args, &block)
9
- @logs.push([name, args, block])
10
- end
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 { |name, args, block| logger.send(name, *args, &block) }
16
+ @logs.each { |args, block| logger.add(*args, &block) }
17
+ @logs.clear
18
18
  end
19
19
  end
20
20
  end
@@ -1,3 +1,3 @@
1
1
  module Dotenv
2
- VERSION = "3.0.2".freeze
2
+ VERSION = "3.0.3".freeze
3
3
  end
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.2
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-15 00:00:00.000000000 Z
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.5.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: []