dotenvx-rails 4.0.5 → 5.0.0

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -4
  3. data/README.md +28 -12
  4. data/lib/dotenvx/rails.rb +1 -14
  5. metadata +7 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebc8095a54222a9d46d6dbf6ac39d597daadefc34db520b47d4167099af5a1bb
4
- data.tar.gz: 55df5a737f550b99a748fa4c94348bdada9c10602c5ab016e4025edac8d7abf5
3
+ metadata.gz: d6dde717743d09fe6cf1add1887100ee7626520be468cabd77e2640094afed6b
4
+ data.tar.gz: 8985b91ec428d43b9f1f8305ff9815bb4b5ba2af5a72fa4b0448f9f8eb85ae66
5
5
  SHA512:
6
- metadata.gz: db7c64cd4e67d0522673f4fa18a5cc72887b28c6a099b941662b43c135ce13c42c48eac19ccb2f47227049d137aad3d4dec828c84f7eef6b882657fbd3c0c43e
7
- data.tar.gz: 75fcac8041b4634a1a6ecc9e0895b8528dccc1417e264a5737f5e8603f76fb5cbe6c328cadcbf7d0e547cdd7fd4c83c20a14c0116464ea090085564b6196eeb4
6
+ metadata.gz: d9ed31d24c9e0c32899e30475ea42a6037b77710477c924931d578d4d5c33f3a9c7aaf18b91036a088eaa6765f07b1c2728c8ee0d116a72adc015122c6d7fdae
7
+ data.tar.gz: 17f3a8458a4371ab329019ed2dcb11e9c54583dedd15abd7ce28715e64242a1497ff41faa4b6e404e52dee11721219277ba53b2a204e9b469bb1e8c1f7b72d69
data/CHANGELOG.md CHANGED
@@ -2,18 +2,18 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ## [Unreleased](https://github.com/dotenvx/dotenvx-ruby/compare/v4.0.5...main)
5
+ ## Unreleased
6
6
 
7
- ## [4.0.5](https://github.com/dotenvx/dotenvx-ruby/compare/v4.0.4...v4.0.5)
7
+ ## 4.0.5
8
8
 
9
9
  - Continue after parse and decryption errors by default, with strict and
10
10
  error-code ignore options for callers that need them.
11
11
 
12
- ## [4.0.4](https://github.com/dotenvx/dotenvx-ruby/compare/v4.0.3...v4.0.4)
12
+ ## 4.0.4
13
13
 
14
14
  - Report the unique variables injected from readable dotenv files.
15
15
 
16
- ## [4.0.0](https://github.com/dotenvx/dotenvx-ruby/compare/v0.0.2...v4.0.0)
16
+ ## 4.0.0
17
17
 
18
18
  - Load plaintext and encrypted dotenv files through `dotenvx-primitives`.
19
19
  - Bundle the Rust implementation as a Magnus native extension.
data/README.md CHANGED
@@ -2,10 +2,9 @@
2
2
 
3
3
  *a secure dotenv–from the creator of [`dotenv`](https://github.com/motdotla/dotenv).*
4
4
 
5
- `dotenvx` loads plaintext and encrypted dotenv files through the shared
6
- [`dotenvx-primitives`](https://crates.io/crates/dotenvx-primitives) Rust
7
- implementation. The native extension is bundled in the gem; users do not need
8
- Node.js, a dotenvx CLI, or a Rust toolchain.
5
+ `dotenvx` loads plaintext and encrypted dotenv files through the shared `dotenvx-sdk` Rust loader, backed by published
6
+ [`dotenvx-primitives`](https://crates.io/crates/dotenvx-primitives). The native extension is bundled in the gem; users do not need
7
+ Node.js or a Rust toolchain.
9
8
 
10
9
  ## Install
11
10
 
@@ -61,14 +60,10 @@ Raise when a file is missing:
61
60
  Dotenvx.load!(".env")
62
61
  ```
63
62
 
64
- Require configuration keys:
65
-
66
- ```ruby
67
- Dotenvx.require_keys("DATABASE_URL", "SECRET_KEY")
68
- ```
69
-
70
- Encrypted values are decrypted automatically when the matching private key is
71
- available through the process environment, `<filename>.keys`, or `.env.keys`.
63
+ Encrypted values are decrypted automatically with keys from the process
64
+ environment, `<filename>.keys`, or `.env.keys`. For keys in Armor, 1Password,
65
+ or another custody provider, install a dotenvx CLI with `command-sdk` and the
66
+ matching feature.
72
67
 
73
68
  ## Native platforms
74
69
 
@@ -81,3 +76,24 @@ Tagged releases publish variants of the same `dotenvx` gem for:
81
76
  - Windows x64
82
77
 
83
78
  RubyGems selects the correct variant during `gem install dotenvx`.
79
+
80
+ ## Loading errors and policy
81
+
82
+ Loading errors are reported and loading continues by default. `strict: true`,
83
+ `load!` stops loading and raises before updating `ENV`. Selected error codes
84
+ can be ignored with `ignore: ["CODE"]`.
85
+
86
+ The shared loader returns redaction metadata without changing real application
87
+ values. Application-output redaction hooks are not installed by this adapter.
88
+
89
+ ## Shared file selection
90
+
91
+ File discovery, directory expansion, conventions, and key-based filename
92
+ inference are resolved by `dotenvx-sdk`. The CLI's file-selection and error-ignore
93
+ environment variables apply here too. Rails supplies its root and environment;
94
+ the shared loader chooses the Rails files and their order.
95
+
96
+ ```ruby
97
+ Dotenvx.load(convention: "nextjs")
98
+ Dotenvx.load("app", key_files: "shared/.env.keys")
99
+ ```
data/lib/dotenvx/rails.rb CHANGED
@@ -39,25 +39,12 @@ module Dotenvx
39
39
  def load
40
40
  return if @loaded
41
41
 
42
- Dotenvx.load(*dotenvx_files)
42
+ Dotenvx.load(root.to_s, convention: "rails", environment: Rails.env.to_s)
43
43
  @loaded = true
44
44
  end
45
45
 
46
46
  private
47
47
 
48
- def dotenvx_files
49
- environment = Rails.env
50
- files = [
51
- root.join(".env.#{environment}.local")
52
- ]
53
- files << root.join(".env.local") unless environment == "test"
54
- files.concat([
55
- root.join(".env.#{environment}"),
56
- root.join(".env")
57
- ])
58
- files
59
- end
60
-
61
48
  def root
62
49
  Pathname.new(Rails.root || ENV["RAILS_ROOT"] || Dir.pwd)
63
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dotenvx-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.5
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - motdotla
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 4.0.5
18
+ version: 5.0.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 4.0.5
25
+ version: 5.0.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: railties
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -77,13 +77,13 @@ files:
77
77
  - README.md
78
78
  - lib/dotenvx-rails.rb
79
79
  - lib/dotenvx/rails.rb
80
- homepage: https://github.com/dotenvx/dotenvx-ruby
80
+ homepage: https://github.com/dotenvx/dotenvx
81
81
  licenses:
82
82
  - BSD-3-Clause
83
83
  metadata:
84
- homepage_uri: https://github.com/dotenvx/dotenvx-ruby
85
- source_code_uri: https://github.com/dotenvx/dotenvx-ruby
86
- changelog_uri: https://github.com/dotenvx/dotenvx-ruby
84
+ homepage_uri: https://github.com/dotenvx/dotenvx
85
+ source_code_uri: https://github.com/dotenvx/dotenvx
86
+ changelog_uri: https://github.com/dotenvx/dotenvx
87
87
  rdoc_options: []
88
88
  require_paths:
89
89
  - lib