#environment #env

dev environment

Helper to deal with environment variables

2 releases

0.1.1 Oct 12, 2017
0.1.0 Oct 12, 2017

#12 in Configuration

Download history 6372/week @ 2018-11-18 6175/week @ 2018-11-25 7172/week @ 2018-12-02 6964/week @ 2018-12-09 6321/week @ 2018-12-16 5293/week @ 2018-12-23 5730/week @ 2018-12-30 5620/week @ 2019-01-06 5727/week @ 2019-01-13 5866/week @ 2019-01-20 5469/week @ 2019-01-27 7439/week @ 2019-02-03 7680/week @ 2019-02-10 2833/week @ 2019-02-17 2333/week @ 2019-02-24

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