Skip to content

Commit

Permalink
fix: Reduce deps for users
Browse files Browse the repository at this point in the history
Markdown parsers and more are foited onto clients because of Skeptic.
This is inspired by the conversation at budziq/rust-skeptic#60 regarding
a "skeptic-lite" using rustdoc.
  • Loading branch information
epage committed Apr 10, 2018
1 parent 21f818b commit 7c69197
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 22 deletions.
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ categories = ["template-engine"]
keywords = ["liquid", "template", "templating", "language", "html"]
license = "MIT"

build = "build.rs"

[badges]
travis-ci = { repository = "cobalt-org/liquid-rust" }
appveyor = { repository = "cobalt-org/liquid-rust" }
Expand Down Expand Up @@ -46,10 +44,8 @@ serde_yaml = { version = "0.7", optional = true }
serde_json = { version = "1.0", optional = true }

[build-dependencies]
skeptic = "0.13.2"
serde = { version = "1.0", features = ["derive"] }

[dev-dependencies]
difference = "2.0"
skeptic = "0.13.2"
serde_yaml = "0.7"
17 changes: 5 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ To include liquid in your project add the following to your Cargo.toml:
liquid = "0.14"
```

Now you can use the crate in your code
Now you can use the crate in your code:

```rust
extern crate liquid;
```

Example:

```rust
extern crate liquid;

let template = liquid::ParserBuilder::with_liquid()
.build()
.parse("Liquid! {{num | minus: 2}}").unwrap();
Expand Down Expand Up @@ -73,14 +77,3 @@ See
[comment_block.rs](https://github.com/cobalt-org/liquid-rust/blob/master/src/tags/comment_block.rs)
for what a block implementation looks like. You can then register it by
calling `liquid::ParserBuilder::block`.

----------

<!---
Skeptic template:
```rust,skeptic-template
extern crate skeptic; extern crate liquid; fn main() {{ {} }}
```
-->
Empty file removed README.md.skt.md
Empty file.
5 changes: 0 additions & 5 deletions build.rs

This file was deleted.

40 changes: 39 additions & 1 deletion tests/skeptic.rs
Original file line number Diff line number Diff line change
@@ -1 +1,39 @@
include!(concat!(env!("OUT_DIR"), "/skeptic-tests.rs"));
use std::env;
use std::env::consts::EXE_EXTENSION;
use std::path::Path;
use std::process::Command;

#[test]
fn readme_test() {
let rustdoc = Path::new("rustdoc").with_extension(EXE_EXTENSION);
let readme = Path::new(file!())
.parent()
.unwrap()
.parent()
.unwrap()
.join("README.md");
let exe = env::current_exe().unwrap();
let depdir = exe.parent().unwrap();
let outdir = depdir.parent().unwrap();
let extern_arg = format!(
"read_process_memory={}",
outdir.join("libread_process_memory.rlib").to_string_lossy()
);
let mut cmd = Command::new(rustdoc);
cmd.args(&["--verbose", "--test", "-L"])
.arg(&outdir)
.arg("-L")
.arg(&depdir)
.arg("--extern")
.arg(&extern_arg)
.arg(&readme);
println!("Running `{:?}`", cmd);
let result = cmd.spawn()
.expect("Failed to spawn process")
.wait()
.expect("Failed to run process");
assert!(
result.success(),
"Failed to run rustdoc tests on README.md!"
);
}

0 comments on commit 7c69197

Please sign in to comment.