dotenv 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3963c1ba53e439322c807f8312b8a8f9ebd0766e4d03757b41e5ce6b4bb43bc5
4
- data.tar.gz: a7f026d236de3dbac4a1bd08a28cee474159abedb750ff5a6b3e545f1aa5cf15
3
+ metadata.gz: bab83f38498b4f584932febd979ddd617e4e76616b1b47ebcc59de286397583d
4
+ data.tar.gz: c7aeaec1a28c5e6241d16678ea2e02110f90afbab3a756859af6785287499181
5
5
  SHA512:
6
- metadata.gz: 9bd6a081fb16b6115340a1d0751e5886a8333137061121c7adbe6c2757d8199cf3c23ae374bc9fa2dcac7faeb6c4533a30ce28f5e5eb34eac9fce1b9308cf10c
7
- data.tar.gz: deeb7d87a65e8e7f1af595a822abd1b81ade441a46fbe1b7188e1d511ad621ceb3c45b1509580e5ceab7c957b7b49ea2d3686eef0c91fb43d914c4a58f9d975c
6
+ metadata.gz: 1b5237c6135b36730bd5527e4afde96eae8fd3088b3375c8e0e467bc25130bbeb1916ec8b8e0134821c2eca517649b1105e44cdb298753e4b6762edc794e5fbb
7
+ data.tar.gz: 60e75a879959e13210d02096ddcc477ce5f133069be8584ea8995694dc4192ba9d0fd7e97bf5f73ba6d227d4ee016a80b465a08b6080baca9225d5f33a8a1730
data/README.md CHANGED
@@ -58,7 +58,7 @@ Dotenv.load('file1.env', 'file2.env')
58
58
 
59
59
  Since 3.0, dotenv in a Rails app will automatically restore `ENV` after each test. This means you can modify `ENV` in your tests without fear of leaking state to other tests. It works with both `ActiveSupport::TestCase` and `Rspec`.
60
60
 
61
- To disable this behavior, set `config.dotenv.autorestore = false` in `config/application.rb` or `config/environments/test.rb`.
61
+ To disable this behavior, set `config.dotenv.autorestore = false` in `config/application.rb` or `config/environments/test.rb`. It is disabled by default if your app uses [climate_control](https://github.com/thoughtbot/climate_control) or [ice_age](https://github.com/dpep/ice_age_rb).
62
62
 
63
63
  To use this behavior outside of a Rails app, just `require "dotenv/autorestore"` in your test suite.
64
64
 
data/lib/dotenv/rails.rb CHANGED
@@ -1,3 +1,9 @@
1
+ # Since rubygems doesn't support optional dependencies, we have to manually check
2
+ unless Gem::Requirement.new(">= 6.1").satisfied_by?(Gem::Version.new(Rails.version))
3
+ warn "dotenv 3.0 only supports Rails 6.1 or later. Use dotenv ~> 2.0."
4
+ return
5
+ end
6
+
1
7
  require "dotenv"
2
8
  require "dotenv/replay_logger"
3
9
  require "dotenv/log_subscriber"
@@ -27,12 +33,12 @@ module Dotenv
27
33
  logger: Dotenv::ReplayLogger.new,
28
34
  overwrite: false,
29
35
  files: [
30
- root.join(".env.#{env}.local"),
31
- (root.join(".env.local") unless env.test?),
32
- root.join(".env.#{env}"),
33
- root.join(".env")
36
+ ".env.#{env}.local",
37
+ (".env.local" unless env.test?),
38
+ ".env.#{env}",
39
+ ".env"
34
40
  ].compact,
35
- autorestore: env.test?
41
+ autorestore: env.test? && !defined?(ClimateControl) && !defined?(IceAge)
36
42
  )
37
43
  end
38
44
 
@@ -41,12 +47,12 @@ module Dotenv
41
47
  # This will get called during the `before_configuration` callback, but you
42
48
  # can manually call `Dotenv::Rails.load` if you needed it sooner.
43
49
  def load
44
- Dotenv.load(*files, overwrite: overwrite)
50
+ Dotenv.load(*files.map { |file| root.join(file).to_s }, overwrite: overwrite)
45
51
  end
46
52
 
47
53
  def overload
48
54
  deprecator.warn("Dotenv::Rails.overload is deprecated. Set `Dotenv::Rails.overwrite = true` and call Dotenv::Rails.load instead.")
49
- Dotenv.load(*files, overwrite: true)
55
+ Dotenv.load(*files.map { |file| root.join(file).to_s }, overwrite: true)
50
56
  end
51
57
 
52
58
  # Internal: `Rails.root` is nil in Rails 4.1 before the application is
@@ -1,3 +1,3 @@
1
1
  module Dotenv
2
- VERSION = "3.0.0".freeze
2
+ VERSION = "3.0.2".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.0
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Keepers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-12 00:00:00.000000000 Z
11
+ date: 2024-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake