#environment #env

dev environment

Helper to deal with environment variables

2 releases

0.1.1 Oct 12, 2017
0.1.0 Oct 12, 2017

#46 in Configuration

Download history 5816/week @ 2019-01-22 5574/week @ 2019-01-29 8219/week @ 2019-02-05 6712/week @ 2019-02-12 2026/week @ 2019-02-19 2353/week @ 2019-02-26 1154/week @ 2019-03-05 568/week @ 2019-03-12 594/week @ 2019-03-19 692/week @ 2019-03-26 815/week @ 2019-04-02 876/week @ 2019-04-09 397/week @ 2019-04-16 308/week @ 2019-04-23 369/week @ 2019-04-30

3,172 downloads per month
Used in 38 crates (1 directly)

MIT/Apache

9KB
149 lines

Environment

Handle environment variable context - This crate helps you to deal with environment variables.

Build Status Documentation

Install

Just add it to your Cargo.toml:

[dependencies]
environment = "0.1"

Example

Here's a trivial example:

extern crate environment;

use std::process::Command;

fn main() {
    let env = Environment::inherit().insert("foo", "bar");


    let mut c = Command::new("printenv");

    let output = c.env_clear()
        .envs(env.compile())
        .output()
        .expect("failed to execute command");

    let output = String::from_utf8_lossy(&output.stdout);

    assert!(output.contains("foo=bar"));

}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps