~repos /rust-embed

#rust#proc-macro#http

git clone https://pyrossh.dev/repos/rust-embed.git
Discussions: https://groups.google.com/g/rust-embed-devs

rust macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev.


Files changed (4) hide show
  1. .travis.yml +5 -3
  2. Cargo.toml +3 -3
  3. changelog.md +72 -1
  4. readme.md +12 -2
.travis.yml CHANGED
@@ -14,7 +14,9 @@ matrix:
14
14
 
15
15
  script:
16
16
  - |
17
- cargo test --lib
17
+ cargo test --test lib
18
- cargo test --lib --release
18
+ cargo test --release --test lib
19
19
  cargo build --example basic
20
- cargo build --release --example basic
20
+ cargo build --release --example basic
21
+ cargo build --example actix --features actix
22
+ cargo build --release --example actix --features actix
Cargo.toml CHANGED
@@ -18,15 +18,15 @@ syn = "0.11"
18
18
  quote = "0.3"
19
19
  walkdir = "2.1.4"
20
20
 
21
+ actix-web = { version = "0.6", optional = true }
22
+
21
23
  rocket = { version = "0.3.6", optional = true }
22
24
  rocket_codegen = { version = "0.3.6", optional = true }
23
25
  rocket_contrib = { version = "0.3.6", optional = true }
24
26
 
25
- [dev-dependencies]
26
- actix-web = "0.6"
27
-
28
27
  [features]
29
28
  nightly = ["rocket", "rocket_codegen", "rocket_contrib"]
29
+ actix = ["actix-web"]
30
30
 
31
31
  [badges]
32
32
  appveyor = { repository = "pyros2097/rust-embed" }
changelog.md CHANGED
@@ -6,18 +6,89 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
6
 
7
7
  Thanks to [Mcat12](https://github.com/Mcat12) for the changelog.
8
8
 
9
+ ## [3.0.0] - 2018-06-01
10
+ ### Changed
11
+ - The derive attribute style so we don't need `attr_literals`:
12
+ ```rust
13
+ #[folder("assets/")]
14
+ ```
15
+ to
16
+ ```rust
17
+ #[folder = "assets/"]
18
+ ```
19
+ ### Removed
20
+ - log dependecy as we are not using it anymore
21
+
9
22
  ## [2.0.0] - 2018-05-26
10
23
  ### Changed
11
24
  - Reimplemented the macro for release to use include_bytes for perf sake. Thanks to [lukad](https://github.com/lukad).
12
25
 
13
26
  ## [1.1.1] - 2018-03-19
14
27
  ### Changed
28
+ - Fixed usage error message
29
+
30
+ ## [1.1.0] - 2018-03-19
31
+ ### Added
32
+ - Release mode for custom derive
33
+ ### Changed
34
+ - Fixed tests in travis
35
+
36
+ ## [1.0.0] - 2018-03-18
37
+ ### Changed
15
- - Converted the rust-embed macro `embed!` into a Rust Custom Derive Macro `#[derive(RustEmbed)]`
38
+ - Converted the rust-embed macro `embed!` into a Rust Custom Derive Macro `#[derive(RustEmbed)]` which implements get on the struct
39
+ ```rust
40
+ let asset = embed!("examples/public/")
41
+ ```
42
+ to
43
+ ```rust
44
+ #[derive(RustEmbed)]
45
+ #[folder = "examples/public/"]
46
+ struct Asset;
47
+ ```
48
+
49
+ ## [0.5.2] - 2018-03-16
50
+ ### Added
51
+ - rouille example
52
+
53
+ ## [0.5.1] - 2018-03-16
54
+ ### Removed
55
+ - the plugin attribute from crate
16
56
 
17
57
  ## [0.5.0] - 2018-03-16
58
+ ### Added
59
+ - rocket example
18
60
  ### Changed
19
61
  - Converted the rust-embed executable into a macro `embed!` which now loads files at compile time during release and from the fs during dev.
20
62
 
63
+ ## [0.4.0] - 2017-03-2
64
+ ### Changed
65
+ - `generate_assets` to public again
66
+
67
+ ## [0.3.5] - 2017-03-2
68
+ ### Added
69
+ - rust-embed prefix to all logs
70
+
71
+ ## [0.3.4] - 2017-03-2
72
+ ### Changed
73
+ - the lib to be plugin again
74
+
75
+ ## [0.3.3] - 2017-03-2
76
+ ### Changed
77
+ - the lib to be proc-macro from plugin
78
+
79
+ ## [0.3.2] - 2017-03-2
80
+ ### Changed
81
+ - lib name from `rust-embed` to `rust_embed`
82
+
83
+ ## [0.3.1] - 2017-03-2
84
+ ### Removed
85
+ - hyper example
86
+
87
+ ## [0.3.0] - 2017-02-26
88
+ ### Added
89
+ - rust-embed executable which generates rust code to embed resource files into your rust executable
90
+ it creates a file like assets.rs that contains the code for your assets.
91
+
21
92
  ## [0.2.0] - 2017-03-16
22
93
  ### Added
23
94
  - rust-embed executable which generates rust code to embed resource files into your rust executable
readme.md CHANGED
@@ -3,6 +3,12 @@ Rust Custom Derive Macro which loads files into the rust binary at compile time
3
3
 
4
4
  You can use this to embed your css, js and images into a single executable which can be deployed to your servers. Also it makes it easy to build a very small docker image for you to deploy.
5
5
 
6
+ ### Dev
7
+ <img src="https://user-images.githubusercontent.com/1687946/40840773-b1ae1ce6-65c5-11e8-80ac-9e9196701ca2.png" width="700" height="100">
8
+
9
+ ### Release
10
+ <img src="https://user-images.githubusercontent.com/1687946/40840774-b1dd709a-65c5-11e8-858d-73a88e25f07a.png" width="700" height="184">
11
+
6
12
  ## Installation
7
13
 
8
14
  ```
@@ -42,14 +48,18 @@ To run the example in release mode where it reads from binary,
42
48
 
43
49
  `cargo run --release --example basic`
44
50
 
51
+ Note: To run the `actix-web` example:
52
+
53
+ `cargo run --example actix --features actix`
54
+
45
55
  Note: To run the `rocket` example, add the `nightly` feature flag and run on a nightly build:
46
56
 
47
57
  `cargo +nightly run --example rocket --features nightly`
48
58
 
49
59
  ## Testing
50
- debug: `cargo test --tests --lib`
60
+ debug: `cargo test --test lib`
51
61
 
52
- release: `cargo test --tests --lib --release`
62
+ release: `cargo test --release --test lib`
53
63
 
54
64
  Go Rusketeers!
55
65
  The power is yours!