File tree Expand file tree Collapse file tree 3 files changed +66
-4
lines changed Expand file tree Collapse file tree 3 files changed +66
-4
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " environment"
3
- version = " 0.1.0 "
3
+ version = " 0.1.1 "
4
4
authors = [" Freyskeyd <simon.paitrault@gmail.com>" ]
5
5
description = " Helper to deal with environment variables."
6
- license = " MIT"
7
-
6
+ license = " MIT OR Apache-2.0"
7
+ repository = " https://github.com/Freyskeyd/environment.git"
8
+ homepage = " https://github.com/Freyskeyd/environment"
9
+ documentation = " http://docs.rs/environment/"
10
+ readme = " README.md"
11
+ keywords = [" environment" , " env" ]
8
12
9
13
[dependencies ]
Original file line number Diff line number Diff line change
1
+ # Environment
2
+
3
+ > ** Handle environment variable context** - This crate helps you to deal with environment variables.
4
+
5
+ [ ![ Build Status] ( https://travis-ci.org/Freyskeyd/environment.svg )] ( https://travis-ci.org/Freyskeyd/environment ) [ ![ Documentation] ( https://img.shields.io/badge/docs-master-blue.svg )] [ Documentation ]
6
+
7
+ ## Install
8
+
9
+ Just add it to your ` Cargo.toml ` :
10
+
11
+ ``` toml
12
+ [dependencies ]
13
+ environment = " 0.1"
14
+ ```
15
+
16
+ ## Example
17
+
18
+ Here's a trivial example:
19
+
20
+ ``` rust
21
+ extern crate environment;
22
+
23
+ use std :: process :: Command ;
24
+
25
+ fn main () {
26
+ let env = Environment :: inherit (). insert (" foo" , " bar" );
27
+
28
+
29
+ let mut c = Command :: new (" printenv" );
30
+
31
+ let output = c . env_clear ()
32
+ . envs (env . compile ())
33
+ . output ()
34
+ . expect (" failed to execute command" );
35
+
36
+ let output = String :: from_utf8_lossy (& output . stdout);
37
+
38
+ assert! (output . contains (" foo=bar" ));
39
+
40
+ }
41
+ ```
42
+
43
+ ## License
44
+
45
+ Licensed under either of
46
+
47
+ * Apache License, Version 2.0, ([ LICENSE-APACHE] ( LICENSE-APACHE ) or http://www.apache.org/licenses/LICENSE-2.0 )
48
+ * MIT license ([ LICENSE-MIT] ( LICENSE-MIT ) or http://opensource.org/licenses/MIT )
49
+
50
+ at your option.
51
+
52
+ ### Contribution
53
+
54
+ Unless you explicitly state otherwise, any contribution intentionally
55
+ submitted for inclusion in the work by you, as defined in the Apache-2.0
56
+ license, shall be dual licensed as above, without any additional terms or
57
+ conditions.
58
+
59
+ [ Documentation ] : https://docs.rs/environment
Original file line number Diff line number Diff line change @@ -125,7 +125,6 @@ where
125
125
#[ cfg( test) ]
126
126
mod test {
127
127
use super :: * ;
128
- use std:: borrow:: Cow ;
129
128
use std:: process:: Command ;
130
129
131
130
#[ test]
You can’t perform that action at this time.
0 commit comments