diff --git a/CHANGELOG.md b/CHANGELOG.md index 317cdca..c17af49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [Unreleased] + +### Added + +- [Added `SplitWhitespace` variant to `Match`](https://github.com/qryxip/cargo-compete#matchsplitwhitespace--splitwhitespace). ([qryxip/snowchains#136](https://github.com/qryxip/snowchains/pull/136)) + ## [0.8.7] - 2021-02-26Z ### Changed diff --git a/Cargo.lock b/Cargo.lock index 19191ba..116145f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -877,9 +877,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b67e66362108efccd8ac053abafc8b7a8d86a37e6e48fc4f6f7485eb5e9e6a5" +checksum = "d832b01df74254fe364568d6ddc294443f61cbec82816b60904303af87efae78" dependencies = [ "bytes", "fnv", @@ -892,7 +892,6 @@ dependencies = [ "tokio", "tokio-util", "tracing", - "tracing-futures", ] [[package]] @@ -1102,9 +1101,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.6.3" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd354a2c8c8083d58414597a4ecada1984f9b82ea7e87eeabddc869eaf120992" +checksum = "e1b6cf41e31a7e7b78055b548826da45c7dc74e6a13a3fa6b897a17a01322f26" dependencies = [ "console", "lazy_static", @@ -1149,9 +1148,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.47" +version = "0.3.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cfb73131c35423a367daf8cbd24100af0d077668c8c2943f0e7dd775fef0f65" +checksum = "dc9f84f9b115ce7843d60706df1422a916680bfdfcbdb0447c5614ff9d7e4d78" dependencies = [ "wasm-bindgen", ] @@ -1250,9 +1249,9 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "liquid" -version = "0.21.5" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ebeca3e471d40ca4816a8f77cb2e89590275d9ba74da4acb37b267f6250b358" +checksum = "c09860255f7e7ab76fe682f8d46c1b8b0b4c4330d64136056f650d0e2d49c144" dependencies = [ "doc-comment", "kstring", @@ -1264,9 +1263,9 @@ dependencies = [ [[package]] name = "liquid-core" -version = "0.21.3" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719573721a84bb8383be7e4f48337c78fcc2048778f780090d5ee5b6e0d6c66f" +checksum = "be5a88630d73ac78b46277169f92ef135fb09ad50af039f76ccfc35264796cc5" dependencies = [ "anymap", "chrono", @@ -1281,9 +1280,9 @@ dependencies = [ [[package]] name = "liquid-derive" -version = "0.21.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5ed0397fd0b3bd70965471955f4ff83d69515c6d58e09f735efd10f2084e7f1" +checksum = "88408698b7c2a426811369778ed472e219888aa4934f4de69568cc5bf05c8bc9" dependencies = [ "proc-macro2", "proc-quote", @@ -1292,9 +1291,9 @@ dependencies = [ [[package]] name = "liquid-lib" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4780544c8d62eb1881dffddfd82ffe23990a18cc952de27b570b910214543ac" +checksum = "10c14f535f61c4263e57cd4f6ad9701b97459f026420347ed978c4ab0d2512cc" dependencies = [ "chrono", "itertools", @@ -1778,9 +1777,9 @@ dependencies = [ [[package]] name = "publicsuffix" -version = "1.5.5" +version = "1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfe62f914117aacd6c015acc535085fc18c38efd6848cc23448f99808ec25edb" +checksum = "95b4ce31ff0a27d93c8de1849cf58162283752f065a90d508f1105fa6c9a213f" dependencies = [ "idna", "url", @@ -2222,9 +2221,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43535db9747a4ba938c0ce0a98cc631a46ebf943c9e1d604e091df6007620bf6" +checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" dependencies = [ "itoa", "ryu", @@ -2359,9 +2358,9 @@ checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" [[package]] name = "snowchains_core" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1117a09971a1f354f71663b53219bd32a9c0fc2e00c526c005bc5e79c4d901d9" +checksum = "d96b773a4440977fabc42eca6f2a5f134a1d50ec8ace44100527f8b26fbf513d" dependencies = [ "anyhow", "chrono", @@ -2852,16 +2851,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - [[package]] name = "try-lock" version = "0.2.3" @@ -3015,9 +3004,9 @@ checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasm-bindgen" -version = "0.2.70" +version = "0.2.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55c0f7123de74f0dab9b7d00fd614e7b19349cd1e2f5252bbe9b1754b59433be" +checksum = "7ee1280240b7c461d6a0071313e08f34a60b0365f14260362e5a2b17d1d31aa7" dependencies = [ "cfg-if", "serde", @@ -3027,9 +3016,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.70" +version = "0.2.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bc45447f0d4573f3d65720f636bbcc3dd6ce920ed704670118650bcd47764c7" +checksum = "5b7d8b6942b8bb3a9b0e73fc79b98095a27de6fa247615e59d096754a3bc2aa8" dependencies = [ "bumpalo", "lazy_static", @@ -3042,9 +3031,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3de431a2910c86679c34283a33f66f4e4abd7e0aec27b6669060148872aadf94" +checksum = "8e67a5806118af01f0d9045915676b22aaebecf4178ae7021bc171dab0b897ab" dependencies = [ "cfg-if", "js-sys", @@ -3054,9 +3043,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.70" +version = "0.2.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b8853882eef39593ad4174dd26fc9865a64e84026d223f63bb2c42affcbba2c" +checksum = "e5ac38da8ef716661f0f36c0d8320b89028efe10c7c0afde65baffb496ce0d3b" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3064,9 +3053,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.70" +version = "0.2.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4133b5e7f2a531fa413b3a1695e925038a05a71cf67e87dafa295cb645a01385" +checksum = "cc053ec74d454df287b9374ee8abb36ffd5acb95ba87da3ba5b7d3fe20eb401e" dependencies = [ "proc-macro2", "quote", @@ -3077,15 +3066,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.70" +version = "0.2.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4945e4943ae02d15c13962b38a5b1e81eadd4b71214eee75af64a4d6a4fd64" +checksum = "7d6f8ec44822dd71f5f221a5847fb34acd9060535c1211b70a05844c0f6383b1" [[package]] name = "web-sys" -version = "0.3.47" +version = "0.3.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c40dc691fc48003eba817c38da7113c15698142da971298003cac3ef175680b3" +checksum = "ec600b26223b2948cedfde2a0aa6756dcf1fef616f43d7b3097aaf53a6c4d92b" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index 2aa6966..be053ba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,9 +32,9 @@ indexmap = { version = "1.6.1", features = ["serde-1"] } indicatif = "0.15.0" itertools = "0.10.0" krates = "0.6.0" -liquid = "0.21.5" -liquid-core = "0.21.3" -liquid-derive = "0.21.1" +liquid = "0.22.0" +liquid-core = "0.22.0" +liquid-derive = "0.22.0" maplit = "1.0.2" opener = "0.4.1" percent-encoding = "2.1.0" @@ -45,11 +45,11 @@ rpassword = "5.0.1" rprompt = "1.0.5" serde = { version = "1.0.123", features = ["derive"] } serde_ignored = "0.1.2" -serde_json = "1.0.63" +serde_json = "1.0.64" serde_with = "1.6.4" serde_yaml = "0.8.17" shell-escape = "0.1.5" -snowchains_core = "0.11.1" +snowchains_core = "0.12.0" structopt = "0.3.21" strum = { version = "0.20.0", features = ["derive"] } tempfile = "3.2.0" @@ -64,6 +64,6 @@ which = "4.0.2" term_size = "=1.0.0-beta.2" [dev-dependencies] -insta = { version = "1.6.3", features = ["redactions"] } +insta = { version = "1.7.0", features = ["redactions"] } once_cell = "1.7.0" regex = "1.4.3" diff --git a/README-ja.md b/README-ja.md index dd295f4..5f63d32 100644 --- a/README-ja.md +++ b/README-ja.md @@ -593,6 +593,7 @@ extend: [untaggedなADT](https://serde.rs/enum-representations.html#untagged)です。 - [`Match::Exact`](#matchexact--exact) +- [`Match::SplitWhitespace`](#matchsplitwhitespace--splitwhitespace) - [`Match::Lines`](#matchlines--lines) - [`Match::Float`](#matchfloat) - [`Match::Checker`](#matchchecker) @@ -601,6 +602,10 @@ extend: 文字列全体の一致で判定します。 +### `Match::SplitWhiteSpace` = `"SplitWhitespace"` + +[空白区切りでの単語](https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_whitespace)の一致で判定します。 + ### `Match::Lines` = `"Lines"` [各行](https://doc.rust-lang.org/stable/std/primitive.str.html#method.lines)の一致で判定します。 diff --git a/README.md b/README.md index 708a07d..527fb68 100644 --- a/README.md +++ b/README.md @@ -585,6 +585,7 @@ A string that can parsed with [`humantime::format_duration`](https://docs.rs/hum An [untagged ADT](https://serde.rs/enum-representations.html#untagged). - [`Match::Exact`](#matchexact--exact) +- [`Match::SplitWhitespace`](#matchsplitwhitespace--splitwhitespace) - [`Match::Lines`](#matchlines--lines) - [`Match::Float`](#matchfloat) - [`Match::Checker`](#matchchecker) @@ -593,6 +594,10 @@ An [untagged ADT](https://serde.rs/enum-representations.html#untagged). Compares whole strings. +### `Match::SplitWhiteSpace` = `"SplitWhitespace"` + +Compares [words splitted by whitespace](https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_whitespace). + ### `Match::Lines` = `"Lines"` Compares [lines](https://doc.rust-lang.org/stable/std/primitive.str.html#method.lines). diff --git a/src/config.rs b/src/config.rs index 88cd706..19e7ee3 100644 --- a/src/config.rs +++ b/src/config.rs @@ -565,7 +565,7 @@ fn liquid_template_with_custom_filter(text: &str) -> Result) -> liquid_core::Result { + fn evaluate(&self, input: &dyn ValueView, _: &dyn Runtime) -> liquid_core::Result { Ok(Value::scalar(input.to_kstr().to_kebab_case())) } } diff --git a/src/web/retrieve_testcases.rs b/src/web/retrieve_testcases.rs index d92a405..9becd43 100644 --- a/src/web/retrieve_testcases.rs +++ b/src/web/retrieve_testcases.rs @@ -53,6 +53,7 @@ pub(crate) fn dl_only_system_test_cases( credentials: AtcoderRetrieveSampleTestCasesCredentials { username_and_password, }, + default_match: Match::Lines, full: Some(RetrieveFullTestCases { credentials: AtcoderRetrieveFullTestCasesCredentials { dropbox_access_token: credentials::dropbox_access_token()?, @@ -66,6 +67,7 @@ pub(crate) fn dl_only_system_test_cases( Some("yukicoder.me") => take(Yukicoder::exec(RetrieveTestCases { targets: YukicoderRetrieveTestCasesTargets::Urls(btreeset!(url.clone())), credentials: (), + default_match: Match::Lines, full: Some(RetrieveFullTestCases { credentials: YukicoderRetrieveFullTestCasesCredentials { api_key: credentials::yukicoder_api_key(shell)?, @@ -227,6 +229,7 @@ pub(crate) fn dl_from_atcoder( Atcoder::exec(RetrieveTestCases { targets, credentials, + default_match: Match::Lines, full, cookie_storage, timeout: crate::web::TIMEOUT, @@ -255,6 +258,7 @@ pub(crate) fn dl_from_codeforces( Codeforces::exec(RetrieveTestCases { targets, credentials, + default_match: Match::Lines, full: None, cookie_storage, timeout: crate::web::TIMEOUT, @@ -283,6 +287,7 @@ pub(crate) fn dl_from_yukicoder( Yukicoder::exec(RetrieveTestCases { targets, credentials: (), + default_match: Match::Lines, full, cookie_storage: (), timeout: crate::web::TIMEOUT,