aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTill Höppner2016-02-18 19:12:44 +0100
committerTill Höppner2016-02-18 19:12:44 +0100
commitd5fc8605e1ecb29db20a8739f770e4702f2575e6 (patch)
tree5c11d19e268581931db318bcdc6a3bdceebbf9dd
parentcf5c804fb38df114c75b37878d5703d67402ef89 (diff)
downloadincludedir-d5fc8605e1ecb29db20a8739f770e4702f2575e6.tar.gz
includedir-d5fc8605e1ecb29db20a8739f770e4702f2575e6.tar.xz
includedir-d5fc8605e1ecb29db20a8739f770e4702f2575e6.zip
Bump versions, update README examples
-rw-r--r--README.md23
-rw-r--r--codegen/Cargo.toml2
-rw-r--r--example/Cargo.toml6
-rw-r--r--lib/Cargo.toml2
4 files changed, 18 insertions, 15 deletions
diff --git a/README.md b/README.md
index 5c0f624..77f6fbf 100644
--- a/README.md
+++ b/README.md
@@ -11,8 +11,8 @@ Include a directory in your Rust binary, e.g. static files for your web server o
* [x] Automatically compile data into binary
* [x] Use [rust-phf](https://github.com/sfackler/rust-phf) for efficient lookup
-* [ ] Wrapping API around the phf map, to abstract away additional features
-* [ ] Compression
+* [x] Wrapping API around the phf map, to abstract away additional features
+* [x] Compression, with optional crate "flate2"
* [ ] Reading from source files for debug builds
## Example
@@ -28,31 +28,36 @@ include = ["data"]
[dependencies]
phf = "0.7.12"
+includedir = "0.2.0"
[build-dependencies]
-includedir = "0.1.1"
+includedir_codegen = "0.2.0"
```
**build.rs**
```rust
-extern crate includedir;
+extern crate includedir_codegen;
+
+use includedir_codegen::Compression;
fn main() {
- includedir::build("data").unwrap();
+ includedir_codegen::start("FILES")
+ .dir("data", Compression::Gzip)
+ .build("data.rs")
+ .unwrap();
}
```
**src/main.rs**
```rust
+extern crate includedir;
extern crate phf;
-include!(concat!(env!("OUT_DIR"), "/dir_data.rs"));
+include!(concat!(env!("OUT_DIR"), "/data.rs"));
fn main() {
- for (k, v) in FILES.entries() {
- println!("{}: {} bytes", k, v.len());
- }
+ println!("{:?}", FILES.get("data/foo"))
}
```
diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml
index 1fb1cad..e6b3f40 100644
--- a/codegen/Cargo.toml
+++ b/codegen/Cargo.toml
@@ -2,7 +2,7 @@
name = "includedir_codegen"
description = "Include a whole directory tree at compile time! - Compile time part"
keywords = ["include", "tree", "directory", "build", "static"]
-version = "0.1.1"
+version = "0.2.0"
authors = ["Till Höppner <till@hoeppner.ws>"]
license = "MIT"
homepage = "https://github.com/tilpner/includedir"
diff --git a/example/Cargo.toml b/example/Cargo.toml
index a3cd724..c7c6496 100644
--- a/example/Cargo.toml
+++ b/example/Cargo.toml
@@ -8,9 +8,7 @@ publish = false
[dependencies]
phf = "0.7.12"
-# includedir = "0.1.1"
-includedir = { default-features = true, path = "../lib" }
+includedir = "0.2.0"
[build-dependencies]
-# includedir_codegen = "0.1.1"
-includedir_codegen = { path = "../codegen" }
+includedir_codegen = "0.2.0"
diff --git a/lib/Cargo.toml b/lib/Cargo.toml
index 732ddd6..b13589b 100644
--- a/lib/Cargo.toml
+++ b/lib/Cargo.toml
@@ -2,7 +2,7 @@
name = "includedir"
description = "Include a whole directory tree at compile time! - Runtime part"
keywords = ["include", "tree", "directory", "build", "static"]
-version = "0.1.1"
+version = "0.2.0"
authors = ["Till Höppner <till@hoeppner.ws>"]
license = "MIT"
homepage = "https://github.com/tilpner/includedir"