From db67f9b9866e2ff5be5b5d470708d995d28584a7 Mon Sep 17 00:00:00 2001 From: "Morley, Jonathan" Date: Thu, 27 Sep 2018 18:08:30 -0400 Subject: [PATCH] Support git file paths, also bump crate versions --- Cargo.lock | 909 +++++++++---------- Cargo.toml | 9 +- src/config.rs | 278 +++++- src/git.rs | 134 +-- src/main.rs | 79 +- src/transform/helper_comma_delimited_list.rs | 80 ++ src/transform/helper_equal.rs | 76 ++ src/transform/helper_lowercase.rs | 47 + src/transform/helper_or.rs | 83 ++ src/transform/helper_url_add_slash.rs | 68 ++ src/transform/helper_url_rm_path.rs | 97 ++ src/transform/helper_url_rm_slash.rs | 56 ++ src/transform/helper_yaml_string.rs | 62 ++ src/transform/helpers.rs | 443 --------- src/transform/mod.rs | 59 +- 15 files changed, 1353 insertions(+), 1127 deletions(-) create mode 100644 src/transform/helper_comma_delimited_list.rs create mode 100644 src/transform/helper_equal.rs create mode 100644 src/transform/helper_lowercase.rs create mode 100644 src/transform/helper_or.rs create mode 100644 src/transform/helper_url_add_slash.rs create mode 100644 src/transform/helper_url_rm_path.rs create mode 100644 src/transform/helper_url_rm_slash.rs create mode 100644 src/transform/helper_yaml_string.rs delete mode 100644 src/transform/helpers.rs diff --git a/Cargo.lock b/Cargo.lock index c9f2dfc..0dcab3d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,10 +5,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "aho-corasick" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -16,35 +16,33 @@ name = "ansi_term" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ascii" -version = "0.7.1" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "assert_cli" -version = "0.5.4" +name = "assert_cmd" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "colored 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "difference 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "environment 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", - "skeptic 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", + "escargot 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates-core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates-tree 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "atty" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -52,57 +50,52 @@ name = "backtrace" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "backtrace-sys 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "backtrace-sys" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "base64" -version = "0.7.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "bitflags" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "bitflags" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "brotli-sys" -version = "0.2.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "brotli2" -version = "0.2.2" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "brotli-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "brotli-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -119,14 +112,9 @@ name = "build_const" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "bytecount" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "byteorder" -version = "1.2.3" +version = "1.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -135,7 +123,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bzip2-sys 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -143,48 +131,27 @@ name = "bzip2-sys" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "cargo_metadata" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cc" -version = "1.0.18" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cfg-if" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "chrono" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "chrono" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -199,8 +166,8 @@ version = "2.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -208,19 +175,11 @@ dependencies = [ ] [[package]] -name = "cmake" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "colored" -version = "1.6.1" +name = "cloudabi" +version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -233,16 +192,16 @@ dependencies = [ [[package]] name = "curl-sys" -version = "0.4.6" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", - "vcpkg 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.36 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -251,13 +210,13 @@ version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "gzip-header 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "difference" -version = "1.0.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -265,14 +224,9 @@ name = "dir-diff" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "walkdir 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "walkdir 2.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "dtoa" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "either" version = "1.5.0" @@ -344,56 +298,61 @@ dependencies = [ ] [[package]] -name = "environment" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "error-chain" -version = "0.11.0" +name = "escargot" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "failure" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "failure_derive" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "filetime" -version = "0.1.15" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "flate2" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "miniz_oxide_c_api 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "float-cmp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "fs_extra" version = "1.1.0" @@ -404,7 +363,7 @@ name = "fuchsia-zircon" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -413,30 +372,20 @@ name = "fuchsia-zircon-sys" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "gcc" -version = "0.3.54" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "git2" -version = "0.7.2" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "libgit2-sys 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libgit2-sys 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.36 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "glob" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "gzip-header" version = "0.1.2" @@ -448,49 +397,51 @@ dependencies = [ [[package]] name = "handlebars" -version = "0.32.4" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "pest_derive 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "pest_derive 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", + "walkdir 2.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "hogan" -version = "0.2.4" +version = "0.2.6" dependencies = [ - "assert_cli 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "assert_cmd 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "dir-diff 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "git2 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "handlebars 0.32.4 (registry+https://github.com/rust-lang/crates.io-index)", + "git2 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", + "handlebars 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", "json-patch 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rouille 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rouille 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "shellexpand 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "stderrlog 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "structopt 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "walkdir 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "walkdir 2.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "zip 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "httparse" -version = "1.3.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -498,7 +449,7 @@ name = "idna" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -513,7 +464,7 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -521,68 +472,61 @@ name = "json-patch" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "treediff 3.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "kernel32-sys" -version = "0.2.2" +name = "lazy_static" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "lazy_static" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "libc" -version = "0.2.42" +version = "0.2.43" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libgit2-sys" -version = "0.7.5" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", - "curl-sys 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "libssh2-sys 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "curl-sys 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libssh2-sys 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.36 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libssh2-sys" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", - "vcpkg 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.36 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libz-sys" -version = "1.0.18" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", - "vcpkg 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -590,20 +534,20 @@ name = "log" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "log" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "matches" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -611,15 +555,17 @@ name = "memchr" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "memchr" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -636,8 +582,8 @@ version = "1.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "phf 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", - "phf_codegen 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", + "phf 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_codegen 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -647,7 +593,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -655,9 +601,9 @@ name = "miniz_oxide_c_api" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "miniz_oxide 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -667,7 +613,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -676,7 +622,7 @@ version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "buf_redux 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "mime_guess 1.8.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -687,30 +633,16 @@ dependencies = [ ] [[package]] -name = "num" -version = "0.1.42" +name = "normalize-line-endings" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", - "num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "num-integer" version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-iter" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -718,12 +650,12 @@ name = "num-traits" version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-traits" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -731,7 +663,7 @@ name = "num_cpus" version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -741,13 +673,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "openssl-sys" -version = "0.9.33" +version = "0.9.36" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", - "vcpkg 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -762,7 +694,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "pest_derive" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -772,42 +704,42 @@ dependencies = [ [[package]] name = "phf" -version = "0.7.22" +version = "0.7.23" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "phf_codegen" -version = "0.7.22" +version = "0.7.23" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "phf_generator 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", - "phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_generator 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "phf_generator" -version = "0.7.22" +version = "0.7.23" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "phf_shared" -version = "0.7.22" +version = "0.7.23" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "pkg-config" -version = "0.3.11" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -816,19 +748,37 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "proc-macro2" -version = "0.4.8" +name = "predicates" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "float-cmp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "normalize-line-endings 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates-core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "pulldown-cmark" -version = "0.1.2" +name = "predicates-core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "predicates-tree" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "predicates-core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "treeline 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro2" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -843,10 +793,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "quote" -version = "0.6.3" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -855,20 +805,37 @@ version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rand" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "redox_syscall" version = "0.1.40" @@ -884,19 +851,19 @@ dependencies = [ [[package]] name = "regex" -version = "1.0.1" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-syntax" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -907,41 +874,41 @@ name = "remove_dir_all" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rouille" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "base64 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "brotli2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "brotli2 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "deflate 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)", - "filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", + "filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "multipart 0.13.6 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", - "sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", + "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "term 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "tiny_http 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tiny_http 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rustc-demangle" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "rustc-serialize" -version = "0.3.24" +name = "ryu" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -950,55 +917,49 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "same-file" -version = "1.0.2" +name = "safemem" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] -name = "semver" -version = "0.9.0" +name = "same-file" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "serde" -version = "1.0.70" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "serde_derive" -version = "1.0.70" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_json" -version = "1.0.24" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "sha1" -version = "0.2.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1008,33 +969,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "siphasher" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "skeptic" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytecount 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)", - "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", - "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "walkdir 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "stderrlog" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "chrono 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1056,9 +1002,9 @@ name = "structopt-derive" version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1073,11 +1019,21 @@ dependencies = [ [[package]] name = "syn" -version = "0.14.4" +version = "0.14.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syn" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1091,11 +1047,13 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.6.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1103,29 +1061,30 @@ name = "tempdir" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tempfile" -version = "3.0.2" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "term" -version = "0.2.14" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1141,7 +1100,7 @@ name = "termion" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1156,11 +1115,10 @@ dependencies = [ [[package]] name = "thread_local" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1176,22 +1134,22 @@ name = "time" version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tiny_http" -version = "0.5.9" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ascii 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.2.25 (registry+https://github.com/rust-lang/crates.io-index)", + "ascii 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "chunked_transfer 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "url 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1199,15 +1157,20 @@ name = "treediff" version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "treeline" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "twoway" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1220,7 +1183,7 @@ name = "unicase" version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1228,7 +1191,7 @@ name = "unicode-bidi" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1251,51 +1214,24 @@ name = "unicode-xid" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "unreachable" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "url" -version = "0.2.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", - "uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "url" version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "utf8-ranges" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "uuid" -version = "0.1.18" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "vcpkg" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1305,31 +1241,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "version_check" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "void" -version = "1.0.2" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "walkdir" -version = "2.1.4" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "same-file 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "same-file 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "winapi" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1337,14 +1264,17 @@ dependencies = [ ] [[package]] -name = "winapi-build" -version = "0.1.1" +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "winapi-util" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "winapi-x86_64-pc-windows-gnu" @@ -1356,7 +1286,7 @@ name = "wincolor" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1365,7 +1295,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bzip2 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "msdos_time 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "podio 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1373,39 +1303,33 @@ dependencies = [ [metadata] "checksum adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c" -"checksum aho-corasick 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c1c6d463cbe7ed28720b5b489e7c083eeb8f90d08be2a0d6bb9e1ffea9ce1afa" +"checksum aho-corasick 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "68f56c7353e5a9547cbd76ed90f7bb5ffc3ba09d4ea9bd1d8c06c8b1142eeb5a" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -"checksum ascii 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae7d751998c189c1d4468cf0a39bb2eae052a9c58d50ebb3b9591ee3813ad50" -"checksum assert_cli 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "72342c21057a3cb5f7c2d849bf7999a83795434dd36d74fa8c24680581bd1930" -"checksum atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2fc4a1aa4c24c0718a250f0681885c1af91419d242f29eb8f2ab28502d80dbd1" +"checksum ascii 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "97be891acc47ca214468e09425d02cef3af2c94d0d82081cd02061f996802f14" +"checksum assert_cmd 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c5b60c276f334145cf2cec09c5bb6f63523f078c0c850909f66bca8f933cf809" +"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" "checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a" -"checksum backtrace-sys 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)" = "bff67d0c06556c0b8e6b5f090f0eac52d950d9dfd1d35ba04e4ca3543eaf6a7e" -"checksum base64 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5032d51da2741729bfdaeb2664d9b8c6d9fd1e2b90715c660b6def36628499c2" -"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" -"checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789" -"checksum brotli-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cb50f54b2e0c671b7ef1637a76237ebacbb293be179440d5d65ca288e42116bb" -"checksum brotli2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ea9d0bbab1235017a09226b079ed733bca4bf9ecb6b6102bd01aac79ea082dca" +"checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0" +"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" +"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" +"checksum brotli-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4445dea95f4c2b41cde57cc9fee236ae4dbae88d8fcbdb4750fc1bb5d86aaecd" +"checksum brotli2 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0cb036c3eade309815c15ddbacec5b22c4d1f3983a774ab2eac2e3e9ea85568e" "checksum buf_redux 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b9279646319ff816b05fb5897883ece50d7d854d12b59992683d4f8a71b0f949" "checksum build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39092a32794787acd8525ee150305ff051b0aa6cc2abaf193924f5ab05425f39" -"checksum bytecount 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "882585cd7ec84e902472df34a5e01891202db3bf62614e1f0afe459c1afcf744" -"checksum byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "74c0b906e9446b0a2e4f760cdb3fa4b2c48cdc6db8766a845c54b6ff063fd2e9" +"checksum byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "90492c5858dd7d2e78691cfb89f90d273a2800fc11d98f60786e5d87e2f83781" "checksum bzip2 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "42b7c3cbf0fa9c1b82308d57191728ca0256cb821220f4e2fd410a72ade26e3b" "checksum bzip2-sys 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2c5162604199bbb17690ede847eaa6120a3f33d5ab4dcc8e7c25b16d849ae79b" -"checksum cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1efca0b863ca03ed4c109fb1c55e0bc4bbeb221d3e103d86251046b06a526bd0" -"checksum cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "2119ea4867bd2b8ed3aecab467709720b2d55b1bcfe09f772fd68066eaf15275" -"checksum cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efe5c877e17a9c717a0bf3613b2709f723202c4e4675cc8f12926ded29bcb17e" -"checksum chrono 0.2.25 (registry+https://github.com/rust-lang/crates.io-index)" = "9213f7cd7c27e95c2b57c49f0e69b1ea65b27138da84a170133fd21b07659c00" -"checksum chrono 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6962c635d530328acc53ac6a955e83093fedc91c5809dfac1fa60fa470830a37" +"checksum cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f159dfd43363c4d08055a07703eb7a3406b0dac4d0584d96965a3262db3c9d16" +"checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3" +"checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878" "checksum chunked_transfer 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "498d20a7aaf62625b9bf26e637cf7736417cde1d0c99f1d04d1170229a85cf87" "checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e" -"checksum cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "95470235c31c726d72bf2e1f421adc1e65b9d561bf5529612cbe1a72da1467b3" -"checksum colored 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc0a60679001b62fb628c4da80e574b9645ab4646056d7c9018885efffe45533" +"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb" -"checksum curl-sys 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "db735aaa19154d8d4ba28e4a3546e90f13a14016a7a8ac10c799bae6929c00a4" +"checksum curl-sys 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "78800a6de442f65dab6ce26c6f369c14fc585686432bf4b77119d2d384216c31" "checksum deflate 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)" = "32c8120d981901a9970a3a1c97cf8b630e0fa8c3ca31e75b6fd6fd5f9f427b31" -"checksum difference 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3304d19798a8e067e48d8e69b2c37f0b5e9b4e462504ad9e27e9f3fce02bba8" +"checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" "checksum dir-diff 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1cce6e50ca36311e494793f7629014dc78cd963ba85cd05968ae06a63b867f0b" -"checksum dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6d301140eb411af13d3115f9a562c85cc6b541ade9dfa314132244aaee7489dd" "checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0" "checksum encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec" "checksum encoding-index-japanese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91" @@ -1415,104 +1339,104 @@ dependencies = [ "checksum encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18" "checksum encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" "checksum enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be4551092f4d519593039259a9ed8daedf0da12e5109c5280338073eaeb81180" -"checksum environment 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f4b14e20978669064c33b4c1e0fb4083412e40fe56cbea2eae80fd7591503ee" -"checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3" -"checksum failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "934799b6c1de475a012a02dab0ace1ace43789ee4b99bcfbf1a2e3e8ced5de82" -"checksum failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c7cdda555bb90c9bb67a3b670a0f42de8e73f5981524123ad8578aafec8ddb8b" -"checksum filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "714653f3e34871534de23771ac7b26e999651a0a228f47beb324dfdf1dd4b10f" -"checksum flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9fac2277e84e5e858483756647a9d0aa8d9a2b7cba517fd84325a0aaa69a0909" +"checksum escargot 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "19db1f7e74438642a5018cdf263bb1325b2e792f02dd0a3ca6d6c0f0d7b1d5a5" +"checksum failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7efb22686e4a466b1ec1a15c2898f91fa9cb340452496dca654032de20ff95b9" +"checksum failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "946d0e98a50d9831f5d589038d2ca7f8f455b1c21028c0db0e84116a12696426" +"checksum filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "da4b9849e77b13195302c174324b5ba73eec9b236b24c221a61000daefb95c5f" +"checksum flate2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "37847f133aae7acf82bb9577ccd8bda241df836787642654286e79679826a54b" +"checksum float-cmp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "134a8fa843d80a51a5b77d36d42bc2def9edcb0262c914861d08129fd1926600" "checksum fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5f2a4a2034423744d2cc7ca2068453168dcdb82c438419e639a26bd87839c674" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb" -"checksum git2 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "910a2df52d2354e4eb27aa12f3803ea86bf461a93e17028908ec0e356572aa7b" -"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" +"checksum git2 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "591f8be1674b421644b6c030969520bc3fa12114d2eb467471982ed3e9584e71" "checksum gzip-header 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0a9fcfe1c9ee125342355b2467bc29b9dfcb2124fcae27edb9cee6f4cc5ecd40" -"checksum handlebars 0.32.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d89ec99d1594f285d4590fc32bac5f75cdab383f1123d504d27862c644a807dd" -"checksum httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7b6288d7db100340ca12873fd4d08ad1b8f206a9457798dfb17c018a33fee540" +"checksum handlebars 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c0da04699ab325108361560af18bc8082e36e8a9ee0f4830ddd87ad128dcc950" +"checksum httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e8734b0cfd3bc3e101ec59100e101c2eecd19282202e87808b3037b442777a83" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)" = "f58856976b776fedd95533137617a02fb25719f40e7d9b01c7043cd65474f450" -"checksum itoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5adb58558dcd1d786b5f0bd15f3226ee23486e24b7b58304b60f64dc68e62606" +"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" "checksum json-patch 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3bde23771b4f5b9900635b0415485323b6d39afa979dcd5541218d67bb9107b4" -"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fb497c35d362b6a331cfd94956a07fc2c78a4604cdbee844a81170386b996dd3" -"checksum libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)" = "b685088df2b950fccadf07a7187c8ef846a959c142338a48f9dc0b94517eb5f1" -"checksum libgit2-sys 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "9dcce5a1ecca1891ab06c1545a422fd4b35f65c19acec51ea638c66d5be0810d" -"checksum libssh2-sys 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c628b499e8d1a4f4bd09a95d6cb1f8aeb231b46a9d40959bbd0408f14dd63adf" -"checksum libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "87f737ad6cc6fd6eefe3d9dc5412f1573865bded441300904d2f42269e140f16" +"checksum lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca488b89a5657b0a2ecd45b95609b3e848cf1755da332a0da46e2b2b1cb371a7" +"checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d" +"checksum libgit2-sys 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4916b5addc78ec36cc309acfcdf0b9f9d97ab7b84083118b248709c5b7029356" +"checksum libssh2-sys 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "126a1f4078368b163bfdee65fbab072af08a1b374a5551b21e87ade27b1fbf9d" +"checksum libz-sys 1.0.23 (registry+https://github.com/rust-lang/crates.io-index)" = "c7bdca442aa002a930e6eb2a71916cabe46d91ffec8df66db0abfb1bc83469ab" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -"checksum log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "61bd98ae7f7b754bc53dca7d44b604f733c6bba044ea6f41bc8d89272d8161d2" -"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" +"checksum log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fcce5fa49cc693c312001daf1d13411c4a5283796bac1084299ea3e567113f" +"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a" -"checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d" +"checksum memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4b3629fe9fdbff6daa6c33b90f7c08355c1aca05a3d01fa8063b822fcf185f3b" "checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" "checksum mime_guess 1.8.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2d4c0961143b8efdcfa29c3ae63281601b446a4a668165454b6c90f8024954c5" "checksum miniz_oxide 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9ba430291c9d6cedae28bcd2d49d1c32fc57d60cd49086646c5dd5673a870eb5" "checksum miniz_oxide_c_api 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5a5b8234d6103ebfba71e29786da4608540f862de5ce980a1c94f86a40ca0d51" "checksum msdos_time 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aad9dfe950c057b1bfe9c1f2aa51583a8468ef2a5baba2ebbe06d775efeb7729" "checksum multipart 0.13.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92f54eb45230c3aa20864ccf0c277eeaeadcf5e437e91731db498dbf7fbe0ec6" -"checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" +"checksum normalize-line-endings 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2e0a1a39eab95caf4f5556da9289b9e68f0aafac901b2ce80daaf020d3b733a8" "checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea" -"checksum num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "af3fdbbc3291a5464dc57b03860ec37ca6bf915ed6ee385e7c6c052c422b2124" "checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" -"checksum num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "630de1ef5cc79d0cdd78b7e33b81f083cbfe90de0f4b2b2f07f905867c70e9fe" +"checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" "checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" "checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" -"checksum openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)" = "d8abc04833dcedef24221a91852931df2f63e3369ae003134e70aff3645775cc" +"checksum openssl-sys 0.9.36 (registry+https://github.com/rust-lang/crates.io-index)" = "409d77eeb492a1aebd6eb322b2ee72ff7c7496b4434d98b3bf8be038755de65e" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" "checksum pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0fce5d8b5cc33983fc74f78ad552b5522ab41442c4ca91606e4236eb4b5ceefc" -"checksum pest_derive 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "ab94faafeb93f4c5e3ce81ca0e5a779529a602ad5d09ae6d21996bfb8b6a52bf" -"checksum phf 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)" = "7d37a244c75a9748e049225155f56dbcb98fe71b192fd25fd23cb914b5ad62f2" -"checksum phf_codegen 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)" = "4e4048fe7dd7a06b8127ecd6d3803149126e9b33c7558879846da3a63f734f2b" -"checksum phf_generator 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)" = "05a079dd052e7b674d21cb31cbb6c05efd56a2cd2827db7692e2f1a507ebd998" -"checksum phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)" = "c2261d544c2bb6aa3b10022b0be371b9c7c64f762ef28c6f5d4f1ef6d97b5930" -"checksum pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "110d5ee3593dbb73f56294327fe5668bcc997897097cbc76b51e7aed3f52452f" +"checksum pest_derive 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3294f437119209b084c797604295f40227cffa35c57220b1e99a6ff3bf8ee4" +"checksum phf 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)" = "cec29da322b242f4c3098852c77a0ca261c9c01b806cae85a5572a1eb94db9a6" +"checksum phf_codegen 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)" = "7d187f00cd98d5afbcd8898f6cf181743a449162aeb329dcd2f3849009e605ad" +"checksum phf_generator 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)" = "03dc191feb9b08b0dc1330d6549b795b9d81aec19efe6b4a45aec8d4caee0c4b" +"checksum phf_shared 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)" = "b539898d22d4273ded07f64a05737649dc69095d92cb87c7097ec68e3f150b93" +"checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c" "checksum podio 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "780fb4b6698bbf9cf2444ea5d22411cef2953f0824b98f33cf454ec5615645bd" -"checksum proc-macro2 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c65b1ea15bb859d922cade2d1765b4b88beac339cbfad545ef2d2ef8c8215ee6" -"checksum pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d6fdf85cda6cadfae5428a54661d431330b312bc767ddbc57adbedc24da66e32" +"checksum predicates 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "799dc506006c16c25b28476046abfc20a95f71de59e95ebb8ee302e029a30173" +"checksum predicates-core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85f80bc390d1c02a4cdaa63f27f05c3c426679eb65433d8dd65d392147e4e5c5" +"checksum predicates-tree 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2e86df9b81bdcb0a5141aca9d2b9c5e0c558ef6626d3ae2c12912f5c9df740bd" +"checksum proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)" = "ffe022fb8c8bd254524b0b3305906c1921fa37a84a644e29079a9e62200c3901" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" -"checksum quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e44651a0dc4cdd99f71c83b561e221f714912d11af1a4dff0631f923d53af035" +"checksum quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dd636425967c33af890042c483632d33fa7a18f19ad1d7ea72e8998c6ef8dea5" "checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" -"checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" +"checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd" +"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c" +"checksum rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edecf0f94da5551fc9b492093e30b041a891657db7940ee221f9d2f66e82eef2" "checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" -"checksum regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13c93d55961981ba9226a213b385216f83ab43bd6ac53ab16b2eeb47e337cf4e" -"checksum regex-syntax 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05b06a75f5217880fc5e905952a42750bf44787e56a6c6d6852ed0992f5e1d54" +"checksum regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2069749032ea3ec200ca51e4a31df41759190a88edca0d2d86ee8bedf7073341" +"checksum regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "747ba3b235651f6e2f67dfa8bcdcd073ddb7c243cb21c442fc12395dfcac212d" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" -"checksum rouille 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc1f8407af80b0630983b2c1f1860dda1960fdec8d3ee75ba8db14937756d3a0" -"checksum rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "76d7ba1feafada44f2d38eed812bd2489a03c0f5abb975799251518b68848649" -"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" +"checksum rouille 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0845b9c39ba772da769fe2aaa4d81bfd10695a7ea051d0510702260ff4159841" +"checksum rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "bcfe5b13211b4d78e5c2cadfebd7769197d95c639c35a50057eb4c05de811395" +"checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7" "checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" -"checksum same-file 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cfb6eded0b06a0b512c8ddbcf04089138c9b4362c2f696f3c3d76039d68f3637" -"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)" = "0c3adf19c07af6d186d91dae8927b83b0553d07ca56cbf7f2f32560455c91920" -"checksum serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)" = "3525a779832b08693031b8ecfb0de81cd71cfd3812088fafe9a7496789572124" -"checksum serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c6908c7b925cd6c590358a4034de93dbddb20c45e1d021931459fd419bf0e2" -"checksum sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc30b1e1e8c40c121ca33b86c23308a090d19974ef001b4bf6e61fd1a0fb095c" +"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9" +"checksum same-file 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10f7794e2fda7f594866840e95f5c5962e886e228e68b6505885811a94dd728c" +"checksum serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)" = "84257ccd054dc351472528c8587b4de2dbf0dc0fe2e634030c1a90bfdacebaa9" +"checksum serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)" = "31569d901045afbff7a9479f793177fe9259819aff10ab4f89ef69bbc5f567fe" +"checksum serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)" = "bb47a3d5c84320222f66d7db21157c4a7407755de41798f9b4c1c40593397b1a" +"checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" "checksum shellexpand 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de7a5b5a9142fd278a10e0209b021a1b85849352e6951f4f914735c976737564" -"checksum siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537" -"checksum skeptic 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c4474d6da9593171bcb086890fc344a3a12783cb24e5b141f8a5d0e43561f4b6" +"checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" "checksum stderrlog 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "61dc66b7ae72b65636dbf36326f9638fb3ba27871bb737a62e2c309b87d91b70" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" "checksum structopt 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d8e9ad6a11096cbecdcca0cc6aa403fdfdbaeda2fb3323a39c98e6a166a1e45a" "checksum structopt-derive 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4cbce8ccdc62166bd594c14396a3242bf94c337a51dbfa9be1076dd74b3db2af" "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" -"checksum syn 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2beff8ebc3658f07512a413866875adddd20f4fd47b2a4e6c9da65cd281baaea" +"checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741" +"checksum syn 0.15.6 (registry+https://github.com/rust-lang/crates.io-index)" = "854b08a640fc8f54728fb95321e3ec485b365a97fe47609797c671addd1dde69" "checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" -"checksum synstructure 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a761d12e6d8dcb4dcf952a7a89b475e3a9d69e4a69307e01a470977642914bd" +"checksum synstructure 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85bb9b7550d063ea184027c9b8c20ac167cd36d3e06b3a40bceb9d746dc1a7b7" "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" -"checksum tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "47776f63b85777d984a50ce49d6b9e58826b6a3766a449fc95bc66cd5663c15b" -"checksum term 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "f2077e54d38055cf1ca0fd7933a2e00cd3ec8f6fed352b2a377f06dcdaaf3281" +"checksum tempfile 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "55c1195ef8513f3273d55ff59fe5da6940287a0d7a98331254397f464833675b" +"checksum term 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5e6b677dd1e8214ea1ef4297f85dbcbed8e8cdddb561040cc998ca2551c37561" "checksum termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "adc4587ead41bf016f11af03e55a624c06568b5a19db4e90fde573d805074f83" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" "checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6" -"checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963" +"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" "checksum threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e2f0c90a5f3459330ac8bc0d2f879c693bb7a2f59689c1083fc4ef83834da865" "checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b" -"checksum tiny_http 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2f4d55c9a213880d1f0c89ded183f209c6e45b912ca6c7df6f93c163773572e1" +"checksum tiny_http 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a442681f9f72e440be192700eeb2861e4174b9983f16f4877c93a134cb5e5f63" "checksum treediff 3.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "654d26443bc9632b5e6fa042e1b197abc314760b25524372c5fd9f48a3b1c79f" +"checksum treeline 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" "checksum twoway 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" @@ -1521,20 +1445,15 @@ dependencies = [ "checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" "checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" -"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" -"checksum url 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)" = "cbaa8377a162d88e7d15db0cf110c8523453edcbc5bc66d2b6fffccffa34a068" "checksum url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2a321979c09843d272956e73700d12c4e7d3d92b2ee112b31548aef0d4efc5a6" -"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" -"checksum uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "78c590b5bd79ed10aad8fb75f078a59d8db445af6c743e55c4a53227fc01c13f" -"checksum vcpkg 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cbe533e138811704c0e3cbde65a818b35d3240409b4346256c5ede403e082474" +"checksum utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd70f467df6810094968e2fce0ee1bd0e87157aceb026a8c083bcf5e25b9efe4" +"checksum vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "def296d3eb3b12371b2c7d0e83bfe1403e4db2d7a0bba324a12b21c4ee13143d" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" -"checksum version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7716c242968ee87e5542f8021178248f267f295a5c4803beae8b8b7fd9bc6051" -"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -"checksum walkdir 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "63636bd0eb3d00ccb8b9036381b526efac53caf112b7783b730ab3f8e44da369" -"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "773ef9dcc5f24b7d850d0ff101e542ff24c3b090a9768e03ff889fdef41f00fd" -"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" +"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" +"checksum walkdir 2.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "af464bc7be7b785c7ac72e266a6b67c4c9070155606f51655a650a6686204e35" +"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "afc5508759c5bf4285e61feb862b6083c8480aec864fa17a81fdec6f69b461ab" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" "checksum wincolor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb06499a3a4d44302791052df005d5232b927ed1a9658146d842165c4de7767" "checksum zip 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "36b9e08fb518a65cf7e08a1e482573eb87a2f4f8c6619316612a3c1f162fe822" diff --git a/Cargo.toml b/Cargo.toml index 908c95f..11b338b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hogan" -version = "0.2.5" +version = "0.2.6" authors = ["Jonathan Morley "] [[bin]] @@ -11,7 +11,7 @@ doc = false [dependencies] failure = "0.1" git2 = "0.7" -handlebars = "0.32" +handlebars = "1" itertools = "0.7" json-patch = "0.2" log = "0.4" @@ -29,6 +29,7 @@ walkdir = "2" zip = "0.4" [dev-dependencies] -assert_cli = "0.5.4" -dir-diff = "0.3.1" +assert_cmd = "0.9" +dir-diff = "0.3" fs_extra = "1" +predicates = "0.9" diff --git a/src/config.rs b/src/config.rs index 2592b82..0aaf10f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,15 +1,88 @@ use failure::Error; use find_file_paths; +use git; use git2::Repository; use json_patch::merge; use regex::Regex; use serde_json::{self, Value}; use std::fs::File; use std::path::{Path, PathBuf}; +use std::str::{self, FromStr}; use tempfile::{self, TempDir}; use url::{ParseError, Url}; use walkdir::WalkDir; -use git; + +#[derive(Debug, PartialEq)] +pub enum ConfigUrl { + File { + path: PathBuf, + }, + Git { + url: Url, + branch: Option, + internal_path: PathBuf, + }, +} + +impl FromStr for ConfigUrl { + type Err = Error; + + fn from_str(s: &str) -> Result { + match Url::parse(&s) { + Ok(url) => { + if url.scheme() == "file" { + Ok(ConfigUrl::File { + path: PathBuf::from(s.trim_left_matches("file://")), + }) + } else { + let mut path_segments = url + .path_segments() + .ok_or_else(|| format_err!("Url cannot be a base"))? + .map(|segment| segment.to_owned()) + .collect::>(); + + match path_segments + .iter() + .position(|s| s.ends_with(".git")) + .map(|index| index + 1) + { + Some(git_index) => { + let mut git_url = url.clone(); + git_url.set_fragment(None); + + let internal_path = if git_index > path_segments.len() { + PathBuf::new() + } else { + let (base_segments, rest) = path_segments.split_at(git_index); + + git_url + .path_segments_mut() + .map_err(|_| format_err!("Url cannot be a base"))? + .clear() + .extend(base_segments); + + rest.iter().collect() + }; + + Ok(ConfigUrl::Git { + url: git_url, + branch: url.fragment().map(|f| f.to_owned()), + internal_path, + }) + } + None => bail!("Config Url not a file path, and not a .git URL"), + } + } + } + Err(ParseError::RelativeUrlWithoutBase) => if s.contains(".git") { + format!("ssh://{}", str::replace(s, ":", "/")) + } else { + format!("file://{}", s) + }.parse(), + Err(e) => Err(e.into()), + } + } +} pub enum ConfigDir { File { @@ -23,34 +96,34 @@ pub enum ConfigDir { } impl ConfigDir { - pub fn new(src: String, ssh_key_path: &Path) -> Result { - let config_dir = if src.contains(".git") { - let git_url = git::GitUrl::new(&src); - let temp_dir = tempfile::tempdir()?; - - let git_repo = git_url.clone(temp_dir.path(), Some(ssh_key_path))?; - - let directory = match git_repo.workdir() { - Some(workdir) => workdir.join(git_url.internal_path), - None => bail!("No working directory found for git repository"), - }; - - Ok(ConfigDir::Git { - git_repo, - temp_dir, - directory, - }) - } else { - match Url::parse(&src) { - Ok(url) => match url.scheme() { - "file" => ConfigDir::new(src.replacen("file://", "", 1), ssh_key_path), - scheme => bail!("URL scheme {} not yet supported", scheme), - }, - Err(ParseError::RelativeUrlWithoutBase) => Ok(ConfigDir::File { - directory: PathBuf::from(src), - }), - Err(e) => Err(e.into()), + pub fn new(url: ConfigUrl, ssh_key_path: &Path) -> Result { + let config_dir = match url { + ConfigUrl::Git { + url, + branch, + internal_path, + } => { + let temp_dir = tempfile::tempdir()?; + + let git_repo = git::clone( + url.as_str(), + branch.as_ref().map(|x| &**x), + temp_dir.path(), + Some(ssh_key_path), + )?; + + let directory = match git_repo.workdir() { + Some(workdir) => workdir.join(internal_path), + None => bail!("No working directory found for git repository"), + }; + + Ok(ConfigDir::Git { + git_repo, + temp_dir, + directory, + }) } + ConfigUrl::File { path } => Ok(ConfigDir::File { directory: path }), }; if let &Ok(ref config_dir) = &config_dir { @@ -109,8 +182,7 @@ impl ConfigDir { environment.config_data = config_data; environment - }) - .collect() + }).collect() } fn find_environments(&self, filter: Regex) -> Box> { @@ -186,6 +258,148 @@ struct EnvironmentType { mod tests { use super::*; use regex::RegexBuilder; + use std::path::Path; + + #[test] + fn test_github_url() { + assert_eq!( + "git@github.com:foo/bar.git".parse::().unwrap(), + ConfigUrl::Git { + url: Url::parse("ssh://git@github.com/foo/bar.git").unwrap(), + branch: None, + internal_path: PathBuf::from(""), + } + ); + + assert_eq!( + "git@github.com:foo/bar.git/internal/path#branch" + .parse::() + .unwrap(), + ConfigUrl::Git { + url: Url::parse("ssh://git@github.com/foo/bar.git").unwrap(), + branch: Some(String::from("branch")), + internal_path: PathBuf::from("internal/path"), + } + ); + + assert_eq!( + "https://github.com/foo/bar.git" + .parse::() + .unwrap(), + ConfigUrl::Git { + url: Url::parse("https://github.com/foo/bar.git").unwrap(), + branch: None, + internal_path: PathBuf::from(""), + } + ); + + assert_eq!( + "https://github.com/foo/bar.git/internal/path#branch" + .parse::() + .unwrap(), + ConfigUrl::Git { + url: Url::parse("https://github.com/foo/bar.git").unwrap(), + branch: Some(String::from("branch")), + internal_path: PathBuf::from("internal/path"), + } + ); + } + + #[test] + fn test_bitbucket_git_url() { + assert_eq!( + "ssh://git@bitbucket.org/foo/bar.git" + .parse::() + .unwrap(), + ConfigUrl::Git { + url: Url::parse("ssh://git@bitbucket.org/foo/bar.git").unwrap(), + branch: None, + internal_path: PathBuf::from(""), + } + ); + + assert_eq!( + "ssh://git@bitbucket.org/foo/bar.git/internal/path#branch" + .parse::() + .unwrap(), + ConfigUrl::Git { + url: Url::parse("ssh://git@bitbucket.org/foo/bar.git").unwrap(), + branch: Some(String::from("branch")), + internal_path: PathBuf::from("internal/path"), + } + ); + + assert_eq!( + "https://username@bitbucket.org/scm/foo/bar.git" + .parse::() + .unwrap(), + ConfigUrl::Git { + url: Url::parse("https://username@bitbucket.org/scm/foo/bar.git").unwrap(), + branch: None, + internal_path: PathBuf::from(""), + } + ); + + assert_eq!( + "https://username@bitbucket.org/scm/foo/bar.git/internal/path#branch" + .parse::() + .unwrap(), + ConfigUrl::Git { + url: Url::parse("https://username@bitbucket.org/scm/foo/bar.git").unwrap(), + branch: Some(String::from("branch")), + internal_path: PathBuf::from("internal/path"), + } + ); + } + + #[test] + fn test_local_path() { + assert_eq!( + "foo/bar/baz".parse::().unwrap(), + ConfigUrl::File { + path: PathBuf::from("foo/bar/baz"), + } + ); + + assert_eq!( + "/foo/bar/baz".parse::().unwrap(), + ConfigUrl::File { + path: PathBuf::from("/foo/bar/baz"), + } + ); + + assert_eq!( + "foo/bar.git".parse::().unwrap(), + ConfigUrl::Git { + url: Url::parse("ssh://foo/bar.git").unwrap(), + branch: None, + internal_path: PathBuf::from("") + } + ); + + assert_eq!( + "foo/bar.git/baz".parse::().unwrap(), + ConfigUrl::Git { + url: Url::parse("ssh://foo/bar.git").unwrap(), + branch: None, + internal_path: PathBuf::from("baz") + } + ); + + assert_eq!( + "file://foo/bar/baz".parse::().unwrap(), + ConfigUrl::File { + path: PathBuf::from("foo/bar/baz"), + } + ); + + assert_eq!( + "file://foo/bar.git/baz".parse::().unwrap(), + ConfigUrl::File { + path: PathBuf::from("foo/bar.git/baz"), + } + ); + } #[test] fn test_basic_triple_merge() { @@ -223,7 +437,7 @@ mod tests { #[test] fn test_find_all_configs() { let config_dir = ConfigDir::new( - String::from("file://./tests/fixtures/configs"), + "file://./tests/fixtures/configs".parse().unwrap(), Path::new(""), ).unwrap(); let environments = config_dir.find( @@ -238,7 +452,7 @@ mod tests { #[test] fn test_find_subset_configs() { let config_dir = ConfigDir::new( - String::from("file://./tests/fixtures/configs"), + "file://./tests/fixtures/configs".parse().unwrap(), Path::new(""), ).unwrap(); let environments = config_dir.find( diff --git a/src/git.rs b/src/git.rs index 992105c..0bdcb36 100644 --- a/src/git.rs +++ b/src/git.rs @@ -1,120 +1,32 @@ use failure::Error; -use git2::{Cred, FetchOptions, RemoteCallbacks, Repository}; use git2::build::RepoBuilder; -use std::path::{Path, PathBuf}; - -#[derive(Debug, PartialEq)] -pub struct GitUrl { - // Cannot use real URLs here because of https://github.com/servo/rust-url/issues/220 - pub url: String, - pub branch: Option, - pub internal_path: PathBuf, -} - -impl GitUrl { - pub fn new(url: &str) -> GitUrl { - let (base_url, rest) = { - let split_by_git = url.splitn(2, ".git").collect::>(); - if split_by_git.len() == 2 { - (format!("{}.git", split_by_git[0]), split_by_git[1]) - } else { - (String::from(url), "") - } - }; - - let (mut path, branch) = { - let split_by_hash = rest.splitn(2, "#").collect::>(); - if split_by_hash.len() == 2 { - (split_by_hash[0], Some(String::from(split_by_hash[1]))) - } else { - (rest, None) - } - }; - - if path.starts_with("/") { - path = &path[1..]; - } - - GitUrl { - url: base_url, - branch, - internal_path: PathBuf::from(path), - } - } - - pub fn clone(&self, path: &Path, ssh_key_path: Option<&Path>) -> Result { - let mut callbacks = RemoteCallbacks::new(); - if let Some(ssh_key_path) = ssh_key_path { - callbacks.credentials(move |_url, username_from_url, _allowed_types| { - Cred::ssh_key(username_from_url.unwrap(), None, ssh_key_path, None) - }); - } - - let mut fetch_options = FetchOptions::new(); - fetch_options.remote_callbacks(callbacks); - - let mut repo_builder = RepoBuilder::new(); - repo_builder.fetch_options(fetch_options); - - if let Some(ref branch) = self.branch { - debug!("Setting branch to {}", branch); - repo_builder.branch(branch); - } - - info!("Cloning to {:?}", path); - repo_builder.clone(&self.url, path).map_err(|e| e.into()) +use git2::{Cred, FetchOptions, RemoteCallbacks, Repository}; +use std::path::Path; + +pub fn clone( + url: &str, + branch: Option<&str>, + path: &Path, + ssh_key_path: Option<&Path>, +) -> Result { + let mut callbacks = RemoteCallbacks::new(); + if let Some(ssh_key_path) = ssh_key_path { + callbacks.credentials(move |_url, username_from_url, _allowed_types| { + Cred::ssh_key(username_from_url.unwrap(), None, ssh_key_path, None) + }); } -} -#[cfg(test)] -mod tests { - use super::*; + let mut fetch_options = FetchOptions::new(); + fetch_options.remote_callbacks(callbacks); - #[test] - fn test_ssh_github_url() { - assert_eq!( - GitUrl::new("git@github.com:cvent/hogan.git"), - GitUrl { - url: String::from("git@github.com:cvent/hogan.git"), - branch: None, - internal_path: PathBuf::from(""), - } - ); - } - - #[test] - fn test_ssh_github_url_with_extras() { - assert_eq!( - GitUrl::new("git@github.com:cvent/hogan.git/internal/path#branch"), - GitUrl { - url: String::from("git@github.com:cvent/hogan.git"), - branch: Some(String::from("branch")), - internal_path: PathBuf::from("internal/path"), - } - ); - } + let mut repo_builder = RepoBuilder::new(); + repo_builder.fetch_options(fetch_options); - #[test] - fn test_https_github_url() { - assert_eq!( - GitUrl::new("https://github.com/cvent/hogan.git"), - GitUrl { - url: String::from("https://github.com/cvent/hogan.git"), - branch: None, - internal_path: PathBuf::from(""), - } - ); + if let Some(branch) = branch { + debug!("Setting branch to {}", branch); + repo_builder.branch(branch); } - #[test] - fn test_https_github_url_with_extras() { - assert_eq!( - GitUrl::new("https://github.com/cvent/hogan.git/internal/path#branch"), - GitUrl { - url: String::from("https://github.com/cvent/hogan.git"), - branch: Some(String::from("branch")), - internal_path: PathBuf::from("internal/path"), - } - ); - } + info!("Cloning to {:?}", path); + repo_builder.clone(&url, path).map_err(|e| e.into()) } diff --git a/src/main.rs b/src/main.rs index 04adeca..198d932 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,6 +15,7 @@ extern crate structopt; use failure::Error; use hogan::config::ConfigDir; +use hogan::config::ConfigUrl; use hogan::template::{Template, TemplateDir}; use regex::{Regex, RegexBuilder}; use rouille::input::plain_text_body; @@ -105,7 +106,7 @@ struct AppCommon { /// Config source. Accepts file and git URLs. Paths within a git repository may be appended /// to a git URL, and branches may be specified as a URL fragment (recursive if applicable) #[structopt(short = "c", long = "configs", value_name = "URL")] - configs_url: String, + configs_url: ConfigUrl, /// SSH key to use if configs URL requires authentication #[structopt( @@ -271,14 +272,17 @@ fn main() -> Result<(), Error> { #[cfg(test)] mod tests { - extern crate assert_cli; + extern crate assert_cmd; extern crate dir_diff; extern crate fs_extra; + extern crate predicates; extern crate tempfile; + use self::assert_cmd::prelude::*; use self::fs_extra::dir; - + use self::predicates::prelude::*; use std::path::Path; + use std::process::Command; #[cfg(not(all(target_env = "msvc", target_arch = "x86_64")))] #[test] @@ -293,35 +297,46 @@ mod tests { let templates_path = temp_dir.path().join("templates"); - assert_cli::Assert::main_binary() - .with_args(&[ - "transform", - "--configs", - "tests/fixtures/configs", - "--templates", - templates_path.to_str().unwrap(), - ]) - .stdout() - .contains(format!(r#"Finding Files: {:?}"#, templates_path)) - .stdout() - .contains(r"regex: /template([-.].+)?\.(config|ya?ml|properties)/") - .stdout() - .contains("Loaded 3 template file(s)") - .stdout() - .contains(r#"Finding Files: "tests/fixtures/configs""#) - .stdout() - .contains(r#"regex: /config\..+\.json$/"#) - .stdout() - .contains("Loaded 4 config file(s)") - .stdout() - .contains("Updating templates for EMPTY") - .stdout() - .contains("Updating templates for ENVTYPE") - .stdout() - .contains("Updating templates for TEST") - .stdout() - .contains("Updating templates for TEST2") - .unwrap(); + let mut cmd = Command::main_binary().unwrap(); + + let cmd = cmd.args(&[ + "transform", + "--configs", + "tests/fixtures/configs", + "--templates", + templates_path.to_str().unwrap(), + ]); + + cmd.assert().success(); + + cmd.assert().stdout( + predicate::str::contains(format!(r#"Finding Files: {:?}"#, templates_path)).from_utf8(), + ); + + cmd.assert().stdout( + predicate::str::contains(r"regex: /template([-.].+)?\.(config|ya?ml|properties)/") + .from_utf8(), + ); + + cmd.assert() + .stdout(predicate::str::contains("Loaded 3 template file(s)").from_utf8()); + + cmd.assert().stdout( + predicate::str::contains(r#"Finding Files: "tests/fixtures/configs""#).from_utf8(), + ); + + cmd.assert() + .stdout(predicate::str::contains(r#"regex: /config\..+\.json$/"#).from_utf8()); + + cmd.assert() + .stdout(predicate::str::contains("Loaded 4 config file(s)").from_utf8()); + + for environment in ["EMPTY", "ENVTYPE", "TEST", "TEST2"].iter() { + cmd.assert().stdout( + predicate::str::contains(format!("Updating templates for {}", environment)) + .from_utf8(), + ); + } assert!( !dir_diff::is_different( diff --git a/src/transform/helper_comma_delimited_list.rs b/src/transform/helper_comma_delimited_list.rs new file mode 100644 index 0000000..aa8a574 --- /dev/null +++ b/src/transform/helper_comma_delimited_list.rs @@ -0,0 +1,80 @@ +use handlebars::*; +use itertools::join; +use serde_json::value::Value as Json; +use std::collections::BTreeMap; + +#[derive(Clone, Copy)] +pub struct CommaDelimitedListHelper; + +impl HelperDef for CommaDelimitedListHelper { + // Change an array of items into a comma seperated list with formatting + // Usage: {{#comma-list array}}{{elementAttribute}}:{{attribute2}}{{/comma-list}} + fn call<'reg: 'rc, 'rc>( + &self, + h: &Helper<'reg, 'rc>, + r: &'reg Handlebars, + ctx: &Context, + rc: &mut RenderContext<'reg>, + out: &mut Output, + ) -> HelperResult { + let value = h + .param(0) + .ok_or_else(|| RenderError::new("Param not found for helper \"comma-list\""))?; + + match h.template() { + Some(template) => match *value.value() { + Json::Array(ref list) => { + let len = list.len(); + + let mut render_list = Vec::new(); + + for i in 0..len { + let mut local_rc = rc.derive(); + + if let Some(inner_path) = value.path() { + let new_path = + format!("{}/{}/[{}]", local_rc.get_path(), inner_path, i); + local_rc.set_path(new_path.clone()); + } + + if let Some(block_param) = h.block_param() { + let mut map = BTreeMap::new(); + map.insert(block_param.to_string(), to_json(&list[i])); + local_rc.push_block_context(&map)?; + } + + render_list.push(template.renders(r, ctx, &mut local_rc)?); + } + + out.write(&join(&render_list, ","))?; + + Ok(()) + } + Json::Null => Ok(()), + _ => Err(RenderError::new(format!( + "Param type is not array for helper \"comma-list\": {:?}", + value + ))), + }, + None => Ok(()), + } + } +} + +#[cfg(test)] +mod test { + use super::*; + use transform::test::test_against_configs; + + #[test] + fn test_comma_list() { + let mut handlebars = Handlebars::new(); + handlebars.register_helper("comma-list", Box::new(CommaDelimitedListHelper)); + + test_against_configs( + &handlebars, + "{{#comma-list Memcache.Servers}}{{Endpoint}}:{{Port}}{{/comma-list}}", + "192.168.1.100:1122,192.168.1.101:1122,192.168.1.102:1122", + ); + } +} diff --git a/src/transform/helper_equal.rs b/src/transform/helper_equal.rs new file mode 100644 index 0000000..45c3e42 --- /dev/null +++ b/src/transform/helper_equal.rs @@ -0,0 +1,76 @@ +use handlebars::*; + +#[derive(Clone, Copy)] +pub struct EqualHelper; + +impl HelperDef for EqualHelper { + fn call<'reg: 'rc, 'rc>( + &self, + h: &Helper<'reg, 'rc>, + r: &'reg Handlebars, + ctx: &Context, + rc: &mut RenderContext<'reg>, + out: &mut Output, + ) -> HelperResult { + let lvalue = h + .param(0) + .ok_or_else(|| RenderError::new("Left param not found for helper \"equal\""))? + .value(); + let rvalue = h + .param(1) + .ok_or_else(|| RenderError::new("Right param not found for helper \"equal\""))? + .value(); + + let comparison = lvalue == rvalue; + + if h.is_block() { + let template = if comparison { + h.template() + } else { + h.inverse() + }; + + match template { + Some(ref t) => t.render(r, ctx, rc, out), + None => Ok(()), + } + } else { + if comparison { + out.write(&comparison.to_string())?; + } + + Ok(()) + } + } +} + +#[cfg(test)] +mod test { + use super::*; + use transform::test::test_against_configs; + + #[test] + fn test_equal() { + let mut handlebars = Handlebars::new(); + handlebars.register_helper("equal", Box::new(EqualHelper)); + handlebars.register_helper("eq", Box::new(EqualHelper)); + + let templates = vec![ + (r#"{{#equal Region.Key "TEST"}}Foo{{/equal}}"#, "Foo"), + (r#"{{#equal Region.Key null}}{{else}}Bar{{/equal}}"#, "Bar"), + (r#"{{#eq Region.Key "TEST"}}Foo{{/eq}}"#, "Foo"), + (r#"{{#eq Region.Key null}}{{else}}Bar{{/eq}}"#, "Bar"), + (r#"{{#if (equal Region.Key "TEST")}}Foo{{/if}}"#, "Foo"), + ( + r#"{{#if (equal Region.Key null)}}{{else}}Bar{{/if}}"#, + "Bar", + ), + (r#"{{#if (eq Region.Key "TEST")}}Foo{{/if}}"#, "Foo"), + (r#"{{#if (eq Region.Key null)}}{{else}}Bar{{/if}}"#, "Bar"), + ]; + + for (template, expected) in templates { + test_against_configs(&handlebars, template, expected) + } + } +} diff --git a/src/transform/helper_lowercase.rs b/src/transform/helper_lowercase.rs new file mode 100644 index 0000000..84dbc1a --- /dev/null +++ b/src/transform/helper_lowercase.rs @@ -0,0 +1,47 @@ +use handlebars::*; +use serde_json::value::Value as Json; + +#[derive(Clone, Copy)] +pub struct LowercaseHelper; + +impl HelperDef for LowercaseHelper { + fn call<'reg: 'rc, 'rc>( + &self, + h: &Helper<'reg, 'rc>, + _: &'reg Handlebars, + _: &Context, + _: &mut RenderContext<'reg>, + out: &mut Output, + ) -> HelperResult { + let value = h + .param(0) + .ok_or_else(|| RenderError::new("Param not found for helper \"lowercase\""))?; + + match *value.value() { + Json::String(ref s) => { + out.write(&s.to_lowercase())?; + Ok(()) + } + Json::Null => Ok(()), + _ => Err(RenderError::new(format!( + "Param type is not string for helper \"lowercase\": {:?}", + value + ))), + } + } +} + +#[cfg(test)] +mod test { + use super::*; + use transform::test::test_against_configs; + + #[test] + fn test_lowercase() { + let mut handlebars = Handlebars::new(); + handlebars.register_helper("lowercase", Box::new(LowercaseHelper)); + + test_against_configs(&handlebars, "{{lowercase UpperCaseString}}", "uppercase"); + } + +} diff --git a/src/transform/helper_or.rs b/src/transform/helper_or.rs new file mode 100644 index 0000000..de54457 --- /dev/null +++ b/src/transform/helper_or.rs @@ -0,0 +1,83 @@ +use handlebars::*; + +#[derive(Clone, Copy)] +pub struct OrHelper; + +impl HelperDef for OrHelper { + fn call<'reg: 'rc, 'rc>( + &self, + h: &Helper<'reg, 'rc>, + r: &'reg Handlebars, + ctx: &Context, + rc: &mut RenderContext<'reg>, + out: &mut Output, + ) -> HelperResult { + let lvalue = h + .param(0) + .ok_or_else(|| RenderError::new("Left param not found for helper \"or\""))? + .value(); + let rvalue = h + .param(1) + .ok_or_else(|| RenderError::new("Right param not found for helper \"or\""))? + .value(); + + let comparison = lvalue.as_str().map_or(false, |v| v.len() > 0) + || rvalue.as_str().map_or(false, |v| v.len() > 0); + + if h.is_block() { + let template = if comparison { + h.template() + } else { + h.inverse() + }; + + match template { + Some(ref t) => t.render(r, ctx, rc, out), + None => Ok(()), + } + } else { + if comparison { + out.write(&comparison.to_string())?; + } + + Ok(()) + } + } +} + +#[cfg(test)] +mod test { + use super::*; + use transform::helper_equal::EqualHelper; + use transform::test::test_against_configs; + + #[test] + fn test_or() { + let mut handlebars = Handlebars::new(); + handlebars.register_helper("eq", Box::new(EqualHelper)); + handlebars.register_helper("or", Box::new(OrHelper)); + + let templates = vec![ + ( + r#"{{#or (eq Region.Key "TEST") (eq Region.Key "TEST2")}}Foo{{/or}}"#, + "Foo", + ), + ( + r#"{{#or (eq Region.Key null) (eq Region.Key "NO")}}{{else}}Bar{{/or}}"#, + "Bar", + ), + ( + r#"{{#if (or (eq Region.Key "TEST") (eq Region.Key "TEST2"))}}Foo{{/if}}"#, + "Foo", + ), + ( + r#"{{#if (or (eq Region.Key null) (eq Region.Key "NO"))}}{{else}}Bar{{/if}}"#, + "Bar", + ), + ]; + + for (template, expected) in templates { + test_against_configs(&handlebars, template, expected) + } + } +} diff --git a/src/transform/helper_url_add_slash.rs b/src/transform/helper_url_add_slash.rs new file mode 100644 index 0000000..6b5090e --- /dev/null +++ b/src/transform/helper_url_add_slash.rs @@ -0,0 +1,68 @@ +use handlebars::*; +use serde_json::value::Value as Json; +use url::Url; + +#[derive(Clone, Copy)] +pub struct UrlAddSlashHelper; + +impl HelperDef for UrlAddSlashHelper { + // Adds the trailing slashes on an endpoint + fn call<'reg: 'rc, 'rc>( + &self, + h: &Helper<'reg, 'rc>, + _: &'reg Handlebars, + _: &Context, + _: &mut RenderContext<'reg>, + out: &mut Output, + ) -> HelperResult { + let value = h + .param(0) + .ok_or_else(|| RenderError::new("Param not found for helper \"url-add-slash\""))?; + + match *value.value() { + Json::String(ref s) => { + let output = if Url::parse(s).is_ok() && !s.ends_with("/") { + format!("{}/", s) + } else { + s.clone() + }; + + out.write(&output)?; + + Ok(()) + } + Json::Null => Ok(()), + _ => Err(RenderError::new(format!( + "Param type is not string for helper \"url-add-slash\": {:?}", + value, + ))), + } + } +} + +#[cfg(test)] +mod test { + use super::*; + use transform::test::test_against_configs; + + #[test] + fn test_url_add_slash() { + let mut handlebars = Handlebars::new(); + handlebars.register_helper("url-add-slash", Box::new(UrlAddSlashHelper)); + + let templates = vec![ + ( + "{{url-add-slash NonSlashService.endpoint}}", + "https://nonslash.com/", + ), + ( + "{{url-add-slash NonSlashService.notAnEndpoint}}", + "no-protocol.no-slash.com", + ), + ]; + + for (template, expected) in templates { + test_against_configs(&handlebars, template, expected) + } + } +} diff --git a/src/transform/helper_url_rm_path.rs b/src/transform/helper_url_rm_path.rs new file mode 100644 index 0000000..3d811ef --- /dev/null +++ b/src/transform/helper_url_rm_path.rs @@ -0,0 +1,97 @@ +use handlebars::*; +use serde_json::value::Value as Json; +use url::Url; + +#[derive(Clone, Copy)] +pub struct UrlRmPathHelper; + +impl HelperDef for UrlRmPathHelper { + // Removes the last slash plus content to the end of the string + fn call<'reg: 'rc, 'rc>( + &self, + h: &Helper<'reg, 'rc>, + _: &'reg Handlebars, + _: &Context, + _: &mut RenderContext<'reg>, + out: &mut Output, + ) -> HelperResult { + let value = h + .param(0) + .ok_or_else(|| RenderError::new("Param not found for helper \"url-rm-path\""))?; + + match *value.value() { + Json::String(ref s) => { + let url = if s.ends_with("/") { + &s[..s.len() - 1] + } else { + &s + }; + + match Url::parse(url) { + Ok(ref mut url) => { + if let Ok(ref mut paths) = url.path_segments_mut() { + paths.pop(); + } + + let mut url_str = url.as_str(); + if url_str.ends_with("/") { + url_str = &url_str[..url_str.len() - 1]; + } + + out.write(url_str)?; + + Ok(()) + } + _ => { + out.write(s)?; + Ok(()) + } + } + } + Json::Null => Ok(()), + _ => Err(RenderError::new(format!( + "Param type is not string for helper \"url-rm-path\": {:?}", + value + ))), + } + } +} + +#[cfg(test)] +mod test { + use super::*; + use transform::test::test_against_configs; + + #[test] + fn test_url_rm_path() { + let mut handlebars = Handlebars::new(); + handlebars.register_helper("url-rm-path", Box::new(UrlRmPathHelper)); + + let templates = vec![ + ( + "{{url-rm-path PathService.endpoint}}", + "https://path.com/path", + ), + ( + "{{url-rm-path PathService.trailingSlash}}", + "https://trailing-path.com/path", + ), + ]; + + for (template, expected) in templates { + test_against_configs(&handlebars, template, expected) + } + } + + #[test] + fn test_double_url_rm_path() { + let mut handlebars = Handlebars::new(); + handlebars.register_helper("url-rm-path", Box::new(UrlRmPathHelper)); + + test_against_configs( + &handlebars, + "{{url-rm-path (url-rm-path PathService.trailingSlash)}}", + "https://trailing-path.com", + ); + } +} diff --git a/src/transform/helper_url_rm_slash.rs b/src/transform/helper_url_rm_slash.rs new file mode 100644 index 0000000..f8d2819 --- /dev/null +++ b/src/transform/helper_url_rm_slash.rs @@ -0,0 +1,56 @@ +use handlebars::*; +use serde_json::value::Value as Json; + +#[derive(Clone, Copy)] +pub struct UrlRmSlashHelper; + +impl HelperDef for UrlRmSlashHelper { + // Removes the trailing slash on an endpoint + fn call<'reg: 'rc, 'rc>( + &self, + h: &Helper<'reg, 'rc>, + _: &'reg Handlebars, + _: &Context, + _: &mut RenderContext<'reg>, + out: &mut Output, + ) -> HelperResult { + let value = h + .param(0) + .ok_or_else(|| RenderError::new("Param not found for helper \"url-rm-slash\""))?; + + match *value.value() { + Json::String(ref s) => { + if s.ends_with("/") { + out.write(&s[..s.len() - 1])?; + } else { + out.write(s)?; + } + + Ok(()) + } + Json::Null => Ok(()), + _ => Err(RenderError::new(format!( + "Param type is not string for helper \"url-rm-slash\": {:?}", + value, + ))), + } + } +} + +#[cfg(test)] +mod test { + use super::*; + use transform::test::test_against_configs; + + #[test] + fn test_url_rm_slash() { + let mut handlebars = Handlebars::new(); + handlebars.register_helper("url-rm-slash", Box::new(UrlRmSlashHelper)); + + test_against_configs( + &handlebars, + "{{url-rm-slash SlashService.endpoint}}", + "https://slash.com", + ); + } +} diff --git a/src/transform/helper_yaml_string.rs b/src/transform/helper_yaml_string.rs new file mode 100644 index 0000000..9547ffd --- /dev/null +++ b/src/transform/helper_yaml_string.rs @@ -0,0 +1,62 @@ +use handlebars::*; +use serde_json; +use serde_json::value::Value as Json; + +#[derive(Clone, Copy)] +pub struct YamlStringHelper; + +impl HelperDef for YamlStringHelper { + // Escapes strings to that they can be safely used inside yaml (And JSON for that matter). + fn call<'reg: 'rc, 'rc>( + &self, + h: &Helper<'reg, 'rc>, + _: &'reg Handlebars, + _: &Context, + _: &mut RenderContext<'reg>, + out: &mut Output, + ) -> HelperResult { + let value = h + .param(0) + .ok_or_else(|| RenderError::new("Param not found for helper \"yaml-string\""))?; + + match *value.value() { + ref s @ Json::String(_) => { + let mut stringified = serde_json::to_string(&s).unwrap(); + if stringified.starts_with('"') { + stringified.remove(0); + } + + if stringified.ends_with('"') { + stringified.pop(); + } + + out.write(&stringified)?; + + Ok(()) + } + Json::Null => Ok(()), + _ => Err(RenderError::new(format!( + "Param type is not string for helper \"yaml-string\": {:?}", + value, + ))), + } + } +} + +#[cfg(test)] +mod test { + use super::*; + use transform::test::test_against_configs; + + #[test] + fn test_yaml_string() { + let mut handlebars = Handlebars::new(); + handlebars.register_helper("yaml-string", Box::new(YamlStringHelper)); + + test_against_configs( + &handlebars, + "{{yaml-string DB.Endpoint}}", + r#"host-name\\TEST\""#, + ); + } +} diff --git a/src/transform/helpers.rs b/src/transform/helpers.rs deleted file mode 100644 index 877813a..0000000 --- a/src/transform/helpers.rs +++ /dev/null @@ -1,443 +0,0 @@ -use handlebars::*; -use itertools::join; -use std::collections::BTreeMap; -use serde_json::value::Value as Json; -use serde_json; -use url::Url; - -// Change an array of items into a comma seperated list with formatting -// Usage: {{#comma-list array}}{{elementAttribute}}:{{attribute2}}{{/comma-list}} -pub(crate) fn comma_delimited_list_helper( - h: &Helper, - r: &Handlebars, - rc: &mut RenderContext, -) -> HelperResult { - let value = h.param(0) - .ok_or_else(|| RenderError::new("Param not found for helper \"comma-list\""))?; - - match h.template() { - Some(template) => match *value.value() { - Json::Array(ref list) => { - let len = list.len(); - - let mut render_list = Vec::new(); - - for i in 0..len { - let mut local_rc = rc.derive(); - - if let Some(inner_path) = value.path() { - let new_path = format!("{}/{}/[{}]", local_rc.get_path(), inner_path, i); - local_rc.set_path(new_path.clone()); - } - - if let Some(block_param) = h.block_param() { - let mut map = BTreeMap::new(); - map.insert(block_param.to_string(), to_json(&list[i])); - local_rc.push_block_context(&map)?; - } - - render_list.push(template.renders(r, &mut local_rc)?); - } - - rc.writer.write_all(&join(&render_list, ",").into_bytes())?; - - Ok(()) - } - Json::Null => Ok(()), - _ => Err(RenderError::new(format!( - "Param type is not array for helper \"comma-list\": {:?}", - value - ))), - }, - None => Ok(()), - } -} - -pub(crate) fn equal_helper(h: &Helper, r: &Handlebars, rc: &mut RenderContext) -> HelperResult { - let lvalue = h.param(0) - .ok_or_else(|| RenderError::new("Left param not found for helper \"equal\""))? - .value(); - let rvalue = h.param(1) - .ok_or_else(|| RenderError::new("Right param not found for helper \"equal\""))? - .value(); - - let comparison = lvalue == rvalue; - - if h.is_block() { - let template = if comparison { - h.template() - } else { - h.inverse() - }; - - match template { - Some(ref t) => t.render(r, rc), - None => Ok(()), - } - } else { - if comparison { - rc.writer.write(comparison.to_string().as_bytes())?; - } - - Ok(()) - } -} - -pub(crate) fn or_helper(h: &Helper, r: &Handlebars, rc: &mut RenderContext) -> HelperResult { - let lvalue = h.param(0) - .ok_or_else(|| RenderError::new("Left param not found for helper \"or\""))? - .value(); - let rvalue = h.param(1) - .ok_or_else(|| RenderError::new("Right param not found for helper \"or\""))? - .value(); - - let comparison = lvalue.as_str().map_or(false, |v| v.len() > 0) - || rvalue.as_str().map_or(false, |v| v.len() > 0); - - if h.is_block() { - let template = if comparison { - h.template() - } else { - h.inverse() - }; - - match template { - Some(ref t) => t.render(r, rc), - None => Ok(()), - } - } else { - if comparison { - rc.writer.write(comparison.to_string().as_bytes())?; - } - - Ok(()) - } -} - -// Escapes strings to that they can be safely used inside yaml (And JSON for that matter). -pub(crate) fn yaml_string_helper( - h: &Helper, - _: &Handlebars, - rc: &mut RenderContext, -) -> HelperResult { - let value = h.param(0) - .ok_or_else(|| RenderError::new("Param not found for helper \"yaml-string\""))?; - - match *value.value() { - ref s @ Json::String(_) => { - let mut stringified = serde_json::to_string(&s).unwrap(); - if stringified.starts_with('"') { - stringified.remove(0); - } - - if stringified.ends_with('"') { - stringified.pop(); - } - - rc.writer.write(stringified.as_bytes())?; - - Ok(()) - } - Json::Null => Ok(()), - _ => Err(RenderError::new(format!( - "Param type is not string for helper \"yaml-string\": {:?}", - value, - ))), - } -} - -// Removes the trailing slash on an endpoint -pub(crate) fn url_rm_slash_helper( - h: &Helper, - _: &Handlebars, - rc: &mut RenderContext, -) -> HelperResult { - let value = h.param(0) - .ok_or_else(|| RenderError::new("Param not found for helper \"url-rm-slash\""))?; - - match *value.value() { - Json::String(ref s) => { - if s.ends_with("/") { - rc.writer.write(s[..s.len() - 1].as_bytes())?; - } else { - rc.writer.write(s.as_bytes())?; - } - - Ok(()) - } - Json::Null => Ok(()), - _ => Err(RenderError::new(format!( - "Param type is not string for helper \"url-rm-slash\": {:?}", - value, - ))), - } -} - -// Adds the trailing slashes on an endpoint -pub(crate) fn url_add_slash_helper( - h: &Helper, - _: &Handlebars, - rc: &mut RenderContext, -) -> HelperResult { - let value = h.param(0) - .ok_or_else(|| RenderError::new("Param not found for helper \"url-add-slash\""))?; - - match *value.value() { - Json::String(ref s) => { - let output = if Url::parse(s).is_ok() && !s.ends_with("/") { - format!("{}/", s) - } else { - s.clone() - }; - - rc.writer.write(output.as_bytes())?; - - Ok(()) - } - Json::Null => Ok(()), - _ => Err(RenderError::new(format!( - "Param type is not string for helper \"url-add-slash\": {:?}", - value, - ))), - } -} - -// Removes the last slash plus content to the end of the string -pub(crate) fn url_rm_path(h: &Helper, _: &Handlebars, rc: &mut RenderContext) -> HelperResult { - let value = h.param(0) - .ok_or_else(|| RenderError::new("Param not found for helper \"url-rm-path\""))?; - - match *value.value() { - Json::String(ref s) => { - let url = if s.ends_with("/") { - &s[..s.len() - 1] - } else { - &s - }; - - match Url::parse(url) { - Ok(ref mut url) => { - if let Ok(ref mut paths) = url.path_segments_mut() { - paths.pop(); - } - - let mut url_str = url.as_str(); - if url_str.ends_with("/") { - url_str = &url_str[..url_str.len() - 1]; - } - - rc.writer.write(url_str.as_bytes())?; - - Ok(()) - } - _ => { - rc.writer.write(s.as_bytes())?; - Ok(()) - } - } - } - Json::Null => Ok(()), - _ => Err(RenderError::new(format!( - "Param type is not string for helper \"url-rm-path\": {:?}", - value - ))), - } -} - -pub(crate) fn lowercase_string_helper( - h: &Helper, - _: &Handlebars, - rc: &mut RenderContext, -) -> HelperResult { - let value = h.param(0) - .ok_or_else(|| RenderError::new("Param not found for helper \"lowercase\""))?; - - match *value.value() { - Json::String(ref s) => { - rc.writer.write(s.to_lowercase().as_bytes())?; - Ok(()) - } - Json::Null => Ok(()), - _ => Err(RenderError::new(format!( - "Param type is not string for helper \"lowercase\": {:?}", - value - ))), - } -} - -#[cfg(test)] -mod test { - use super::*; - use serde_json::{self, Value}; - - fn config_fixture() -> Value { - let mut config: Value = serde_json::from_str(&include_str!( - "../../tests/fixtures/configs/config.TEST.json" - )).unwrap(); - config["ConfigData"].take() - } - - fn test_against_configs(handlebars: &Handlebars, template: &str, expected: &str) { - let config_rendered = handlebars.render_template(template, &config_fixture()); - assert!(config_rendered.is_ok()); - assert_eq!(&config_rendered.unwrap(), expected); - - let null_rendered = handlebars.render_template(template, &Json::Null); - assert!(null_rendered.is_ok()); - assert_eq!(&null_rendered.unwrap(), ""); - } - - #[test] - fn test_comma_list() { - let mut handlebars = Handlebars::new(); - handlebars.register_helper("comma-list", Box::new(comma_delimited_list_helper)); - - test_against_configs( - &handlebars, - "{{#comma-list Memcache.Servers}}{{Endpoint}}:{{Port}}{{/comma-list}}", - "192.168.1.100:1122,192.168.1.101:1122,192.168.1.102:1122", - ); - } - - #[test] - fn test_equal() { - let mut handlebars = Handlebars::new(); - handlebars.register_helper("equal", Box::new(equal_helper)); - handlebars.register_helper("eq", Box::new(equal_helper)); - - let templates = vec![ - (r#"{{#equal Region.Key "TEST"}}Foo{{/equal}}"#, "Foo"), - (r#"{{#equal Region.Key null}}{{else}}Bar{{/equal}}"#, "Bar"), - (r#"{{#eq Region.Key "TEST"}}Foo{{/eq}}"#, "Foo"), - (r#"{{#eq Region.Key null}}{{else}}Bar{{/eq}}"#, "Bar"), - (r#"{{#if (equal Region.Key "TEST")}}Foo{{/if}}"#, "Foo"), - ( - r#"{{#if (equal Region.Key null)}}{{else}}Bar{{/if}}"#, - "Bar", - ), - (r#"{{#if (eq Region.Key "TEST")}}Foo{{/if}}"#, "Foo"), - (r#"{{#if (eq Region.Key null)}}{{else}}Bar{{/if}}"#, "Bar"), - ]; - - for (template, expected) in templates { - test_against_configs(&handlebars, template, expected) - } - } - - #[test] - fn test_or() { - let mut handlebars = Handlebars::new(); - handlebars.register_helper("eq", Box::new(equal_helper)); - handlebars.register_helper("or", Box::new(or_helper)); - - let templates = vec![ - ( - r#"{{#or (eq Region.Key "TEST") (eq Region.Key "TEST2")}}Foo{{/or}}"#, - "Foo", - ), - ( - r#"{{#or (eq Region.Key null) (eq Region.Key "NO")}}{{else}}Bar{{/or}}"#, - "Bar", - ), - ( - r#"{{#if (or (eq Region.Key "TEST") (eq Region.Key "TEST2"))}}Foo{{/if}}"#, - "Foo", - ), - ( - r#"{{#if (or (eq Region.Key null) (eq Region.Key "NO"))}}{{else}}Bar{{/if}}"#, - "Bar", - ), - ]; - - for (template, expected) in templates { - test_against_configs(&handlebars, template, expected) - } - } - - #[test] - fn test_yaml_string() { - let mut handlebars = Handlebars::new(); - handlebars.register_helper("yaml-string", Box::new(yaml_string_helper)); - - test_against_configs( - &handlebars, - "{{yaml-string DB.Endpoint}}", - r#"host-name\\TEST\""#, - ); - } - - #[test] - fn test_url_rm_slash() { - let mut handlebars = Handlebars::new(); - handlebars.register_helper("url-rm-slash", Box::new(url_rm_slash_helper)); - - test_against_configs( - &handlebars, - "{{url-rm-slash SlashService.endpoint}}", - "https://slash.com", - ); - } - - #[test] - fn test_url_add_slash() { - let mut handlebars = Handlebars::new(); - handlebars.register_helper("url-add-slash", Box::new(url_add_slash_helper)); - - let templates = vec![ - ( - "{{url-add-slash NonSlashService.endpoint}}", - "https://nonslash.com/", - ), - ( - "{{url-add-slash NonSlashService.notAnEndpoint}}", - "no-protocol.no-slash.com", - ), - ]; - - for (template, expected) in templates { - test_against_configs(&handlebars, template, expected) - } - } - - #[test] - fn test_url_rm_path() { - let mut handlebars = Handlebars::new(); - handlebars.register_helper("url-rm-path", Box::new(url_rm_path)); - - let templates = vec![ - ( - "{{url-rm-path PathService.endpoint}}", - "https://path.com/path", - ), - ( - "{{url-rm-path PathService.trailingSlash}}", - "https://trailing-path.com/path", - ), - ]; - - for (template, expected) in templates { - test_against_configs(&handlebars, template, expected) - } - } - - #[test] - fn test_double_url_rm_path() { - let mut handlebars = Handlebars::new(); - handlebars.register_helper("url-rm-path", Box::new(url_rm_path)); - - test_against_configs( - &handlebars, - "{{url-rm-path (url-rm-path PathService.trailingSlash)}}", - "https://trailing-path.com", - ); - } - - #[test] - fn test_lowercase() { - let mut handlebars = Handlebars::new(); - handlebars.register_helper("lowercase", Box::new(lowercase_string_helper)); - - test_against_configs(&handlebars, "{{lowercase UpperCaseString}}", "uppercase"); - } - -} diff --git a/src/transform/mod.rs b/src/transform/mod.rs index 58a120d..9fed29d 100644 --- a/src/transform/mod.rs +++ b/src/transform/mod.rs @@ -1,19 +1,58 @@ use handlebars::Handlebars; -pub mod helpers; +mod helper_comma_delimited_list; +mod helper_equal; +mod helper_lowercase; +mod helper_or; +mod helper_url_add_slash; +mod helper_url_rm_path; +mod helper_url_rm_slash; +mod helper_yaml_string; + +use self::helper_comma_delimited_list::CommaDelimitedListHelper; +use self::helper_equal::EqualHelper; +use self::helper_lowercase::LowercaseHelper; +use self::helper_or::OrHelper; +use self::helper_url_add_slash::UrlAddSlashHelper; +use self::helper_url_rm_path::UrlRmPathHelper; +use self::helper_url_rm_slash::UrlRmSlashHelper; +use self::helper_yaml_string::YamlStringHelper; pub fn handlebars(strict: bool) -> Handlebars { let mut handlebars = Handlebars::new(); handlebars.set_strict_mode(strict); - handlebars.register_helper("comma-list", Box::new(helpers::comma_delimited_list_helper)); - handlebars.register_helper("equal", Box::new(helpers::equal_helper)); - handlebars.register_helper("eq", Box::new(helpers::equal_helper)); - handlebars.register_helper("or", Box::new(helpers::or_helper)); - handlebars.register_helper("yaml-string", Box::new(helpers::yaml_string_helper)); - handlebars.register_helper("url-rm-slash", Box::new(helpers::url_rm_slash_helper)); - handlebars.register_helper("url-add-slash", Box::new(helpers::url_add_slash_helper)); - handlebars.register_helper("url-rm-path", Box::new(helpers::url_rm_path)); - handlebars.register_helper("lowercase", Box::new(helpers::lowercase_string_helper)); + handlebars.register_helper("comma-list", Box::new(CommaDelimitedListHelper)); + handlebars.register_helper("equal", Box::new(EqualHelper)); + handlebars.register_helper("eq", Box::new(EqualHelper)); + handlebars.register_helper("lowercase", Box::new(LowercaseHelper)); + handlebars.register_helper("or", Box::new(OrHelper)); + handlebars.register_helper("url-add-slash", Box::new(UrlAddSlashHelper)); + handlebars.register_helper("url-rm-path", Box::new(UrlRmPathHelper)); + handlebars.register_helper("url-rm-slash", Box::new(UrlRmSlashHelper)); + handlebars.register_helper("yaml-string", Box::new(YamlStringHelper)); handlebars } + +#[cfg(test)] +mod test { + use super::*; + use serde_json::{self, Value}; + + fn config_fixture() -> Value { + let mut config: Value = serde_json::from_str(&include_str!( + "../../tests/fixtures/configs/config.TEST.json" + )).unwrap(); + config["ConfigData"].take() + } + + pub(crate) fn test_against_configs(handlebars: &Handlebars, template: &str, expected: &str) { + let config_rendered = handlebars.render_template(template, &config_fixture()); + assert!(config_rendered.is_ok()); + assert_eq!(&config_rendered.unwrap(), expected); + + let null_rendered = handlebars.render_template(template, &Value::Null); + assert!(null_rendered.is_ok()); + assert_eq!(&null_rendered.unwrap(), ""); + } +}