#environment #env

dev environment

Helper to deal with environment variables

2 releases

0.1.1 Oct 12, 2017
0.1.0 Oct 12, 2017

#6 in Configuration

Download history 5194/week @ 2018-10-11 6680/week @ 2018-10-18 6213/week @ 2018-10-25 7157/week @ 2018-11-01 6542/week @ 2018-11-08 6437/week @ 2018-11-15 6443/week @ 2018-11-22 5806/week @ 2018-11-29 7260/week @ 2018-12-06 6971/week @ 2018-12-13 6549/week @ 2018-12-20 5464/week @ 2018-12-27 5759/week @ 2019-01-03

3,172 downloads per month
Used in 34 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