commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
44072bebfdae9e61344632c53188fd404c809b32 | Martin Algesten | 2023-12-09T14:06:52 | Avoid increasing position if write fail | diff --git a/src/lib.rs b/src/lib.rs
index bfeff88..11d814b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -9,8 +9,8 @@ mod util;
mod model;
pub use model::{Call, CallState, Output};
-mod state_vars;
-pub use state_vars::{method, state, version};
+mod vars;
+pub use vars::{method, state, version};
#[derive(Debug, C... | 6 | 89 | 17 |
e53e3f00142f7ab3c87b4b7f5da600fbff5a4195 | Martin Algesten | 2023-12-09T13:19:42 | Structure code | diff --git a/src/call.rs b/src/call.rs
deleted file mode 100644
index e75e383..0000000
--- a/src/call.rs
+++ /dev/null
@@ -1,386 +0,0 @@
-use core::fmt::{self, Write};
-use core::marker::PhantomData;
-use core::mem;
-use core::mem::align_of;
-use core::mem::size_of;
-use core::ops::Deref;
-
-use crate::H1Error;
-use cr... | 8 | 430 | 394 |
f646f4b0417e6b619b9e8877c514da47edd14a85 | Martin Algesten | 2023-12-09T10:59:30 | More modelling | diff --git a/src/call.rs b/src/call.rs
index a9ffd48..e75e383 100644
--- a/src/call.rs
+++ b/src/call.rs
@@ -3,6 +3,7 @@ use core::marker::PhantomData;
use core::mem;
use core::mem::align_of;
use core::mem::size_of;
+use core::ops::Deref;
use crate::H1Error;
use crate::Result;
@@ -29,12 +30,12 @@ impl CallState<... | 2 | 138 | 116 |
660d237adb1392bbd952855e841d9c466414a388 | Allan | 2024-10-10T16:14:35 | Move deps to workspace | diff --git a/Cargo.toml b/Cargo.toml
index f65d2a0..a4db37b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,4 +16,9 @@ repository = "https://github.com/allan2/dotenvy"
all = "deny"
pedantic = "deny"
nursery = "deny"
-cargo = "deny"
\ No newline at end of file
+cargo = "deny"
+
+[workspace.dependencies]
+proc-macro2 ... | 3 | 12 | 7 |
da2abcae16bf904e676a7e26876b823d47ba1c25 | Allan | 2024-10-10T16:03:09 | Move package metadata to workspace Cargo.toml
This moves a lot of metadata to the workspace.
Crates will have synced versions in the future. | diff --git a/Cargo.toml b/Cargo.toml
index 302fbfa..f65d2a0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,6 +2,16 @@
members = ["dotenvy", "dotenvy-macros", "dotenv_codegen", "examples/*"]
resolver = "2"
+[workspace.package]
+version = "0.15.7"
+edition = "2021"
+rust-version = "1.74.0"
+license = "MIT"
+categorie... | 4 | 37 | 27 |
c6c61dc8693505da4cac6e90c4a98fa3fdb0f763 | Allan | 2024-10-10T15:31:09 | clippy
dotenv_codegen did not previously use clippy groups.
This commit corrects the only warning. | diff --git a/dotenv_codegen/src/lib.rs b/dotenv_codegen/src/lib.rs
index 1879892..9f52d43 100644
--- a/dotenv_codegen/src/lib.rs
+++ b/dotenv_codegen/src/lib.rs
@@ -3,7 +3,7 @@ use proc_macro::TokenStream;
use proc_macro2::TokenStream as TokenStream2;
use quote::quote;
use std::env::{self, VarError};
-use syn::{pars... | 1 | 2 | 2 |
9b3ed2899598911fe3f9e307671038aa53d6f8f8 | Allan | 2024-10-10T15:29:22 | Move clippy groups from crates to workspace | diff --git a/Cargo.toml b/Cargo.toml
index 02feade..302fbfa 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,3 +1,9 @@
[workspace]
members = ["dotenvy", "dotenvy-macros", "dotenv_codegen", "examples/*"]
resolver = "2"
+
+[workspace.lints.clippy]
+all = "deny"
+pedantic = "deny"
+nursery = "deny"
+cargo = "deny"
\ No n... | 6 | 16 | 3 |
db89b9d8361dff8a6032fadbad15e50ee5eefed7 | Allan | 2024-10-05T15:10:42 | Improve readability of `assert_str`
- function renamed.
- `input` renamed to `actual` which gives clearer IDE hints. | diff --git a/dotenvy/src/parse.rs b/dotenvy/src/parse.rs
index f8d5941..671de97 100644
--- a/dotenvy/src/parse.rs
+++ b/dotenvy/src/parse.rs
@@ -405,8 +405,8 @@ mod substitution_tests {
use crate::iter::{Iter, ParseBufError};
/// Asserts the parsed string is equal to the expected string.
- fn assert_stri... | 1 | 16 | 16 |
85e13d17fdfbc5cebdb0021bafd492f026d96dea | Allan | 2024-10-05T14:53:00 | Add async usage guidance for attribute macro | diff --git a/dotenvy-macros/src/lib.rs b/dotenvy-macros/src/lib.rs
index 4d8c5bc..48e17a2 100644
--- a/dotenvy-macros/src/lib.rs
+++ b/dotenvy-macros/src/lib.rs
@@ -13,6 +13,8 @@ use syn::{
/// Three optional arguments are supported: `path`, `required`, and `override_`.
/// Usage is like `#[dotenvy::load(path = ".env... | 1 | 2 | 0 |
f040116fdfd47614ad61d2ecc5dce38d3abd6068 | Allan | 2024-10-05T14:30:18 | More documentation in examples
This adds more description in the examples.
We also use `unwrap` sometimes when calling `env::var` for simplicity. | diff --git a/examples/find/src/main.rs b/examples/find/src/main.rs
index 90b0e1e..abc31cf 100644
--- a/examples/find/src/main.rs
+++ b/examples/find/src/main.rs
@@ -1,4 +1,5 @@
//! This example shows finding an env file by filename.
+
use dotenvy::EnvLoader;
use std::{
env, error, fs, io,
diff --git a/examples/... | 7 | 36 | 18 |
9a9dd354febaaae9e0ac30468d28c2d46f034b9f | Allan | 2024-10-05T13:54:07 | Simplify attribute macro error message
The custom message is redundant now that `dotenvy::Error` includes more info. | diff --git a/dotenvy-macros/src/lib.rs b/dotenvy-macros/src/lib.rs
index bf4d904..4d8c5bc 100644
--- a/dotenvy-macros/src/lib.rs
+++ b/dotenvy-macros/src/lib.rs
@@ -38,7 +38,7 @@ pub fn load(attr: TokenStream, item: TokenStream) -> TokenStream {
match (io_err.kind(), #required) {
(... | 1 | 1 | 1 |
cab1d688cef734bef38074fc0491a71d7ac8ed8e | Allan | 2024-10-05T13:51:05 | Fix syn 2 `ItemFn` dep | diff --git a/dotenvy-macros/Cargo.toml b/dotenvy-macros/Cargo.toml
index 2129a16..142b261 100644
--- a/dotenvy-macros/Cargo.toml
+++ b/dotenvy-macros/Cargo.toml
@@ -18,7 +18,7 @@ proc-macro = true
[dependencies]
proc-macro2 = "1"
quote = "1"
-syn = { version = "2", features = ["parsing"] }
+syn = { version = "2", fe... | 1 | 1 | 1 |
474d974052b5bd6ade08583bd6470ac737ddec1f | Augusto César | 2024-09-26T10:58:54 | fix: correct check for required attribute
### Description
Currently, in the current code, the `required` attribute does not work as expected.
On the code path where it should "continue if not required" actually just fallback into the error printing and process exiting.
Small reproducible example:
```rust
#[dotenvy::l... | diff --git a/dotenvy-macros/src/lib.rs b/dotenvy-macros/src/lib.rs
index cae16ff..bf4d904 100644
--- a/dotenvy-macros/src/lib.rs
+++ b/dotenvy-macros/src/lib.rs
@@ -35,12 +35,15 @@ pub fn load(attr: TokenStream, item: TokenStream) -> TokenStream {
let mut loader = EnvLoader::with_path(#path).sequence(seq);
... | 1 | 7 | 4 |
40a964d2451498f280ee3b41e4ac0f1b68cbb294 | Allan | 2024-09-09T16:40:12 | Remove CLI as a default feature | diff --git a/dotenvy/Cargo.toml b/dotenvy/Cargo.toml
index 3e65d84..96ebbd9 100644
--- a/dotenvy/Cargo.toml
+++ b/dotenvy/Cargo.toml
@@ -33,6 +33,6 @@ dotenvy-macros = { path = "../dotenvy-macros", optional = true }
temp-env = "0.3.6"
[features]
-default = ["cli"]
+default = []
cli = ["dep:clap"]
macros = ["dep:d... | 1 | 1 | 1 |
c2070b01f38812cc2723b2b5b01bf7891048f164 | Allan | 2024-09-09T14:41:53 | Fix default construction path | diff --git a/dotenvy-macros/src/lib.rs b/dotenvy-macros/src/lib.rs
index 79e6147..cae16ff 100644
--- a/dotenvy-macros/src/lib.rs
+++ b/dotenvy-macros/src/lib.rs
@@ -13,7 +13,7 @@ use syn::{
/// Three optional arguments are supported: `path`, `required`, and `override_`.
/// Usage is like `#[dotenvy::load(path = ".env... | 2 | 5 | 4 |
169a60e7334355e32e69265be883d55c99c145e1 | Allan | 2024-09-09T14:41:22 | Inline fmt args, default error message | diff --git a/dotenv_codegen/src/lib.rs b/dotenv_codegen/src/lib.rs
index a4baee4..1879892 100644
--- a/dotenv_codegen/src/lib.rs
+++ b/dotenv_codegen/src/lib.rs
@@ -13,8 +13,9 @@ pub fn dotenv(input: TokenStream) -> TokenStream {
}
unsafe fn dotenv_inner(input: TokenStream2) -> TokenStream2 {
- if let Err(e) = u... | 1 | 7 | 7 |
deb2b49a34a1eca589d43056aeb19d7d609ab545 | Allan | 2024-09-09T14:30:18 | clippy needless_raw_string_hashes | diff --git a/dotenvy/src/lib.rs b/dotenvy/src/lib.rs
index 09fbad9..99cbcca 100644
--- a/dotenvy/src/lib.rs
+++ b/dotenvy/src/lib.rs
@@ -1,4 +1,4 @@
-#![warn(clippy::all, clippy::pedantic, clippy::nursery, clippy::cargo)]
+#![deny(clippy::all, clippy::pedantic, clippy::nursery, clippy::cargo)]
#![allow(
clippy::m... | 1 | 10 | 10 |
9b3db892b07a448f84fc075ab6801496b3a1f6b4 | Allan | 2024-09-09T14:18:49 | Fix default path | diff --git a/dotenvy-macros/src/lib.rs b/dotenvy-macros/src/lib.rs
index b5ddd70..79e6147 100644
--- a/dotenvy-macros/src/lib.rs
+++ b/dotenvy-macros/src/lib.rs
@@ -10,10 +10,10 @@ use syn::{
/// Loads environment variables from a file and modifies the environment.
///
-/// Three optional arguments are supported: `... | 2 | 5 | 5 |
a8ff4142e016bfca4657430b73afd42b6e488e2f | Allan | 2024-09-09T14:16:54 | Upgrade syn 1 to syn 2
`override` argument named to `override_` because it is a keyword. | diff --git a/dotenvy-macros/Cargo.toml b/dotenvy-macros/Cargo.toml
index a57cb17..2129a16 100644
--- a/dotenvy-macros/Cargo.toml
+++ b/dotenvy-macros/Cargo.toml
@@ -18,7 +18,7 @@ proc-macro = true
[dependencies]
proc-macro2 = "1"
quote = "1"
-syn = { version = "1", features = ["full"] }
+syn = { version = "2", featu... | 3 | 57 | 32 |
43a167e34813eb9ee243f4858217c249d7432a51 | Allan | 2024-09-09T04:38:44 | Fix env file spelling
We consistenly use "env file" across the repo now. | diff --git a/dotenvy/src/bin/dotenvy.rs b/dotenvy/src/bin/dotenvy.rs
index 105c7b3..909e4af 100644
--- a/dotenvy/src/bin/dotenvy.rs
+++ b/dotenvy/src/bin/dotenvy.rs
@@ -25,7 +25,7 @@ fn mk_cmd(program: &str, args: &[String]) -> process::Command {
#[command(
name = "dotenvy",
version,
- about = "Run a comm... | 2 | 3 | 3 |
9663c8aacd81023b41f0a1744a8f4a1ba8f22c89 | Allan | 2024-09-08T21:14:06 | Attempt to fix Windows build
`cmd.exec` was accessible to the Windows code path, while also being
unreachable do to `exit(1)`. | diff --git a/dotenvy/src/bin/dotenvy.rs b/dotenvy/src/bin/dotenvy.rs
index 18185f1..105c7b3 100644
--- a/dotenvy/src/bin/dotenvy.rs
+++ b/dotenvy/src/bin/dotenvy.rs
@@ -86,7 +86,9 @@ fn main() -> Result<(), Box<dyn error::Error>> {
};
#[cfg(unix)]
- use std::os::unix::process::CommandExt;
- eprintln!(... | 1 | 5 | 3 |
6822a04a42d96a2815a890b39d94584247772d2e | Allan | 2024-09-08T21:10:21 | More useful comment for CLI file arg | diff --git a/dotenvy/src/bin/dotenvy.rs b/dotenvy/src/bin/dotenvy.rs
index 15b6630..18185f1 100644
--- a/dotenvy/src/bin/dotenvy.rs
+++ b/dotenvy/src/bin/dotenvy.rs
@@ -11,7 +11,6 @@
//! will output `bar`.
use clap::{Parser, Subcommand};
use dotenvy::{EnvLoader, EnvSequence};
-#[cfg(unix)]
use std::{error, fs::File... | 1 | 14 | 16 |
f4dec21185ea8843583dbb9e3f135f89b1670279 | Allan | 2024-09-08T21:05:18 | Remove die macro | diff --git a/dotenvy/src/bin/dotenvy.rs b/dotenvy/src/bin/dotenvy.rs
index be0a351..15b6630 100644
--- a/dotenvy/src/bin/dotenvy.rs
+++ b/dotenvy/src/bin/dotenvy.rs
@@ -11,19 +11,9 @@
//! will output `bar`.
use clap::{Parser, Subcommand};
use dotenvy::{EnvLoader, EnvSequence};
+#[cfg(unix)]
use std::{error, fs::Fil... | 1 | 14 | 19 |
23aade4f4edbb4c7a380a094ad7b334e78565088 | Allan | 2024-09-08T20:40:04 | Conditional Unix `use` | diff --git a/dotenvy/src/bin/dotenvy.rs b/dotenvy/src/bin/dotenvy.rs
index a4ba9c3..be0a351 100644
--- a/dotenvy/src/bin/dotenvy.rs
+++ b/dotenvy/src/bin/dotenvy.rs
@@ -11,7 +11,7 @@
//! will output `bar`.
use clap::{Parser, Subcommand};
use dotenvy::{EnvLoader, EnvSequence};
-use std::{error, fs::File, io::ErrorKin... | 1 | 2 | 1 |
5b4313af156a2761e0e72c0f958188fdbe037505 | Allan | 2024-09-08T20:39:31 | Remove unnecessary `extern` | diff --git a/dotenvy-macros/src/lib.rs b/dotenvy-macros/src/lib.rs
index 3df93c8..f508a53 100644
--- a/dotenvy-macros/src/lib.rs
+++ b/dotenvy-macros/src/lib.rs
@@ -1,10 +1,6 @@
#![warn(clippy::all, clippy::pedantic, clippy::nursery, clippy::cargo)]
#![deny(clippy::uninlined_format_args, clippy::wildcard_imports)]
... | 1 | 0 | 4 |
faeba1b6b2a5bc454a059690007b84b13a8ab271 | Allan | 2024-09-08T20:28:10 | Revert edition to 2021 | diff --git a/dotenv_codegen/Cargo.toml b/dotenv_codegen/Cargo.toml
index a6de4e6..a2289dc 100644
--- a/dotenv_codegen/Cargo.toml
+++ b/dotenv_codegen/Cargo.toml
@@ -1,5 +1,3 @@
-cargo-features = ["edition2024"]
-
[package]
name = "dotenvy_macro"
version = "0.15.7"
@@ -18,8 +16,8 @@ license = "MIT"
homepage = "https... | 4 | 11 | 13 |
befc817cf5c9700e16d743872036076fcc368ed4 | Allan | 2024-09-08T20:19:47 | Add `load` tests, use temp-env
Unit tests run in parallel and may clobber each other.
temp-env is now a dev dependency to ensure that unit tests run in
isolated enviornments.
Some tests are added for `load` and `load_and_modify`. | diff --git a/dotenvy/Cargo.toml b/dotenvy/Cargo.toml
index 2b80b69..1b18c49 100644
--- a/dotenvy/Cargo.toml
+++ b/dotenvy/Cargo.toml
@@ -32,7 +32,7 @@ clap = { version = "4.5.16", features = ["derive"], optional = true }
dotenvy-macros = { path = "../dotenvy-macros", optional = true }
[dev-dependencies]
-tempfile =... | 3 | 55 | 18 |
20847a46c4ddb6b5a7b27140564873ae3a42af3b | Allan | 2024-09-08T19:43:06 | Minor signature syntax | diff --git a/examples/find/src/main.rs b/examples/find/src/main.rs
index 003099e..90b0e1e 100644
--- a/examples/find/src/main.rs
+++ b/examples/find/src/main.rs
@@ -20,7 +20,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
}
/// Searches for the filename in the directory and parent directories until the file i... | 2 | 2 | 2 |
aa2a0e1622e766fc041010da8ac7cc53b8889356 | Allan | 2024-09-08T19:42:17 | Remove unmeaningful `dotenvy::Error` tests | diff --git a/dotenvy/src/err.rs b/dotenvy/src/err.rs
index 4612a1f..54a8fd4 100644
--- a/dotenvy/src/err.rs
+++ b/dotenvy/src/err.rs
@@ -82,50 +82,3 @@ impl From<(ParseBufError, Option<PathBuf>)> for Error {
}
}
}
-
-#[cfg(test)]
-mod test {
- use super::Error;
- use std::{error::Error as StdError,... | 1 | 0 | 47 |
f72df37f2c6bb1876d70c4b096ad1df653b25363 | Allan | 2024-09-08T19:37:03 | Load env for substitution test | diff --git a/dotenvy/src/lib.rs b/dotenvy/src/lib.rs
index 2ae10e0..a5bdbcb 100644
--- a/dotenvy/src/lib.rs
+++ b/dotenvy/src/lib.rs
@@ -163,6 +163,7 @@ impl<'a> EnvLoader<'a> {
/// This is useful when constructing with a reader, but still desiring a path to be used in the error message context.
///
/// ... | 1 | 3 | 3 |
d07c421dc8dbbed24aa06ed5ac07d4d691c7b384 | Allan | 2024-09-08T19:35:37 | Remove unused test dir
The integration tests are no longer being used.
Testing is done at lower levels and will be stored as modules. | diff --git a/dotenvy/tests/common.rs b/dotenvy/tests/common.rs
deleted file mode 100644
index 97f4cab..0000000
--- a/dotenvy/tests/common.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-use std::{
- env,
- fs::File,
- io::{self, Write},
-};
-use tempfile::{tempdir, TempDir};
-
-pub unsafe fn tempdir_with_dotenv(text: &str)... | 3 | 0 | 410 |
ec0b6a35ad67ed6a78ba9e1e7b6764547c114e83 | Allan | 2024-09-08T19:30:10 | Use safe API in mutiline tests
Tests are also moved from separate files to the `EnvLoader` module. | diff --git a/dotenvy/src/lib.rs b/dotenvy/src/lib.rs
index 7a9a3b9..2ae10e0 100644
--- a/dotenvy/src/lib.rs
+++ b/dotenvy/src/lib.rs
@@ -265,7 +265,7 @@ impl<'a> EnvLoader<'a> {
mod tests {
use std::{env, io::Cursor};
- use crate::EnvLoader;
+ use crate::{EnvLoader, EnvSequence};
#[test]
fn te... | 3 | 88 | 106 |
3b05ea8b8f603fe470f362a3c515aac24defa789 | Allan | 2024-09-08T19:20:39 | Remove deprecated test | diff --git a/dotenvy/tests/test-vars.rs b/dotenvy/tests/test-vars.rs
deleted file mode 100644
index 684694e..0000000
--- a/dotenvy/tests/test-vars.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-mod common;
-
-use crate::common::make_test_dotenv;
-use std::{collections::HashMap, env, error};
-
-// #[test]
-// fn test_vars() -> Resu... | 1 | 0 | 17 |
b426cbf330f5d0bb748f29e72ef88a82186a9cf3 | Allan | 2024-09-08T19:19:46 | Remove panics from parse unit tests
The tests are also rewritten for clarity. | diff --git a/dotenvy/src/parse.rs b/dotenvy/src/parse.rs
index 043fb1f..15828a3 100644
--- a/dotenvy/src/parse.rs
+++ b/dotenvy/src/parse.rs
@@ -272,7 +272,7 @@ mod test {
use crate::iter::{Iter, ParseBufError};
#[test]
- fn test_parse_line_env() {
+ fn test_parse_line_env() -> Result<(), ParseBufErro... | 1 | 94 | 110 |
fe46d1d0b66209eb69eefc64fd89f9145f0da06a | Allan | 2024-09-08T18:49:32 | Remove default location tests
Now that we only use paths and there is also reader input, we don't need
to test with temp file creating and deleting. | diff --git a/dotenvy/tests/test-child-dir.rs b/dotenvy/tests/test-child-dir.rs
deleted file mode 100644
index 5709f4c..0000000
--- a/dotenvy/tests/test-child-dir.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-mod common;
-
-use dotenvy::EnvLoader;
-
-use crate::common::make_test_dotenv;
-use std::{env, error, fs};
-
-#[test]
-fn t... | 3 | 0 | 60 |
c788494344aa43d000c357b803eeb4a78718d09e | Allan | 2024-09-08T18:48:25 | Remove IO from load substitution test | diff --git a/dotenvy/src/lib.rs b/dotenvy/src/lib.rs
index c251923..7a9a3b9 100644
--- a/dotenvy/src/lib.rs
+++ b/dotenvy/src/lib.rs
@@ -133,7 +133,7 @@ pub struct EnvLoader<'a> {
impl<'a> EnvLoader<'a> {
#[must_use]
- /// Creates a new `EnvLoader` with the path set to `./env`
+ /// Creates a new `EnvLoad... | 2 | 66 | 71 |
d7d0128826bf0e57a6e492963b97dbb55c804341 | Allan | 2024-09-08T18:38:35 | Test BOM removal at lower level | diff --git a/dotenvy/src/iter.rs b/dotenvy/src/iter.rs
index 922ddb8..189a531 100644
--- a/dotenvy/src/iter.rs
+++ b/dotenvy/src/iter.rs
@@ -56,7 +56,7 @@ impl<B: BufRead> Iter<B> {
/// Removes the BOM if it exists.
///
/// For more info, see the [Unicode BOM character](https://www.compart.com/en/unicode... | 2 | 31 | 26 |
9b3e9ad7f7f842bf8694c2a16f95f36cc9853fa5 | Allan | 2024-09-08T17:57:11 | Add `path` setter for reader error context
`EnvLoader::path` is a setter that can be used to specify the path.
If `with_reader` is used, the path can be specified for error context.
If both reader and path are present, load will use the reader as input. | diff --git a/dotenvy/src/bin/dotenvy.rs b/dotenvy/src/bin/dotenvy.rs
index 8c0a68e..a4ba9c3 100644
--- a/dotenvy/src/bin/dotenvy.rs
+++ b/dotenvy/src/bin/dotenvy.rs
@@ -69,7 +69,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
};
// load the file
- let loader = EnvLoader::wit... | 3 | 25 | 12 |
312fac600dc5cd8d298887c5d92654537bda3466 | Allan | 2024-09-08T17:48:36 | Fix lowercase error message test | diff --git a/dotenvy/src/err.rs b/dotenvy/src/err.rs
index cbc6cd6..4612a1f 100644
--- a/dotenvy/src/err.rs
+++ b/dotenvy/src/err.rs
@@ -124,7 +124,7 @@ mod test {
fn test_lineparse_error_display() {
let err = Error::LineParse("test line".to_owned(), 2);
assert_eq!(
- "Error parsing li... | 1 | 1 | 1 |
81dd772bb4ec6ae542c1aaaeac33357c02d68a13 | Allan | 2024-09-06T15:33:20 | cargo fmt | diff --git a/examples/optional/src/main.rs b/examples/optional/src/main.rs
index 3e55cd8..f0f6a8c 100644
--- a/examples/optional/src/main.rs
+++ b/examples/optional/src/main.rs
@@ -1,5 +1,5 @@
//! This example loads an env file only if the file exists.
-//!
+//!
//! `HOST=abc cargo run`
use dotenvy::{EnvLoader, Env... | 1 | 1 | 1 |
c4263c84687f6e7461ddbcce92e6b10f4889af63 | Allan | 2024-09-06T14:59:45 | Fix error usage | diff --git a/dotenvy/src/lib.rs b/dotenvy/src/lib.rs
index 7489a47..6a090db 100644
--- a/dotenvy/src/lib.rs
+++ b/dotenvy/src/lib.rs
@@ -103,7 +103,7 @@ pub use dotenvy_macros::*;
pub fn var(key: &str) -> Result<String> {
env::var(key).map_err(|e| match e {
VarError::NotPresent => Error::NotPresent(key.t... | 1 | 1 | 1 |
9ad10450ffc186a998c8b309b10cfb89336d7619 | Allan | 2024-09-06T14:57:04 | Add variable name to Unicode error
Error messages are also adjusted. | diff --git a/dotenvy/src/err.rs b/dotenvy/src/err.rs
index 822657c..5edded5 100644
--- a/dotenvy/src/err.rs
+++ b/dotenvy/src/err.rs
@@ -7,8 +7,10 @@ pub enum Error {
LineParse(String, usize),
/// An IO error may be encountered when reading from a file or reader.
Io(io::Error),
+ /// The variable was ... | 1 | 10 | 8 |
6334ceb5ae9b861ac2f72a8863ef9ce5bf09e962 | Allan | 2024-09-06T14:50:56 | Add required and override to CLI
This makes the CLI feature aligned with the attribute macro.
The optional example is also updated to be similar to the CLI.
`Path::exists` is no longer used because of a potential race condition. | diff --git a/dotenvy/Cargo.toml b/dotenvy/Cargo.toml
index bd141b2..2b80b69 100644
--- a/dotenvy/Cargo.toml
+++ b/dotenvy/Cargo.toml
@@ -37,4 +37,4 @@ tempfile = "3.12.0"
[features]
default = ["cli", "macros"]
cli = ["dep:clap"]
-macros = ["dep:dotenvy-macros"]
\ No newline at end of file
+macros = ["dep:dotenvy-mac... | 3 | 44 | 17 |
2fac95568abacbd5d1ef6e9b8385b2d189b3c9e0 | Allan | 2024-09-06T14:21:50 | Add version display for CLI | diff --git a/dotenvy/src/bin/dotenvy.rs b/dotenvy/src/bin/dotenvy.rs
index f92ea9f..e3dfa5c 100644
--- a/dotenvy/src/bin/dotenvy.rs
+++ b/dotenvy/src/bin/dotenvy.rs
@@ -35,6 +35,7 @@ fn mk_cmd(program: &str, args: &[String]) -> process::Command {
#[derive(Parser)]
#[command(
name = "dotenvy",
+ version,
... | 1 | 1 | 0 |
13231f6e9ddb2528b8f28bc218bf700fa0ab7134 | Allan | 2024-09-05T22:18:23 | Make a `EnvMap` a newtype with `EnvMap::var`
This change `EnvMap` to a newtype with a `var` function that returns
`Result`.
This mirrors the behaviour of `dotenvy::var`. | diff --git a/dotenvy/src/iter.rs b/dotenvy/src/iter.rs
index 8e2cad3..051e856 100644
--- a/dotenvy/src/iter.rs
+++ b/dotenvy/src/iter.rs
@@ -27,7 +27,7 @@ impl<B: BufRead> Iter<B> {
F: FnMut(String, String, &mut EnvMap),
{
self.remove_bom()?;
- let mut map = HashMap::new();
+ let mu... | 2 | 47 | 4 |
0f9ad5fec5e5c7070faf743cf45094552461cba4 | Allan | 2024-09-05T21:50:47 | New `Error` type with `NotPresent(String)`
This removes the `EnvVar` variant which wraps `VarError`.
The internals of `VarError` are now variants in `Error`.
This makes it more ergonomic for users who are propogating errors to
know which varaible is truly missing. | diff --git a/dotenvy/src/err.rs b/dotenvy/src/err.rs
index ea99590..822657c 100644
--- a/dotenvy/src/err.rs
+++ b/dotenvy/src/err.rs
@@ -1,17 +1,14 @@
-use std::{
- env::{self},
- error, fmt, io, result,
-};
+use std::{error, ffi::OsString, fmt, io, result};
pub type Result<T> = result::Result<T, Error>;
#[... | 1 | 13 | 29 |
a45eedae6b90edaad8ccf10b29412b2f72f35919 | Allan | 2024-08-29T16:54:07 | Use 2024 edition, mark unsafe
`set::env_set_var` is unsafe in the 2024 edition.
All functions calling it are marked as unsafe. | diff --git a/dotenv/Cargo.toml b/dotenv/Cargo.toml
index f6dc182..8e52f81 100644
--- a/dotenv/Cargo.toml
+++ b/dotenv/Cargo.toml
@@ -1,3 +1,5 @@
+cargo-features = ["edition2024"]
+
[package]
name = "dotenvy"
version = "0.15.7"
@@ -18,8 +20,8 @@ keywords = ["dotenv", "env", "environment", "settings", "config"]
categ... | 26 | 131 | 113 |
68dabb9a2cbcc8055d3057074d576ee95d425208 | Allan | 2024-08-28T16:14:52 | Remove redundant example | diff --git a/dotenv/examples/list_variables.rs b/dotenv/examples/list_variables.rs
deleted file mode 100644
index c78f352..0000000
--- a/dotenv/examples/list_variables.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-use dotenvy::{dotenv_iter, Error};
-
-fn main() -> Result<(), Error> {
- dotenvy::dotenv()?;
- for item in dote... | 1 | 0 | 10 |
a7449c82330c2490c8f7a1848652acb68b1f034d | Allan | 2024-08-28T16:14:10 | Update deps, remove once_cell | diff --git a/dotenv/Cargo.toml b/dotenv/Cargo.toml
index 5fcd5be..f6dc182 100644
--- a/dotenv/Cargo.toml
+++ b/dotenv/Cargo.toml
@@ -29,8 +29,7 @@ required-features = ["cli"]
clap = { version = "4.5.16", features = ["derive"], optional = true }
[dev-dependencies]
-tempfile = "3.3.0"
-once_cell = "1.16.0"
+tempfile ... | 2 | 3 | 5 |
e7f398b4d5d9be43b90e231d4b90478cf6ca48d4 | Christian Vallentin | 2024-07-16T17:50:44 | Removed recursion in find method (#80) | diff --git a/dotenv/src/find.rs b/dotenv/src/find.rs
index d6a60aa..8db3f6e 100644
--- a/dotenv/src/find.rs
+++ b/dotenv/src/find.rs
@@ -34,29 +34,24 @@ impl<'a> Finder<'a> {
}
/// Searches for `filename` in `directory` and parent directories until found or root is reached.
-#[allow(clippy::option_if_let_else)]
-pu... | 1 | 16 | 21 |
206d25377d450a251a0d2154c13917e69f8a9672 | Christian Vallentin | 2024-07-16T16:36:53 | Fix doctests compiling on Windows (#79) | diff --git a/dotenv/src/lib.rs b/dotenv/src/lib.rs
index f12629f..c9425ba 100644
--- a/dotenv/src/lib.rs
+++ b/dotenv/src/lib.rs
@@ -235,12 +235,14 @@ pub fn from_filename_iter<P: AsRef<Path>>(filename: P) -> Result<Iter<File>> {
/// # Examples
///
/// ```no_run
-/// # #![cfg(unix)]
/// use std::io::Read;
+/// # #[... | 1 | 9 | 3 |
5895d68414d4b7b0b5ae7d0b30d138d7a62ca96e | Christopher Morton | 2024-07-16T09:14:46 | Fix clippy lints (#108) | diff --git a/dotenv/src/errors.rs b/dotenv/src/errors.rs
index 28f5680..cb7a28a 100644
--- a/dotenv/src/errors.rs
+++ b/dotenv/src/errors.rs
@@ -90,8 +90,8 @@ mod test {
let err = Error::Io(io::ErrorKind::PermissionDenied.into());
let io_err: io::Error = io::ErrorKind::PermissionDenied.into();
- ... | 2 | 38 | 45 |
ed0bda8b9409e2680108cd16766d3f46757186a7 | Allan Zhang | 2024-03-15T07:03:29 | Fix all _var tests | diff --git a/dotenv/tests/test-variable-substitution.rs b/dotenv/tests/test-variable-substitution.rs
index 87a37ed..6bde0f5 100644
--- a/dotenv/tests/test-variable-substitution.rs
+++ b/dotenv/tests/test-variable-substitution.rs
@@ -25,6 +25,8 @@ SUBSTITUTION_WITHOUT_QUOTES={}
common_string, common_string, com... | 2 | 3 | 1 |
174f6829cc48b8f377b36b5d66f7dc87d7b3eb72 | Allan Zhang | 2024-03-15T06:50:26 | Fix test_var
This test was failing due to the recent change in imports.
The test intends to call `dotenvy::var` rather than `std::env::var`. | diff --git a/dotenv/tests/test-var.rs b/dotenv/tests/test-var.rs
index e194260..43b68dd 100644
--- a/dotenv/tests/test-var.rs
+++ b/dotenv/tests/test-var.rs
@@ -7,7 +7,7 @@ use std::{env, error};
fn test_var() -> Result<(), Box<dyn error::Error>> {
let dir = make_test_dotenv()?;
- assert_eq!(env::var("TESTKE... | 1 | 1 | 1 |
76548c84ab459691ac37e77998ec3e1da9ab17b7 | Allan Zhang | 2024-03-15T06:39:20 | Add Clippy exceptions
This is primarily to pass CI.
The exception added on `find` is because it is a candidate for
replacement with a non-recursive version. | diff --git a/dotenv/src/find.rs b/dotenv/src/find.rs
index 6cf0374..d6a60aa 100644
--- a/dotenv/src/find.rs
+++ b/dotenv/src/find.rs
@@ -34,6 +34,7 @@ impl<'a> Finder<'a> {
}
/// Searches for `filename` in `directory` and parent directories until found or root is reached.
+#[allow(clippy::option_if_let_else)]
pub ... | 2 | 2 | 1 |
405689a1b687438275c5fc61fa81a0b9d3fb1176 | Allan Zhang | 2024-03-15T06:37:13 | Consistent imports | diff --git a/dotenv/examples/list_variables.rs b/dotenv/examples/list_variables.rs
index d6759b7..c78f352 100644
--- a/dotenv/examples/list_variables.rs
+++ b/dotenv/examples/list_variables.rs
@@ -4,7 +4,7 @@ fn main() -> Result<(), Error> {
dotenvy::dotenv()?;
for item in dotenv_iter()? {
let (key, ... | 26 | 103 | 138 |
bbb06cde8ee6c503887d3b5f80cb41c94026a228 | Allan Zhang | 2024-03-15T06:15:07 | Introduce Clippy pedantic and nursery
This commit adds new Clippy directives.
Most lints have been applied, mostly affecting formatting or control
flow.
`find` function was skipped because it may be replaced with a
non-recursive version (#80). | diff --git a/dotenv/Cargo.toml b/dotenv/Cargo.toml
index 8d15022..729eb58 100644
--- a/dotenv/Cargo.toml
+++ b/dotenv/Cargo.toml
@@ -9,12 +9,13 @@ authors = [
"Sean Griffin <sean@seantheprogrammer.com>",
"Adam Sharp <adam@sharplet.me>",
"Arpad Borsos <arpad.borsos@googlemail.com>",
- "Allan Zhang <al@ayz.ai>"... | 7 | 48 | 48 |
323b351c3264b06e608e3dc5b40fb7d321fe143b | Jacob Stephenson | 2024-01-23T06:02:28 | Updated path not found error to be a bit more descriptive. (#89)
* Updated path not found error
* Even clearer error message | diff --git a/dotenv/src/find.rs b/dotenv/src/find.rs
index dd60728..70c45bf 100644
--- a/dotenv/src/find.rs
+++ b/dotenv/src/find.rs
@@ -51,7 +51,7 @@ pub fn find(directory: &Path, filename: &Path) -> Result<PathBuf> {
} else {
Err(Error::Io(io::Error::new(
io::ErrorKind::NotFound,
- ... | 1 | 1 | 1 |
34b6955e842c7fbd9cdf7843a416704585c6b561 | Dirk Stolle | 2024-01-22T21:54:44 | Remove redundant explicit link target in documentation (#88)
When the CI tries to generate the documentation, it fails with
error: redundant explicit link target
Error: --> dotenv/src/lib.rs:218:51
|
218 | /// Loads environment variables from [`io::Read`](std::io::Read).
| ... | diff --git a/dotenv/src/lib.rs b/dotenv/src/lib.rs
index 4c8af98..831abc0 100644
--- a/dotenv/src/lib.rs
+++ b/dotenv/src/lib.rs
@@ -215,7 +215,7 @@ pub fn from_filename_iter<P: AsRef<Path>>(filename: P) -> Result<Iter<File>> {
Ok(iter)
}
-/// Loads environment variables from [`io::Read`](std::io::Read).
+/// L... | 1 | 3 | 3 |
e38b6c4e5e5f1e4da2fe76b54ab8666271a31bc8 | Dirk Stolle | 2024-01-22T21:54:31 | Fix clippy lints (#87)
Clippy linting had some complaints:
warning: you seem to be trying to move all elements into a new `String`
--> dotenv/src/parse.rs:183:34
|
183 | ... &substitution_name.drain(..).collect::<String>(),
| ^^^^^^^^^^^^^^... | diff --git a/dotenv/src/parse.rs b/dotenv/src/parse.rs
index 8e7842e..642174e 100644
--- a/dotenv/src/parse.rs
+++ b/dotenv/src/parse.rs
@@ -180,7 +180,7 @@ fn parse_value(
} else {
apply_substitution(
substitution_data,
- ... | 1 | 3 | 3 |
207afca22930a4102b917f38febe587374a1e681 | Dirk Stolle | 2024-01-12T22:25:11 | Fix some typos (#86) | diff --git a/dotenv/tests/integration/util/testenv.rs b/dotenv/tests/integration/util/testenv.rs
index c4f3e88..a6dde28 100644
--- a/dotenv/tests/integration/util/testenv.rs
+++ b/dotenv/tests/integration/util/testenv.rs
@@ -89,7 +89,7 @@ impl TestEnv {
/// Blank testing environment in a new temporary directory.
... | 2 | 3 | 3 |
08e35eea693ca12c4038a226bae2e3144445ba69 | unknowntrojan | 2023-10-27T17:36:14 | Update clap to newest version (#77)
* update clap to newest version
* fix bin target | diff --git a/dotenv/Cargo.toml b/dotenv/Cargo.toml
index 740b2c3..8d15022 100644
--- a/dotenv/Cargo.toml
+++ b/dotenv/Cargo.toml
@@ -25,7 +25,7 @@ name = "dotenvy"
required-features = ["cli"]
[dependencies]
-clap = { version = "3.2", optional = true }
+clap = { version = "4.3.11", optional = true }
[dev-dependen... | 2 | 4 | 5 |
e330110a7cd9064ec913e554c9fc325c9d7cdb88 | Allan | 2023-03-22T16:02:46 | Update version numbers | diff --git a/dotenv/Cargo.toml b/dotenv/Cargo.toml
index a716b6a..9a705a9 100644
--- a/dotenv/Cargo.toml
+++ b/dotenv/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "dotenvy"
-version = "0.15.6"
+version = "0.15.7"
authors = [
"Noemi Lapresta <noemi.lapresta@gmail.com>",
"Craig Hills <chills@gmail.com>",
diff --g... | 2 | 2 | 2 |
127c0a41d826cfc6ec681d298ff559324c11dc8c | Christopher Morton | 2022-12-21T14:01:54 | test: fix typo in envfile contents | diff --git a/dotenv/tests/integration/util/mod.rs b/dotenv/tests/integration/util/mod.rs
index 9c7c557..307e460 100644
--- a/dotenv/tests/integration/util/mod.rs
+++ b/dotenv/tests/integration/util/mod.rs
@@ -21,7 +21,7 @@ pub const TEST_OVERRIDING_VALUE: &str = "from_file";
#[inline(always)]
pub fn create_default_en... | 1 | 2 | 2 |
423a7b0eab03c1f52c0a1e7ea466e98dbd432256 | Christopher Morton | 2022-12-20T23:06:48 | test: create test harness with locked environment (#59)
* test: create test harness with locked environment
Setup single-process integration testing with a utility module. Designed
so multiple tests can be run without the need for separate processes.
In practice, this means new tests will not need a new file. It ... | diff --git a/dotenv/Cargo.toml b/dotenv/Cargo.toml
index c03e573..a716b6a 100644
--- a/dotenv/Cargo.toml
+++ b/dotenv/Cargo.toml
@@ -29,6 +29,7 @@ clap = { version = "3.2", optional = true }
[dev-dependencies]
tempfile = "3.3.0"
+once_cell = "1.16.0"
[features]
cli = ["clap"]
diff --git a/dotenv/tests/integrati... | 4 | 407 | 0 |
3a085913ad5359332fe582276814b75275c936b1 | Allan | 2022-12-13T04:44:51 | Fix typo | diff --git a/dotenv/src/lib.rs b/dotenv/src/lib.rs
index 89156f1..0593950 100644
--- a/dotenv/src/lib.rs
+++ b/dotenv/src/lib.rs
@@ -194,7 +194,7 @@ pub fn from_filename_iter<P: AsRef<Path>>(filename: P) -> Result<Iter<File>> {
/// Loads environment variables from [`io::Read`](std::io::Read).
///
-/// This is usefu... | 1 | 2 | 2 |
69a0623e8dfbb3739b0ed1e1abb4fc9787b3cb7b | LeoniePhiline | 2022-12-10T17:55:30 | feat: Implement overriding API methods and correct inconsistent naming (#47)
* feat: Implement overriding api methods
* fix: Use consistent naming | diff --git a/dotenv/src/iter.rs b/dotenv/src/iter.rs
index ed1c20a..7ff9e48 100644
--- a/dotenv/src/iter.rs
+++ b/dotenv/src/iter.rs
@@ -21,7 +21,11 @@ impl<R: Read> Iter<R> {
}
}
- /// Loads all variables found in the `reader` into the environment.
+ /// Loads all variables found in the `reader` ... | 12 | 253 | 37 |
d1f8a1508bd61c8f9a3c847fe32fd4d47bf18146 | Tshepang Mbambo | 2022-11-22T13:40:53 | allow to override existing env vars (#41) | diff --git a/dotenv/src/iter.rs b/dotenv/src/iter.rs
index 2d4a830..ed1c20a 100644
--- a/dotenv/src/iter.rs
+++ b/dotenv/src/iter.rs
@@ -35,6 +35,18 @@ impl<R: Read> Iter<R> {
Ok(())
}
+ /// A version of [load] that overrides older variables in case of duplicates.
+ pub fn overload(mut self) -> Re... | 3 | 48 | 0 |
42fa001801dbe42307b3d0142e61b6b0380555c4 | Tshepang Mbambo | 2022-11-18T11:41:51 | whitespace fixes (#42) | diff --git a/dotenv/src/lib.rs b/dotenv/src/lib.rs
index df2a97e..72092a4 100644
--- a/dotenv/src/lib.rs
+++ b/dotenv/src/lib.rs
@@ -112,11 +112,12 @@ pub fn from_filename<P: AsRef<Path>>(filename: P) -> Result<PathBuf> {
/// Returns an iterator over environment variables from the specified file.
///
/// # Examples... | 1 | 10 | 5 |
7e2e83b867331a142b5b9d6824b1baf9f79aa92b | Denis Policastro | 2022-10-28T03:44:43 | Fix doc for `vars` function (#34)
Correctly enclose the example on a code block.
Ref: https://docs.rs/dotenvy/0.15.6/dotenvy/fn.vars.html | diff --git a/dotenv/src/lib.rs b/dotenv/src/lib.rs
index 8933490..0d5558a 100644
--- a/dotenv/src/lib.rs
+++ b/dotenv/src/lib.rs
@@ -44,9 +44,9 @@ pub fn var<K: AsRef<OsStr>>(key: K) -> Result<String> {
/// Returns an iterator of `(key, value)` pairs for all environment variables of the current process.
/// The retur... | 1 | 1 | 1 |
fa4c4e614f03381b2b306e923a88e9941206d1a4 | Christopher Morton | 2022-10-24T01:20:51 | Fix warnings (#29)
* Fix clippy lints
- Single-character string constant used as pattern
- Use of `.unwrap_or_else(..)` to construct default value
* Fix Cargo manifest warnings
"Previously Unused manifest key: package.rust" warning fixed. The
manifest key according to Cargo documentation should be `rust-ver... | diff --git a/dotenv/Cargo.toml b/dotenv/Cargo.toml
index ccc071f..e6d16b8 100644
--- a/dotenv/Cargo.toml
+++ b/dotenv/Cargo.toml
@@ -18,7 +18,7 @@ keywords = ["dotenv", "env", "environment", "settings", "config"]
license = "MIT"
repository = "https://github.com/allan2/dotenvy"
edition = "2018"
-rust = "1.58.1"
+rust... | 4 | 5 | 5 |
a6b08ba869255be4d357393b4e403436161d8f51 | Christopher Morton | 2022-10-17T16:45:21 | Add support for UTF-8 BOM encoding (#28)
The UTF-8 Byte Order Mark `\ufeff` will be ignored when parsing.
See #27 | diff --git a/dotenv/src/iter.rs b/dotenv/src/iter.rs
index 6b9f2bc..2d4a830 100644
--- a/dotenv/src/iter.rs
+++ b/dotenv/src/iter.rs
@@ -22,7 +22,9 @@ impl<R: Read> Iter<R> {
}
/// Loads all variables found in the `reader` into the environment.
- pub fn load(self) -> Result<()> {
+ pub fn load(mut sel... | 2 | 35 | 1 |
59976fde9714d72086e408c6f64f09b443db7fb1 | Renée Kooi | 2022-10-16T02:06:08 | deps: move `dirs` to dev-dependencies (#24)
`dirs` is only used in doctests, not in the library itself. So there is
no need to install it for end users. | diff --git a/dotenv/Cargo.toml b/dotenv/Cargo.toml
index 8972d8e..8f77248 100644
--- a/dotenv/Cargo.toml
+++ b/dotenv/Cargo.toml
@@ -26,10 +26,10 @@ required-features = ["cli"]
[dependencies]
clap = { version = "3.2", optional = true }
-dirs = "4.0"
[dev-dependencies]
tempfile = "3.3.0"
+dirs = "4.0"
[featur... | 1 | 1 | 1 |
9d0f3de9a3a6b47983e9caca50fb9a008586ecfb | Ralph Giles | 2022-10-16T02:05:58 | Fix clippy lints (#23)
* Remove unnecessary reference
LineParser::substitution_data is already `&mut` so there's no
need to create a reference before passing.
Addresses a clippy issue.
* Use the non_exhaustive annotation on dotenv::Error
The #[non_exhaustive] attribute achieves the same compatibility
res... | diff --git a/dotenv/src/errors.rs b/dotenv/src/errors.rs
index 2561649..c363137 100644
--- a/dotenv/src/errors.rs
+++ b/dotenv/src/errors.rs
@@ -6,12 +6,11 @@ use std::io;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug)]
+#[non_exhaustive]
pub enum Error {
LineParse(String, usize),
Io... | 2 | 2 | 4 |
778654c11eca2384d6a54fd507eb26704566902f | Ralph Giles | 2022-09-20T14:03:25 | cargo fmt (#22)
Run `cargo fmt` to address nits. Should fix a falling ci check. | diff --git a/dotenv/tests/test-multiline-comment.rs b/dotenv/tests/test-multiline-comment.rs
index dbb8bee..878916b 100644
--- a/dotenv/tests/test-multiline-comment.rs
+++ b/dotenv/tests/test-multiline-comment.rs
@@ -53,5 +53,4 @@ Line 3"#
Line 6
"#
);
-
} | 1 | 0 | 1 |
16b0bad9509b9ff009cfa6759cfd39b2034a2bc5 | Allan Zhang | 2022-09-19T15:56:24 | Version bump to 0.15.4 | diff --git a/dotenv/Cargo.toml b/dotenv/Cargo.toml
index 38a6fb4..439f3c1 100644
--- a/dotenv/Cargo.toml
+++ b/dotenv/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "dotenvy"
-version = "0.15.3"
+version = "0.15.4"
authors = [
"Noemi Lapresta <noemi.lapresta@gmail.com>",
"Craig Hills <chills@gmail.com>", | 1 | 1 | 1 |
f9c1921bdd351b948704dc0ac7bacb571fb811d2 | Dom | 2022-08-30T02:15:53 | Fix: support comments in multiline input (#16)
Fixes a regression caused by multiline support (#12)
Comments are now respected when evaluating quote state | diff --git a/dotenv/src/iter.rs b/dotenv/src/iter.rs
index bf68cf9..6fc6024 100644
--- a/dotenv/src/iter.rs
+++ b/dotenv/src/iter.rs
@@ -38,39 +38,45 @@ struct QuotedLines<B> {
buf: B,
}
-enum QuoteState {
+enum ParseState {
Complete,
Escape,
StrongOpen,
StrongOpenEscape,
WeakOpen,
... | 2 | 72 | 25 |
269a343af4f0d04fea1ec9ce7ab5155a7b4f6f79 | Allan Zhang | 2022-08-23T05:10:04 | Use Result in tests | diff --git a/dotenv/tests/test-child-dir.rs b/dotenv/tests/test-child-dir.rs
index 1db61e8..1deddb8 100644
--- a/dotenv/tests/test-child-dir.rs
+++ b/dotenv/tests/test-child-dir.rs
@@ -1,21 +1,22 @@
mod common;
use dotenvy::*;
-use std::{env, fs};
+use std::{env, error::Error, fs, result::Result};
use crate::com... | 11 | 101 | 99 |
ccb2c536e364c751c3dfda806b4278a142cf22f7 | Allan Zhang | 2022-08-22T16:48:34 | Multiline support | diff --git a/dotenv/tests/test-multiline.rs b/dotenv/tests/test-multiline.rs
index 262285d..35020c2 100644
--- a/dotenv/tests/test-multiline.rs
+++ b/dotenv/tests/test-multiline.rs
@@ -1,9 +1,8 @@
mod common;
-use dotenv::*;
-use std::env;
-
use crate::common::*;
+use dotenvy::*;
+use std::env;
#[test]
fn test_... | 1 | 6 | 7 |
1a455554f5e4b4211be5490309d580d18a4cdf56 | Allan Zhang | 2022-08-22T16:26:37 | Rewrite docs | diff --git a/dotenv/Cargo.toml b/dotenv/Cargo.toml
index 16b0188..979828f 100644
--- a/dotenv/Cargo.toml
+++ b/dotenv/Cargo.toml
@@ -11,7 +11,7 @@ authors = [
"Arpad Borsos <arpad.borsos@googlemail.com>",
"Allan Zhang <al@ayz.ai>",
]
-description = "A well-maintained fork of the `dotenv` crate"
+description = "A... | 2 | 50 | 69 |
c408900694e8f6b2cc4a4f1b56c788ba66284db5 | Kevin M Granger | 2022-07-12T19:46:34 | Use doc links for docs that reference other items.
Also simplify fully-qualified references in the docs. | diff --git a/dotenv/src/lib.rs b/dotenv/src/lib.rs
index 6164488..6821cc1 100644
--- a/dotenv/src/lib.rs
+++ b/dotenv/src/lib.rs
@@ -78,7 +78,7 @@ pub fn from_path<P: AsRef<Path>>(path: P) -> Result<()> {
iter.load()
}
-/// Like `from_path`, but returns an iterator over variables instead of loading into environ... | 1 | 5 | 5 |
e7be06b080df4eb08a0ccb382cb67f56caaeb25b | Kevin M Granger | 2022-07-12T19:36:49 | Add `from_read` and `from_read_iter`.
This will allow reading env vars from any arbitrary `io::Read`. | diff --git a/dotenv/src/lib.rs b/dotenv/src/lib.rs
index 6164488..030276f 100644
--- a/dotenv/src/lib.rs
+++ b/dotenv/src/lib.rs
@@ -14,6 +14,7 @@ mod parse;
use std::env::{self, Vars};
use std::ffi::OsStr;
use std::fs::File;
+use std::io;
use std::path::{Path, PathBuf};
use std::sync::Once;
@@ -140,6 +141,48 @@... | 1 | 43 | 0 |
24890e824abb377c7488b2974ed4072f54aa3f72 | Allan Zhang | 2022-03-08T16:12:18 | Update crate name in macro tests | diff --git a/dotenv_codegen/tests/basic_dotenv_macro.rs b/dotenv_codegen/tests/basic_dotenv_macro.rs
index d86b2bd..f48c4a7 100644
--- a/dotenv_codegen/tests/basic_dotenv_macro.rs
+++ b/dotenv_codegen/tests/basic_dotenv_macro.rs
@@ -1,12 +1,12 @@
#[test]
fn dotenv_works() {
- assert_eq!(dotenvy_codegen::dotenv!("C... | 1 | 2 | 2 |
6063514f55d91e5fb1c18087da843fa070950c3c | Robin Vobruba | 2022-02-28T18:01:16 | Documents iter::Iter::load [minor] | diff --git a/dotenv/src/iter.rs b/dotenv/src/iter.rs
index fc71fe8..bf68cf9 100644
--- a/dotenv/src/iter.rs
+++ b/dotenv/src/iter.rs
@@ -21,6 +21,7 @@ impl<R: Read> Iter<R> {
}
}
+ /// Loads all variables found in the `reader` into the environment.
pub fn load(self) -> Result<()> {
for ... | 1 | 1 | 0 |
84f661b8a0aec2813b20f71fc89593ce1473e90e | Robin Vobruba | 2022-02-27T17:27:28 | Extends multi-line integration-test | diff --git a/dotenv/tests/test-multiline.rs b/dotenv/tests/test-multiline.rs
index 2a6eec8..262285d 100644
--- a/dotenv/tests/test-multiline.rs
+++ b/dotenv/tests/test-multiline.rs
@@ -9,9 +9,36 @@ use crate::common::*;
fn test_multiline() {
let value = "-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----\\n\\... | 1 | 28 | 1 |
8cec2e9ad88badc3dba9211ffd7b607b6bb0e54a | Robin Vobruba | 2022-02-27T17:36:32 | Uses a state-machine for multi-line values | diff --git a/dotenv/src/iter.rs b/dotenv/src/iter.rs
index 8cfd573..fc71fe8 100644
--- a/dotenv/src/iter.rs
+++ b/dotenv/src/iter.rs
@@ -37,31 +37,42 @@ struct QuotedLines<B> {
buf: B,
}
-fn is_complete(buf: &String) -> bool {
- let mut escape = false;
- let mut strong_quote = false;
- let mut weak_quo... | 1 | 45 | 24 |
10a991004e2aa2cda919c160a71985ead05a8782 | Raphael Taylor-Davies | 2020-09-05T16:58:30 | Add multi-line support | diff --git a/dotenv/src/iter.rs b/dotenv/src/iter.rs
index 40506e2..8cfd573 100644
--- a/dotenv/src/iter.rs
+++ b/dotenv/src/iter.rs
@@ -1,20 +1,22 @@
use std::collections::HashMap;
use std::env;
use std::io::prelude::*;
-use std::io::{BufReader, Lines};
+use std::io::BufReader;
use crate::errors::*;
use crate::... | 2 | 82 | 4 |
8c2ba38270e6862be47301e02bb09517604f4af9 | Zoey Riordan | 2020-06-26T16:53:21 | fix linting errors | diff --git a/dotenv/src/bin/dotenv.rs b/dotenv/src/bin/dotenv.rs
index 5af9a6b..dce09c6 100644
--- a/dotenv/src/bin/dotenv.rs
+++ b/dotenv/src/bin/dotenv.rs
@@ -3,7 +3,7 @@ extern crate dotenv;
use clap::{App, AppSettings, Arg};
use std::os::unix::process::CommandExt;
-use std::process::{Command, exit};
+use std::p... | 18 | 207 | 153 |
c89ed777242328a30895ff233de402e44cb4c54d | Marli Frost | 2020-06-25T19:08:44 | Undeprecate variable iterating functions | diff --git a/dotenv/src/lib.rs b/dotenv/src/lib.rs
index 1368a48..e39e2de 100644
--- a/dotenv/src/lib.rs
+++ b/dotenv/src/lib.rs
@@ -100,7 +100,6 @@ pub fn from_path<P: AsRef<Path>>(path: P) -> Result<()> {
/// println!("{}={}", key, val);
/// }
/// ```
-#[deprecated(since = "0.14.1", note = "please use `from_path... | 4 | 0 | 6 |
04f49dd8946de6a46afb736179b4f6fc73ce4eac | wsc | 2019-11-19T03:08:01 | fix deprecated std::sync::ONCE_INIT with Once::new() | diff --git a/dotenv/src/lib.rs b/dotenv/src/lib.rs
index 16837ad..1368a48 100644
--- a/dotenv/src/lib.rs
+++ b/dotenv/src/lib.rs
@@ -14,13 +14,13 @@ use std::env::{self, Vars};
use std::ffi::OsStr;
use std::fs::File;
use std::path::{Path, PathBuf};
-use std::sync::{Once, ONCE_INIT};
+use std::sync::{Once};
pub us... | 1 | 2 | 2 |
ab74c3b464306c7b39cbd30c3b462be22abb2c21 | Bastien Orivel | 2019-10-01T22:42:22 | Update syn related dependencies to 1.0 | diff --git a/dotenv_codegen_implementation/Cargo.toml b/dotenv_codegen_implementation/Cargo.toml
index 08f3c96..23b719b 100644
--- a/dotenv_codegen_implementation/Cargo.toml
+++ b/dotenv_codegen_implementation/Cargo.toml
@@ -21,8 +21,8 @@ description = "A `dotenv` implementation for Rust"
edition = "2018"
[dependen... | 1 | 4 | 4 |
2c259918bc7546b939b24865fc6f2ff99cd1d824 | Arpad Borsos | 2019-08-27T14:55:17 | Replace line-parsing RegEx by hand written parser
This avoids pulling in `regex` and `lazy_static` and makes this a true
zero-dependency crate. | diff --git a/dotenv/Cargo.toml b/dotenv/Cargo.toml
index 57a31c1..4c2fb5a 100644
--- a/dotenv/Cargo.toml
+++ b/dotenv/Cargo.toml
@@ -1,7 +1,15 @@
[package]
name = "dotenv"
version = "0.15.0"
-authors = ["Noemi Lapresta <noemi.lapresta@gmail.com>", "Craig Hills <chills@gmail.com>", "Mike Piccolo <mfpiccolo@gmail.com>... | 2 | 113 | 54 |
c41d4c91886ffeb0a5153d170c4344a18128ce54 | Omer BenAmram | 2019-07-31T16:59:36 | Support for variables with a literal dot in their name. (#25)
* allow dot
* actually support dots
* added a test to check that an error is raised when using a dot as a first character of a key. | diff --git a/dotenv/src/parse.rs b/dotenv/src/parse.rs
index fd80214..15e12f1 100644
--- a/dotenv/src/parse.rs
+++ b/dotenv/src/parse.rs
@@ -14,12 +14,12 @@ pub fn parse_line(line: &str, mut substitution_data: &mut HashMap<String, Option
^(
\s*
(
- \#.*| ... | 1 | 35 | 6 |
e6ff6590ae68a95b8183360a7d522b057f4f0248 | Henrik Tougaard | 2019-07-29T07:19:03 | Added test for \n. Added comments to warn of trailing blanks in tests | diff --git a/dotenv/src/parse.rs b/dotenv/src/parse.rs
index b4ce774..fd80214 100644
--- a/dotenv/src/parse.rs
+++ b/dotenv/src/parse.rs
@@ -93,7 +93,7 @@ fn parse_value(input: &str, substitution_data: &mut HashMap<String, Option<Strin
return Err(Error::LineParse(input.to_owned(), index));
... | 1 | 5 | 1 |
6f3e807049cb771b3d3da6c28af121d587c83704 | Henrik Tougaard | 2019-07-25T11:00:01 | Add support for \n in doublequoted lines - needed by eg 'heroku config -s' | diff --git a/dotenv/src/parse.rs b/dotenv/src/parse.rs
index bcf6d7a..b4ce774 100644
--- a/dotenv/src/parse.rs
+++ b/dotenv/src/parse.rs
@@ -99,6 +99,7 @@ fn parse_value(input: &str, substitution_data: &mut HashMap<String, Option<Strin
//then there's \v \f bell hex... etc
match c {
... | 1 | 1 | 0 |
3c0ef0a305d29731e058a87da4fcce0eb801dd8f | Kirill Bulatov | 2019-05-15T21:07:49 | Show symbol index that caused an error (#7)
* Show symbol index that caused an error
* Reorder imports
* Prevent negative index case
* Fix incorrect index calculation | diff --git a/dotenv/src/errors.rs b/dotenv/src/errors.rs
index 60c6c11..bcce24b 100644
--- a/dotenv/src/errors.rs
+++ b/dotenv/src/errors.rs
@@ -6,7 +6,7 @@ pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug)]
pub enum Error {
- LineParse(String),
+ LineParse(String, usize),
Io(io::Error)... | 3 | 60 | 25 |
fe38ac72d2f5aa910e2a12415c60317ee2f0dc69 | Daniel Griffen | 2019-05-14T20:41:30 | deprecate `iter` methods | diff --git a/dotenv/src/lib.rs b/dotenv/src/lib.rs
index 1707277..16837ad 100644
--- a/dotenv/src/lib.rs
+++ b/dotenv/src/lib.rs
@@ -79,7 +79,8 @@ pub fn vars() -> Vars {
/// dotenv::from_path(my_path.as_path());
/// ```
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<()> {
- from_path_iter(path)?.load()
+ ... | 4 | 8 | 1 |
93cc5d6aed4b6c4059159eec6b85f8a613704ead | Daniel Griffen | 2019-05-14T20:57:39 | bump version to 0.14.1 | diff --git a/dotenv/Cargo.toml b/dotenv/Cargo.toml
index 597f8ff..b116eaa 100644
--- a/dotenv/Cargo.toml
+++ b/dotenv/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "dotenv"
-version = "0.14.0"
+version = "0.14.1"
authors = ["Noemi Lapresta <noemi.lapresta@gmail.com>", "Craig Hills <chills@gmail.com>", "Mike Piccolo <m... | 3 | 3 | 3 |
cfed2b85f4c8ed2816973200e8a228abfd45fdab | Daniel Griffen | 2019-05-14T03:24:15 | remove failure dependency | diff --git a/dotenv/Cargo.toml b/dotenv/Cargo.toml
index ce56284..57a31c1 100644
--- a/dotenv/Cargo.toml
+++ b/dotenv/Cargo.toml
@@ -19,15 +19,8 @@ lazy_static = "1.0.0"
regex = "1.0"
clap = { version = "2", optional = true }
-[dependencies.failure]
-version = "0.1.1"
-features = ["derive"]
-default-features = fals... | 2 | 95 | 15 |
b8d1ca7b249f5c53842fdab4837ac7ccecb22be2 | Daniel Griffen | 2019-05-14T02:25:10 | bump version to 0.15 | diff --git a/dotenv/Cargo.toml b/dotenv/Cargo.toml
index 597f8ff..ce56284 100644
--- a/dotenv/Cargo.toml
+++ b/dotenv/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "dotenv"
-version = "0.14.0"
+version = "0.15.0"
authors = ["Noemi Lapresta <noemi.lapresta@gmail.com>", "Craig Hills <chills@gmail.com>", "Mike Piccolo <m... | 3 | 5 | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.