Compare commits

...

8 Commits

Author SHA1 Message Date
JT
2b06ce27d3 Bump to 0.39 (#4097) 2021-10-27 08:36:41 +13:00
72c241348b Remove dependencies (#4087)
* fix regression

* Removed the nipper dependency

* fix linting

* fix clippy
2021-10-22 06:58:40 +13:00
JT
ab2d2db987 Fix clippy warnings (#4088)
* Fix clippy warnings

* Fix clippy warnings
2021-10-22 06:57:51 +13:00
07e05ef183 fix regression (#4086) 2021-10-19 13:39:23 -05:00
a986de8ad0 Update stale.yml (#4073)
add labels that can exempt from stale bot
2021-10-09 14:50:27 -05:00
22cfe4391e remove history file after clearing it (#4069) 2021-10-07 10:09:31 -05:00
JT
97d17311f4 Update LICENSE (#4067) 2021-10-07 08:42:07 +13:00
0f6fd30619 stale.yml: mention time to close in stale message (#4066) 2021-10-06 09:05:29 -05:00
46 changed files with 324 additions and 344 deletions

View File

@ -19,11 +19,12 @@ jobs:
operations-per-run: 520
enable-statistics: true
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is being marked stale because it has been open for 90 days without activity. If you feel that this is in error, please comment below and we will keep it marked as active.'
stale-pr-message: 'This PR is being marked stale because it has been open for 45 days without activity. If this PR is still active, please comment below and we will keep it marked as active.'
stale-issue-message: 'This issue is being marked stale because it has been open for 90 days without activity. If you feel that this is in error, please comment below and we will keep it marked as active. Otherwise, it will be closed in 10 days.'
stale-pr-message: 'This PR is being marked stale because it has been open for 45 days without activity. If this PR is still active, please comment below and we will keep it marked as active. Otherwise, it will be closed in 10 days.'
close-issue-message: 'This issue has been marked stale for more than 10 days without activity. Closing this issue, but if you find that the issue is still valid, please reopen.'
close-pr-message: 'This PR has been marked stale for more than 10 days without activity. Closing this PR, but if you are still working on it, please reopen.'
days-before-issue-stale: 90
days-before-pr-stale: 45
days-before-issue-close: 10
days-before-pr-close: 10
exempt-issue-labels: 'exempt,keep'

84
Cargo.lock generated
View File

@ -2421,19 +2421,6 @@ dependencies = [
"smallvec",
]
[[package]]
name = "nipper"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "761382864693f4bb171abf9e8de181a320b00464a83a9a5071059057b1fe0116"
dependencies = [
"cssparser",
"html5ever",
"markup5ever",
"selectors",
"tendril",
]
[[package]]
name = "nix"
version = "0.20.1"
@ -2483,7 +2470,7 @@ dependencies = [
[[package]]
name = "nu"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"ctrlc",
"futures 0.3.16",
@ -2523,7 +2510,7 @@ dependencies = [
[[package]]
name = "nu-ansi-term"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"doc-comment",
"overload",
@ -2535,7 +2522,7 @@ dependencies = [
[[package]]
name = "nu-cli"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"ctrlc",
"indexmap",
@ -2562,7 +2549,7 @@ dependencies = [
[[package]]
name = "nu-command"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"Inflector",
"arboard",
@ -2650,7 +2637,7 @@ dependencies = [
[[package]]
name = "nu-completion"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"indexmap",
"is_executable",
@ -2666,7 +2653,7 @@ dependencies = [
[[package]]
name = "nu-data"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"bigdecimal-rs",
"byte-unit",
@ -2697,7 +2684,7 @@ dependencies = [
[[package]]
name = "nu-engine"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"ansi_term 0.12.1",
"bigdecimal-rs",
@ -2743,7 +2730,7 @@ dependencies = [
[[package]]
name = "nu-errors"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"bigdecimal-rs",
"codespan-reporting",
@ -2762,7 +2749,7 @@ dependencies = [
[[package]]
name = "nu-json"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"lazy_static",
"linked-hash-map",
@ -2776,7 +2763,7 @@ dependencies = [
[[package]]
name = "nu-parser"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"bigdecimal-rs",
"derive-new",
@ -2795,7 +2782,7 @@ dependencies = [
[[package]]
name = "nu-path"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"dirs-next",
"dunce",
@ -2803,7 +2790,7 @@ dependencies = [
[[package]]
name = "nu-plugin"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"indexmap",
"nu-errors",
@ -2817,7 +2804,7 @@ dependencies = [
[[package]]
name = "nu-pretty-hex"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"heapless",
"nu-ansi-term",
@ -2826,7 +2813,7 @@ dependencies = [
[[package]]
name = "nu-protocol"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"bigdecimal-rs",
"byte-unit",
@ -2848,7 +2835,7 @@ dependencies = [
[[package]]
name = "nu-serde"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"bigdecimal-rs",
"insta",
@ -2860,7 +2847,7 @@ dependencies = [
[[package]]
name = "nu-source"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"derive-new",
"getset",
@ -2871,7 +2858,7 @@ dependencies = [
[[package]]
name = "nu-stream"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"nu-errors",
"nu-protocol",
@ -2880,7 +2867,7 @@ dependencies = [
[[package]]
name = "nu-table"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"atty",
"nu-ansi-term",
@ -2891,7 +2878,7 @@ dependencies = [
[[package]]
name = "nu-test-support"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"bigdecimal-rs",
"chrono",
@ -2909,7 +2896,7 @@ dependencies = [
[[package]]
name = "nu-value-ext"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"indexmap",
"itertools",
@ -2921,7 +2908,7 @@ dependencies = [
[[package]]
name = "nu_plugin_binaryview"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"crossterm",
"image 0.22.5",
@ -2937,7 +2924,7 @@ dependencies = [
[[package]]
name = "nu_plugin_chart"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"crossterm",
"nu-data",
@ -2951,7 +2938,7 @@ dependencies = [
[[package]]
name = "nu_plugin_from_bson"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"bigdecimal-rs",
"bson",
@ -2975,7 +2962,7 @@ dependencies = [
[[package]]
name = "nu_plugin_from_sqlite"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"bigdecimal-rs",
"nu-errors",
@ -2988,7 +2975,7 @@ dependencies = [
[[package]]
name = "nu_plugin_inc"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"nu-errors",
"nu-plugin",
@ -3001,7 +2988,7 @@ dependencies = [
[[package]]
name = "nu_plugin_match"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"nu-errors",
"nu-plugin",
@ -3011,7 +2998,7 @@ dependencies = [
[[package]]
name = "nu_plugin_query_json"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"gjson",
"nu-errors",
@ -3022,7 +3009,7 @@ dependencies = [
[[package]]
name = "nu_plugin_s3"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"futures 0.3.16",
"nu-errors",
@ -3034,10 +3021,9 @@ dependencies = [
[[package]]
name = "nu_plugin_selector"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"indexmap",
"nipper",
"nu-errors",
"nu-plugin",
"nu-protocol",
@ -3047,7 +3033,7 @@ dependencies = [
[[package]]
name = "nu_plugin_start"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"glob",
"nu-errors",
@ -3061,7 +3047,7 @@ dependencies = [
[[package]]
name = "nu_plugin_textview"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"bat",
"nu-data",
@ -3075,7 +3061,7 @@ dependencies = [
[[package]]
name = "nu_plugin_to_bson"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"bson",
"nu-errors",
@ -3087,7 +3073,7 @@ dependencies = [
[[package]]
name = "nu_plugin_to_sqlite"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"hex 0.4.3",
"nu-errors",
@ -3100,7 +3086,7 @@ dependencies = [
[[package]]
name = "nu_plugin_tree"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"derive-new",
"nu-errors",
@ -3111,7 +3097,7 @@ dependencies = [
[[package]]
name = "nu_plugin_xpath"
version = "0.38.0"
version = "0.39.0"
dependencies = [
"bigdecimal-rs",
"indexmap",

View File

@ -10,7 +10,7 @@ license = "MIT"
name = "nu"
readme = "README.md"
repository = "https://github.com/nushell/nushell"
version = "0.38.0"
version = "0.39.0"
[workspace]
members = ["crates/*/"]
@ -18,34 +18,34 @@ members = ["crates/*/"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
nu-cli = { version = "0.38.0", path="./crates/nu-cli", default-features=false }
nu-command = { version = "0.38.0", path="./crates/nu-command" }
nu-completion = { version = "0.38.0", path="./crates/nu-completion" }
nu-data = { version = "0.38.0", path="./crates/nu-data" }
nu-engine = { version = "0.38.0", path="./crates/nu-engine" }
nu-errors = { version = "0.38.0", path="./crates/nu-errors" }
nu-parser = { version = "0.38.0", path="./crates/nu-parser" }
nu-path = { version = "0.38.0", path="./crates/nu-path" }
nu-plugin = { version = "0.38.0", path="./crates/nu-plugin" }
nu-protocol = { version = "0.38.0", path="./crates/nu-protocol" }
nu-source = { version = "0.38.0", path="./crates/nu-source" }
nu-value-ext = { version = "0.38.0", path="./crates/nu-value-ext" }
nu-cli = { version = "0.39.0", path="./crates/nu-cli", default-features=false }
nu-command = { version = "0.39.0", path="./crates/nu-command" }
nu-completion = { version = "0.39.0", path="./crates/nu-completion" }
nu-data = { version = "0.39.0", path="./crates/nu-data" }
nu-engine = { version = "0.39.0", path="./crates/nu-engine" }
nu-errors = { version = "0.39.0", path="./crates/nu-errors" }
nu-parser = { version = "0.39.0", path="./crates/nu-parser" }
nu-path = { version = "0.39.0", path="./crates/nu-path" }
nu-plugin = { version = "0.39.0", path="./crates/nu-plugin" }
nu-protocol = { version = "0.39.0", path="./crates/nu-protocol" }
nu-source = { version = "0.39.0", path="./crates/nu-source" }
nu-value-ext = { version = "0.39.0", path="./crates/nu-value-ext" }
nu_plugin_binaryview = { version = "0.38.0", path="./crates/nu_plugin_binaryview", optional=true }
nu_plugin_chart = { version = "0.38.0", path="./crates/nu_plugin_chart", optional=true }
nu_plugin_from_bson = { version = "0.38.0", path="./crates/nu_plugin_from_bson", optional=true }
nu_plugin_from_sqlite = { version = "0.38.0", path="./crates/nu_plugin_from_sqlite", optional=true }
nu_plugin_inc = { version = "0.38.0", path="./crates/nu_plugin_inc", optional=true }
nu_plugin_match = { version = "0.38.0", path="./crates/nu_plugin_match", optional=true }
nu_plugin_query_json = { version = "0.38.0", path="./crates/nu_plugin_query_json", optional=true }
nu_plugin_s3 = { version = "0.38.0", path="./crates/nu_plugin_s3", optional=true }
nu_plugin_selector = { version = "0.38.0", path="./crates/nu_plugin_selector", optional=true }
nu_plugin_start = { version = "0.38.0", path="./crates/nu_plugin_start", optional=true }
nu_plugin_textview = { version = "0.38.0", path="./crates/nu_plugin_textview", optional=true }
nu_plugin_to_bson = { version = "0.38.0", path="./crates/nu_plugin_to_bson", optional=true }
nu_plugin_to_sqlite = { version = "0.38.0", path="./crates/nu_plugin_to_sqlite", optional=true }
nu_plugin_tree = { version = "0.38.0", path="./crates/nu_plugin_tree", optional=true }
nu_plugin_xpath = { version = "0.38.0", path="./crates/nu_plugin_xpath", optional=true }
nu_plugin_binaryview = { version = "0.39.0", path="./crates/nu_plugin_binaryview", optional=true }
nu_plugin_chart = { version = "0.39.0", path="./crates/nu_plugin_chart", optional=true }
nu_plugin_from_bson = { version = "0.39.0", path="./crates/nu_plugin_from_bson", optional=true }
nu_plugin_from_sqlite = { version = "0.39.0", path="./crates/nu_plugin_from_sqlite", optional=true }
nu_plugin_inc = { version = "0.39.0", path="./crates/nu_plugin_inc", optional=true }
nu_plugin_match = { version = "0.39.0", path="./crates/nu_plugin_match", optional=true }
nu_plugin_query_json = { version = "0.39.0", path="./crates/nu_plugin_query_json", optional=true }
nu_plugin_s3 = { version = "0.39.0", path="./crates/nu_plugin_s3", optional=true }
nu_plugin_selector = { version = "0.39.0", path="./crates/nu_plugin_selector", optional=true }
nu_plugin_start = { version = "0.39.0", path="./crates/nu_plugin_start", optional=true }
nu_plugin_textview = { version = "0.39.0", path="./crates/nu_plugin_textview", optional=true }
nu_plugin_to_bson = { version = "0.39.0", path="./crates/nu_plugin_to_bson", optional=true }
nu_plugin_to_sqlite = { version = "0.39.0", path="./crates/nu_plugin_to_sqlite", optional=true }
nu_plugin_tree = { version = "0.39.0", path="./crates/nu_plugin_tree", optional=true }
nu_plugin_xpath = { version = "0.39.0", path="./crates/nu_plugin_xpath", optional=true }
# Required to bootstrap the main binary
ctrlc = { version="3.1.7", optional=true }
@ -53,7 +53,7 @@ futures = { version="0.3.12", features=["compat", "io-compat"] }
itertools = "0.10.0"
[dev-dependencies]
nu-test-support = { version = "0.38.0", path="./crates/nu-test-support" }
nu-test-support = { version = "0.39.0", path="./crates/nu-test-support" }
serial_test = "0.5.1"
hamcrest2 = "0.3.0"
rstest = "0.10.0"

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2019 - 2021 Yehuda Katz, Jonathan Turner
Copyright (c) 2019 - 2021 Nushell Project
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -9,7 +9,7 @@ description = "Library for ANSI terminal colors and styles (bold, underline)"
edition = "2018"
license = "MIT"
name = "nu-ansi-term"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false

View File

@ -4,24 +4,24 @@ description = "CLI for nushell"
edition = "2018"
license = "MIT"
name = "nu-cli"
version = "0.38.0"
version = "0.39.0"
build = "build.rs"
[lib]
doctest = false
[dependencies]
nu-completion = { version = "0.38.0", path="../nu-completion" }
nu-command = { version = "0.38.0", path="../nu-command" }
nu-data = { version = "0.38.0", path="../nu-data" }
nu-engine = { version = "0.38.0", path="../nu-engine" }
nu-errors = { version = "0.38.0", path="../nu-errors" }
nu-parser = { version = "0.38.0", path="../nu-parser" }
nu-protocol = { version = "0.38.0", path="../nu-protocol" }
nu-source = { version = "0.38.0", path="../nu-source" }
nu-stream = { version = "0.38.0", path="../nu-stream" }
nu-ansi-term = { version = "0.38.0", path="../nu-ansi-term" }
nu-path = { version = "0.38.0", path="../nu-path" }
nu-completion = { version = "0.39.0", path="../nu-completion" }
nu-command = { version = "0.39.0", path="../nu-command" }
nu-data = { version = "0.39.0", path="../nu-data" }
nu-engine = { version = "0.39.0", path="../nu-engine" }
nu-errors = { version = "0.39.0", path="../nu-errors" }
nu-parser = { version = "0.39.0", path="../nu-parser" }
nu-protocol = { version = "0.39.0", path="../nu-protocol" }
nu-source = { version = "0.39.0", path="../nu-source" }
nu-stream = { version = "0.39.0", path="../nu-stream" }
nu-ansi-term = { version = "0.39.0", path="../nu-ansi-term" }
nu-path = { version = "0.39.0", path="../nu-path" }
indexmap ="1.6.1"
log = "0.4.14"

View File

@ -372,7 +372,7 @@ pub fn cli(
LineResult::ClearHistory => {
if options.save_history {
rl.clear_history();
let _ = rl.append_history(&history_path);
std::fs::remove_file(&history_path)?;
}
}

View File

@ -5,28 +5,28 @@ description = "CLI for nushell"
edition = "2018"
license = "MIT"
name = "nu-command"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
nu-data = { version = "0.38.0", path="../nu-data" }
nu-engine = { version = "0.38.0", path="../nu-engine" }
nu-errors = { version = "0.38.0", path="../nu-errors" }
nu-json = { version = "0.38.0", path="../nu-json" }
nu-path = { version = "0.38.0", path="../nu-path" }
nu-parser = { version = "0.38.0", path="../nu-parser" }
nu-plugin = { version = "0.38.0", path="../nu-plugin" }
nu-protocol = { version = "0.38.0", path="../nu-protocol" }
nu-serde = { version = "0.38.0", path="../nu-serde" }
nu-source = { version = "0.38.0", path="../nu-source" }
nu-stream = { version = "0.38.0", path="../nu-stream" }
nu-table = { version = "0.38.0", path="../nu-table" }
nu-test-support = { version = "0.38.0", path="../nu-test-support" }
nu-value-ext = { version = "0.38.0", path="../nu-value-ext" }
nu-ansi-term = { version = "0.38.0", path="../nu-ansi-term" }
nu-pretty-hex = { version = "0.38.0", path="../nu-pretty-hex" }
nu-data = { version = "0.39.0", path="../nu-data" }
nu-engine = { version = "0.39.0", path="../nu-engine" }
nu-errors = { version = "0.39.0", path="../nu-errors" }
nu-json = { version = "0.39.0", path="../nu-json" }
nu-path = { version = "0.39.0", path="../nu-path" }
nu-parser = { version = "0.39.0", path="../nu-parser" }
nu-plugin = { version = "0.39.0", path="../nu-plugin" }
nu-protocol = { version = "0.39.0", path="../nu-protocol" }
nu-serde = { version = "0.39.0", path="../nu-serde" }
nu-source = { version = "0.39.0", path="../nu-source" }
nu-stream = { version = "0.39.0", path="../nu-stream" }
nu-table = { version = "0.39.0", path="../nu-table" }
nu-test-support = { version = "0.39.0", path="../nu-test-support" }
nu-value-ext = { version = "0.39.0", path="../nu-value-ext" }
nu-ansi-term = { version = "0.39.0", path="../nu-ansi-term" }
nu-pretty-hex = { version = "0.39.0", path="../nu-pretty-hex" }
url = "2.2.1"
mime = "0.3.16"

View File

@ -4,19 +4,19 @@ description = "Completions for nushell"
edition = "2018"
license = "MIT"
name = "nu-completion"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
nu-engine = { version = "0.38.0", path="../nu-engine" }
nu-data = { version = "0.38.0", path="../nu-data" }
nu-parser = { version = "0.38.0", path="../nu-parser" }
nu-path = { version = "0.38.0", path="../nu-path" }
nu-protocol = { version = "0.38.0", path="../nu-protocol" }
nu-source = { version = "0.38.0", path="../nu-source" }
nu-test-support = { version = "0.38.0", path="../nu-test-support" }
nu-engine = { version = "0.39.0", path="../nu-engine" }
nu-data = { version = "0.39.0", path="../nu-data" }
nu-parser = { version = "0.39.0", path="../nu-parser" }
nu-path = { version = "0.39.0", path="../nu-path" }
nu-protocol = { version = "0.39.0", path="../nu-protocol" }
nu-source = { version = "0.39.0", path="../nu-source" }
nu-test-support = { version = "0.39.0", path="../nu-test-support" }
indexmap = { version="1.6.1", features=["serde-1"] }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]

View File

@ -4,7 +4,7 @@ description = "CLI for nushell"
edition = "2018"
license = "MIT"
name = "nu-data"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
@ -27,14 +27,14 @@ sha2 = "0.9.3"
sys-locale = "0.1.0"
toml = "0.5.8"
nu-errors = { version = "0.38.0", path="../nu-errors" }
nu-path = { version = "0.38.0", path="../nu-path" }
nu-protocol = { version = "0.38.0", path="../nu-protocol" }
nu-source = { version = "0.38.0", path="../nu-source" }
nu-table = { version = "0.38.0", path="../nu-table" }
nu-test-support = { version = "0.38.0", path="../nu-test-support" }
nu-value-ext = { version = "0.38.0", path="../nu-value-ext" }
nu-ansi-term = { version = "0.38.0", path="../nu-ansi-term" }
nu-errors = { version = "0.39.0", path="../nu-errors" }
nu-path = { version = "0.39.0", path="../nu-path" }
nu-protocol = { version = "0.39.0", path="../nu-protocol" }
nu-source = { version = "0.39.0", path="../nu-source" }
nu-table = { version = "0.39.0", path="../nu-table" }
nu-test-support = { version = "0.39.0", path="../nu-test-support" }
nu-value-ext = { version = "0.39.0", path="../nu-value-ext" }
nu-ansi-term = { version = "0.39.0", path="../nu-ansi-term" }
[target.'cfg(unix)'.dependencies]
users = "0.11.0"

View File

@ -4,20 +4,20 @@ description = "Core commands for nushell"
edition = "2018"
license = "MIT"
name = "nu-engine"
version = "0.38.0"
version = "0.39.0"
[dependencies]
nu-data = { version = "0.38.0", path="../nu-data" }
nu-errors = { version = "0.38.0", path="../nu-errors" }
nu-parser = { version = "0.38.0", path="../nu-parser" }
nu-plugin = { version = "0.38.0", path="../nu-plugin" }
nu-protocol = { version = "0.38.0", path="../nu-protocol" }
nu-source = { version = "0.38.0", path="../nu-source" }
nu-stream = { version = "0.38.0", path="../nu-stream" }
nu-value-ext = { version = "0.38.0", path="../nu-value-ext" }
nu-ansi-term = { version = "0.38.0", path="../nu-ansi-term" }
nu-test-support = { version = "0.38.0", path="../nu-test-support" }
nu-path = { version = "0.38.0", path="../nu-path" }
nu-data = { version = "0.39.0", path="../nu-data" }
nu-errors = { version = "0.39.0", path="../nu-errors" }
nu-parser = { version = "0.39.0", path="../nu-parser" }
nu-plugin = { version = "0.39.0", path="../nu-plugin" }
nu-protocol = { version = "0.39.0", path="../nu-protocol" }
nu-source = { version = "0.39.0", path="../nu-source" }
nu-stream = { version = "0.39.0", path="../nu-stream" }
nu-value-ext = { version = "0.39.0", path="../nu-value-ext" }
nu-ansi-term = { version = "0.39.0", path="../nu-ansi-term" }
nu-test-support = { version = "0.39.0", path="../nu-test-support" }
nu-path = { version = "0.39.0", path="../nu-path" }
trash = { version="1.3.0", optional=true }
which = { version="4.0.2", optional=true }
@ -51,7 +51,7 @@ umask = "1.0.0"
users = "0.11.0"
[dev-dependencies]
nu-test-support = { version = "0.38.0", path="../nu-test-support" }
nu-test-support = { version = "0.39.0", path="../nu-test-support" }
hamcrest2 = "0.3.0"
[features]

View File

@ -4,14 +4,14 @@ description = "Core error subsystem for Nushell"
edition = "2018"
license = "MIT"
name = "nu-errors"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
nu-source = { path="../nu-source", version = "0.38.0" }
nu-ansi-term = { version = "0.38.0", path="../nu-ansi-term" }
nu-source = { path="../nu-source", version = "0.39.0" }
nu-ansi-term = { version = "0.39.0", path="../nu-ansi-term" }
bigdecimal = { package = "bigdecimal-rs", version = "0.2.1", features = ["serde"] }
codespan-reporting = { version="0.11.0", features=["serialization"] }

View File

@ -4,7 +4,7 @@ description = "Fork of serde-hjson"
edition = "2018"
license = "MIT"
name = "nu-json"
version = "0.38.0"
version = "0.39.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -20,6 +20,6 @@ lazy_static = "1"
linked-hash-map = { version="0.5", optional=true }
[dev-dependencies]
nu-path = { version = "0.38.0", path="../nu-path" }
nu-test-support = { version = "0.38.0", path="../nu-test-support" }
nu-path = { version = "0.39.0", path="../nu-path" }
nu-test-support = { version = "0.39.0", path="../nu-test-support" }
serde_json = "1.0.39"

View File

@ -4,7 +4,7 @@ description = "Nushell parser"
edition = "2018"
license = "MIT"
name = "nu-parser"
version = "0.38.0"
version = "0.39.0"
[dependencies]
bigdecimal = { package = "bigdecimal-rs", version = "0.2.1", features = ["serde"] }
@ -15,12 +15,12 @@ num-bigint = { version="0.3.1", features=["serde"] }
itertools = "0.10.0"
smart-default = "0.6.0"
nu-errors = { version = "0.38.0", path="../nu-errors" }
nu-data = { version = "0.38.0", path="../nu-data" }
nu-path = { version = "0.38.0", path="../nu-path" }
nu-protocol = { version = "0.38.0", path="../nu-protocol" }
nu-source = { version = "0.38.0", path="../nu-source" }
nu-test-support = { version = "0.38.0", path="../nu-test-support" }
nu-errors = { version = "0.39.0", path="../nu-errors" }
nu-data = { version = "0.39.0", path="../nu-data" }
nu-path = { version = "0.39.0", path="../nu-path" }
nu-protocol = { version = "0.39.0", path="../nu-protocol" }
nu-source = { version = "0.39.0", path="../nu-source" }
nu-test-support = { version = "0.39.0", path="../nu-test-support" }
[features]
stable = []

View File

@ -4,7 +4,7 @@ description = "Path handling library for Nushell"
edition = "2018"
license = "MIT"
name = "nu-path"
version = "0.38.0"
version = "0.39.0"
[dependencies]
dirs-next = "2.0.0"

View File

@ -4,17 +4,17 @@ description = "Nushell Plugin"
edition = "2018"
license = "MIT"
name = "nu-plugin"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
nu-errors = { path="../nu-errors", version = "0.38.0" }
nu-protocol = { path="../nu-protocol", version = "0.38.0" }
nu-source = { path="../nu-source", version = "0.38.0" }
nu-test-support = { path="../nu-test-support", version = "0.38.0" }
nu-value-ext = { path="../nu-value-ext", version = "0.38.0" }
nu-errors = { path="../nu-errors", version = "0.39.0" }
nu-protocol = { path="../nu-protocol", version = "0.39.0" }
nu-source = { path="../nu-source", version = "0.39.0" }
nu-test-support = { path="../nu-test-support", version = "0.39.0" }
nu-value-ext = { path="../nu-value-ext", version = "0.39.0" }
indexmap = { version="1.6.1", features=["serde-1"] }
serde = { version="1.0", features=["derive"] }
serde_json = "1.0"

View File

@ -55,7 +55,6 @@ pub fn serve_plugin(plugin: &mut dyn Plugin) {
match command {
Ok(NuCommand::config) => {
send_response(plugin.config());
return;
}
Ok(NuCommand::begin_filter { params }) => {
send_response(plugin.begin_filter(params));
@ -65,23 +64,19 @@ pub fn serve_plugin(plugin: &mut dyn Plugin) {
}
Ok(NuCommand::end_filter) => {
send_response(plugin.end_filter());
return;
}
Ok(NuCommand::sink { params }) => {
plugin.sink(params.0, params.1);
return;
}
Ok(NuCommand::quit) => {
plugin.quit();
return;
}
e => {
send_response(ShellError::untagged_runtime_error(format!(
"Could not handle plugin message: {} {:?}",
input, e
)));
return;
}
}
}

View File

@ -4,7 +4,7 @@ description = "Pretty hex dump of bytes slice in the common style."
edition = "2018"
license = "MIT"
name = "nu-pretty-hex"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
@ -16,7 +16,7 @@ name = "nu_pretty_hex"
path = "src/main.rs"
[dependencies]
nu-ansi-term = { path="../nu-ansi-term", version = "0.38.0" }
nu-ansi-term = { path="../nu-ansi-term", version = "0.39.0" }
rand = "0.8.3"
[dev-dependencies]

View File

@ -4,7 +4,7 @@ description = "Core values and protocols for Nushell"
edition = "2018"
license = "MIT"
name = "nu-protocol"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
@ -18,8 +18,8 @@ derive-new = "0.5.8"
getset = "0.1.1"
indexmap = { version="1.6.1", features=["serde-1"] }
log = "0.4.14"
nu-errors = { path="../nu-errors", version = "0.38.0" }
nu-source = { path="../nu-source", version = "0.38.0" }
nu-errors = { path="../nu-errors", version = "0.39.0" }
nu-source = { path="../nu-source", version = "0.39.0" }
num-bigint = { version="0.3.1", features=["serde"] }
num-integer = "0.1.44"
num-traits = "0.2.14"

View File

@ -1,6 +1,6 @@
[package]
name = "nu-serde"
version = "0.38.0"
version = "0.39.0"
edition = "2018"
authors = ["The Nu Project Contributors"]
description = "Turn any value into a nu-protocol::Value with serde"
@ -10,8 +10,8 @@ documentation = "https://docs.rs/nu-serde"
[dependencies]
bigdecimal = { package = "bigdecimal-rs", version = "0.2.1", features = ["serde"] }
nu-protocol = { version = "0.38.0", path = "../nu-protocol" }
nu-source = { version = "0.38.0", path = "../nu-source" }
nu-protocol = { version = "0.39.0", path = "../nu-protocol" }
nu-source = { version = "0.39.0", path = "../nu-source" }
serde = "1"
thiserror = "1"

View File

@ -4,7 +4,7 @@ description = "A source string characterizer for Nushell"
edition = "2018"
license = "MIT"
name = "nu-source"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false

View File

@ -4,12 +4,12 @@ description = "Nushell stream"
edition = "2018"
license = "MIT"
name = "nu-stream"
version = "0.38.0"
version = "0.39.0"
[dependencies]
nu-errors = { version = "0.38.0", path="../nu-errors" }
nu-protocol = { version = "0.38.0", path="../nu-protocol" }
nu-source = { version = "0.38.0", path="../nu-source" }
nu-errors = { version = "0.39.0", path="../nu-errors" }
nu-protocol = { version = "0.39.0", path="../nu-protocol" }
nu-source = { version = "0.39.0", path="../nu-source" }
[features]
stable = []

View File

@ -4,7 +4,7 @@ description = "Nushell table printing"
edition = "2018"
license = "MIT"
name = "nu-table"
version = "0.38.0"
version = "0.39.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
@ -13,7 +13,7 @@ path = "src/main.rs"
[dependencies]
atty = "0.2.14"
nu-ansi-term = { version = "0.38.0", path="../nu-ansi-term" }
nu-ansi-term = { version = "0.39.0", path="../nu-ansi-term" }
regex = "1.4"
strip-ansi-escapes = "0.1.1"

View File

@ -4,16 +4,16 @@ description = "Support for writing Nushell tests"
edition = "2018"
license = "MIT"
name = "nu-test-support"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
nu-errors = { version = "0.38.0", path="../nu-errors" }
nu-path = { version = "0.38.0", path="../nu-path" }
nu-protocol = { path="../nu-protocol", version = "0.38.0" }
nu-source = { path="../nu-source", version = "0.38.0" }
nu-errors = { version = "0.39.0", path="../nu-errors" }
nu-path = { version = "0.39.0", path="../nu-path" }
nu-protocol = { path="../nu-protocol", version = "0.39.0" }
nu-source = { path="../nu-source", version = "0.39.0" }
bigdecimal = { package = "bigdecimal-rs", version = "0.2.1", features = ["serde"] }
chrono = "0.4.19"

View File

@ -4,15 +4,15 @@ description = "Extension traits for values in Nushell"
edition = "2018"
license = "MIT"
name = "nu-value-ext"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
nu-errors = { path="../nu-errors", version = "0.38.0" }
nu-protocol = { path="../nu-protocol", version = "0.38.0" }
nu-source = { path="../nu-source", version = "0.38.0" }
nu-errors = { path="../nu-errors", version = "0.39.0" }
nu-protocol = { path="../nu-protocol", version = "0.39.0" }
nu-source = { path="../nu-source", version = "0.39.0" }
indexmap = { version="1.6.1", features=["serde-1"] }
itertools = "0.10.0"

View File

@ -4,7 +4,7 @@ description = "A binary viewer plugin for Nushell"
edition = "2018"
license = "MIT"
name = "nu_plugin_binaryview"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
@ -13,12 +13,12 @@ doctest = false
crossterm = "0.19"
image = { version="0.22.4", default_features=false, features=["png_codec", "jpeg"] }
neso = "0.5.0"
nu-errors = { path="../nu-errors", version = "0.38.0" }
nu-plugin = { path="../nu-plugin", version = "0.38.0" }
nu-protocol = { path="../nu-protocol", version = "0.38.0" }
nu-source = { path="../nu-source", version = "0.38.0" }
nu-ansi-term = { version = "0.38.0", path="../nu-ansi-term" }
nu-pretty-hex = { version = "0.38.0", path="../nu-pretty-hex" }
nu-errors = { path="../nu-errors", version = "0.39.0" }
nu-plugin = { path="../nu-plugin", version = "0.39.0" }
nu-protocol = { path="../nu-protocol", version = "0.39.0" }
nu-source = { path="../nu-source", version = "0.39.0" }
nu-ansi-term = { version = "0.39.0", path="../nu-ansi-term" }
nu-pretty-hex = { version = "0.39.0", path="../nu-pretty-hex" }
rawkey = "0.1.3"
[build-dependencies]

View File

@ -4,18 +4,18 @@ description = "A plugin to display charts"
edition = "2018"
license = "MIT"
name = "nu_plugin_chart"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
nu-data = { path="../nu-data", version = "0.38.0" }
nu-errors = { path="../nu-errors", version = "0.38.0" }
nu-plugin = { path="../nu-plugin", version = "0.38.0" }
nu-protocol = { path="../nu-protocol", version = "0.38.0" }
nu-source = { path="../nu-source", version = "0.38.0" }
nu-value-ext = { path="../nu-value-ext", version = "0.38.0" }
nu-data = { path="../nu-data", version = "0.39.0" }
nu-errors = { path="../nu-errors", version = "0.39.0" }
nu-plugin = { path="../nu-plugin", version = "0.39.0" }
nu-protocol = { path="../nu-protocol", version = "0.39.0" }
nu-source = { path="../nu-source", version = "0.39.0" }
nu-value-ext = { path="../nu-value-ext", version = "0.39.0" }
crossterm = "0.19.0"
tui = { version="0.15.0", default-features=false, features=["crossterm"] }

View File

@ -4,7 +4,7 @@ description = "A converter plugin to the bson format for Nushell"
edition = "2018"
license = "MIT"
name = "nu_plugin_from_bson"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
@ -12,9 +12,9 @@ doctest = false
[dependencies]
bigdecimal = { package = "bigdecimal-rs", version = "0.2.1", features = ["serde"] }
bson = { version="0.14.1", features=["decimal128"] }
nu-errors = { path="../nu-errors", version = "0.38.0" }
nu-plugin = { path="../nu-plugin", version = "0.38.0" }
nu-protocol = { path="../nu-protocol", version = "0.38.0" }
nu-source = { path="../nu-source", version = "0.38.0" }
nu-errors = { path="../nu-errors", version = "0.39.0" }
nu-plugin = { path="../nu-plugin", version = "0.39.0" }
nu-protocol = { path="../nu-protocol", version = "0.39.0" }
nu-source = { path="../nu-source", version = "0.39.0" }
[build-dependencies]

View File

@ -10,10 +10,10 @@ version = "0.1.0"
doctest = false
[dependencies]
nu-errors = { path="../nu-errors", version = "0.38.0" }
nu-plugin = { path="../nu-plugin", version = "0.38.0" }
nu-protocol = { path="../nu-protocol", version = "0.38.0" }
nu-source = { path="../nu-source", version = "0.38.0" }
nu-errors = { path="../nu-errors", version = "0.39.0" }
nu-plugin = { path="../nu-plugin", version = "0.39.0" }
nu-protocol = { path="../nu-protocol", version = "0.39.0" }
nu-source = { path="../nu-source", version = "0.39.0" }
tempfile = "3.2.0"
mp4 = "0.8.2"

View File

@ -4,17 +4,17 @@ description = "A converter plugin to the bson format for Nushell"
edition = "2018"
license = "MIT"
name = "nu_plugin_from_sqlite"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
bigdecimal = { package = "bigdecimal-rs", version = "0.2.1", features = ["serde"] }
nu-errors = { path="../nu-errors", version = "0.38.0" }
nu-plugin = { path="../nu-plugin", version = "0.38.0" }
nu-protocol = { path="../nu-protocol", version = "0.38.0" }
nu-source = { path="../nu-source", version = "0.38.0" }
nu-errors = { path="../nu-errors", version = "0.39.0" }
nu-plugin = { path="../nu-plugin", version = "0.39.0" }
nu-protocol = { path="../nu-protocol", version = "0.39.0" }
nu-source = { path="../nu-source", version = "0.39.0" }
tempfile = "3.2.0"
[dependencies.rusqlite]

View File

@ -4,18 +4,18 @@ description = "A version incrementer plugin for Nushell"
edition = "2018"
license = "MIT"
name = "nu_plugin_inc"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
nu-errors = { path="../nu-errors", version = "0.38.0" }
nu-plugin = { path="../nu-plugin", version = "0.38.0" }
nu-protocol = { path="../nu-protocol", version = "0.38.0" }
nu-source = { path="../nu-source", version = "0.38.0" }
nu-test-support = { path="../nu-test-support", version = "0.38.0" }
nu-value-ext = { path="../nu-value-ext", version = "0.38.0" }
nu-errors = { path="../nu-errors", version = "0.39.0" }
nu-plugin = { path="../nu-plugin", version = "0.39.0" }
nu-protocol = { path="../nu-protocol", version = "0.39.0" }
nu-source = { path="../nu-source", version = "0.39.0" }
nu-test-support = { path="../nu-test-support", version = "0.39.0" }
nu-value-ext = { path="../nu-value-ext", version = "0.39.0" }
semver = "0.11.0"

View File

@ -4,15 +4,15 @@ description = "A regex match plugin for Nushell"
edition = "2018"
license = "MIT"
name = "nu_plugin_match"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
nu-errors = { path="../nu-errors", version = "0.38.0" }
nu-plugin = { path="../nu-plugin", version = "0.38.0" }
nu-protocol = { path="../nu-protocol", version = "0.38.0" }
nu-errors = { path="../nu-errors", version = "0.39.0" }
nu-plugin = { path="../nu-plugin", version = "0.39.0" }
nu-protocol = { path="../nu-protocol", version = "0.39.0" }
regex = "1.4.3"
[build-dependencies]

View File

@ -4,14 +4,14 @@ description = "query json files with gjson"
edition = "2018"
license = "MIT"
name = "nu_plugin_query_json"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
gjson = "0.7.1"
nu-errors = { version = "0.38.0", path="../nu-errors" }
nu-plugin = { version = "0.38.0", path="../nu-plugin" }
nu-protocol = { version = "0.38.0", path="../nu-protocol" }
nu-source = { version = "0.38.0", path="../nu-source" }
nu-errors = { version = "0.39.0", path="../nu-errors" }
nu-plugin = { version = "0.39.0", path="../nu-plugin" }
nu-protocol = { version = "0.39.0", path="../nu-protocol" }
nu-source = { version = "0.39.0", path="../nu-source" }

View File

@ -4,17 +4,17 @@ description = "An S3 plugin for Nushell"
edition = "2018"
license = "MIT"
name = "nu_plugin_s3"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
futures = { version="0.3.12", features=["compat", "io-compat"] }
nu-errors = { path="../nu-errors", version = "0.38.0" }
nu-plugin = { path="../nu-plugin", version = "0.38.0" }
nu-protocol = { path="../nu-protocol", version = "0.38.0" }
nu-source = { path="../nu-source", version = "0.38.0" }
nu-errors = { path="../nu-errors", version = "0.39.0" }
nu-plugin = { path="../nu-plugin", version = "0.39.0" }
nu-protocol = { path="../nu-protocol", version = "0.39.0" }
nu-source = { path="../nu-source", version = "0.39.0" }
s3handler = "0.7"
[build-dependencies]

View File

@ -4,18 +4,17 @@ description = "web scraping using css selector"
edition = "2018"
license = "MIT"
name = "nu_plugin_selector"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
nipper = "0.1.9"
scraper = "0.12.0"
nu-errors = { version = "0.38.0", path="../nu-errors" }
nu-plugin = { version = "0.38.0", path="../nu-plugin" }
nu-protocol = { version = "0.38.0", path="../nu-protocol" }
nu-source = { version = "0.38.0", path="../nu-source" }
nu-errors = { version = "0.39.0", path="../nu-errors" }
nu-plugin = { version = "0.39.0", path="../nu-plugin" }
nu-protocol = { version = "0.39.0", path="../nu-protocol" }
nu-source = { version = "0.39.0", path="../nu-source" }
[dev-dependencies]
indexmap = { version="1.7", features=["serde-1"] }

View File

@ -1,10 +1,10 @@
use crate::{selector::begin_selector_query, Selector};
use nu_errors::ShellError;
use nu_plugin::Plugin;
use nu_protocol::{
CallInfo, Primitive, ReturnSuccess, ReturnValue, Signature, SyntaxShape, UntaggedValue, Value,
};
use crate::{selector::begin_selector_query, Selector};
use scraper::Selector as ScraperSelector;
impl Plugin for Selector {
fn config(&mut self) -> Result<Signature, ShellError> {
@ -63,6 +63,13 @@ impl Plugin for Selector {
}
fn filter(&mut self, input: Value) -> Result<Vec<ReturnValue>, ShellError> {
if !self.query.is_empty() && ScraperSelector::parse(&self.query).is_err() {
return Err(ShellError::labeled_error(
"Can not parse this query as a valid css selector",
"Parse error",
&self.tag,
));
}
match input {
Value {
value: UntaggedValue::Primitive(Primitive::String(s)),

View File

@ -1,7 +1,7 @@
use crate::Table;
use nipper::Document;
use nu_protocol::{value::StringExt, Primitive, TaggedDictBuilder, UntaggedValue, Value};
use nu_source::Tag;
use scraper::{Html, Selector as ScraperSelector};
pub struct Selector {
pub query: String,
@ -35,7 +35,7 @@ impl Default for Selector {
}
pub fn begin_selector_query(input_html: String, selector: &Selector) -> Vec<Value> {
if selector.as_table.is_some() {
if !selector.as_table.value.is_string() {
retrieve_tables(input_html.as_str(), &selector.as_table, selector.inspect)
} else {
match selector.attribute.is_empty() {
@ -166,13 +166,14 @@ fn execute_selector_query_with_attribute(
query_string: &str,
attribute: &str,
) -> Vec<Value> {
let doc = Document::from(input_string);
let doc = Html::parse_fragment(input_string);
doc.select(query_string)
.iter()
doc.select(&css(query_string))
.map(|selection| {
selection
.attr_or(attribute, "")
.value()
.attr(attribute)
.unwrap_or("")
.to_string()
.to_string_value_create_tag()
})
@ -180,57 +181,51 @@ fn execute_selector_query_with_attribute(
}
fn execute_selector_query(input_string: &str, query_string: &str, as_html: bool) -> Vec<Value> {
let doc = Document::from(input_string);
let doc = Html::parse_fragment(input_string);
match as_html {
true => doc
.select(query_string)
.iter()
.map(|selection| selection.html().to_string().to_string_value_create_tag())
.select(&css(query_string))
.map(|selection| selection.html().to_string_value_create_tag())
.collect(),
false => doc
.select(query_string)
.iter()
.map(|selection| selection.text().to_string().to_string_value_create_tag())
.select(&css(query_string))
.map(|selection| {
selection
.text()
.fold("".to_string(), |acc, x| format!("{}{}", acc, x))
.to_string_value_create_tag()
})
.collect(),
}
}
pub fn css(selector: &str) -> ScraperSelector {
ScraperSelector::parse(selector).expect("this should never trigger")
}
#[cfg(test)]
mod tests {
use nipper::Document;
use super::*;
const SIMPLE_LIST: &'static str = r#"
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
"#;
#[test]
fn create_document_from_string() {
let html = r#"<div name="foo" value="bar"></div>"#;
let document = Document::from(html);
let shouldbe =
r#"<html><head></head><body><div name="foo" value="bar"></div></body></html>"#;
assert_eq!(shouldbe.to_string(), document.html().to_string());
fn test_first_child_is_not_empty() {
assert!(!execute_selector_query(SIMPLE_LIST, "li:first-child", false).is_empty())
}
#[test]
fn modify_html_document() {
let html = r#"<div name="foo" value="bar"></div>"#;
let document = Document::from(html);
let mut input = document.select(r#"div[name="foo"]"#);
input.set_attr("id", "input");
input.remove_attr("name");
let shouldbe = "bar".to_string();
let actual = input.attr("value").unwrap().to_string();
assert_eq!(shouldbe, actual);
fn test_first_child() {
assert_eq!(
vec!["Coffee".to_string().to_string_value_create_tag()],
execute_selector_query(SIMPLE_LIST, "li:first-child", false)
)
}
// #[test]
// fn test_hacker_news() -> Result<(), ShellError> {
// let html = reqwest::blocking::get("https://news.ycombinator.com")?.text()?;
// let document = Document::from(&html);
// let result = query(html, ".hnname a".to_string(), Tag::unknown());
// let shouldbe = Ok(vec!["Hacker News".to_str_value_create_tag()]);
// assert_eq!(shouldbe, result);
// Ok(())
// }
}

View File

@ -1,3 +1,4 @@
use crate::selector::css;
use scraper::{element_ref::ElementRef, Html, Selector as ScraperSelector};
use std::collections::HashMap;
@ -263,10 +264,6 @@ impl<'a> IntoIterator for Row<'a> {
}
}
fn css(selector: &'static str) -> ScraperSelector {
ScraperSelector::parse(selector).expect("Unable to parse selector with scraper")
}
fn select_cells(
element: ElementRef,
selector: &ScraperSelector,
@ -343,23 +340,23 @@ mod tests {
use indexmap::indexmap;
use nu_protocol::UntaggedValue;
const TABLE_EMPTY: &'static str = r#"
const TABLE_EMPTY: &str = r#"
<table></table>
"#;
const TABLE_TH: &'static str = r#"
const TABLE_TH: &str = r#"
<table>
<tr><th>Name</th><th>Age</th></tr>
</table>
"#;
const TABLE_TD: &'static str = r#"
const TABLE_TD: &str = r#"
<table>
<tr><td>Name</td><td>Age</td></tr>
</table>
"#;
const TWO_TABLES_TD: &'static str = r#"
const TWO_TABLES_TD: &str = r#"
<table>
<tr><td>Name</td><td>Age</td></tr>
</table>
@ -368,14 +365,14 @@ mod tests {
</table>
"#;
const TABLE_TH_TD: &'static str = r#"
const TABLE_TH_TD: &str = r#"
<table>
<tr><th>Name</th><th>Age</th></tr>
<tr><td>John</td><td>20</td></tr>
</table>
"#;
const TWO_TABLES_TH_TD: &'static str = r#"
const TWO_TABLES_TH_TD: &str = r#"
<table>
<tr><th>Name</th><th>Age</th></tr>
<tr><td>John</td><td>20</td></tr>
@ -386,21 +383,21 @@ mod tests {
</table>
"#;
const TABLE_TD_TD: &'static str = r#"
const TABLE_TD_TD: &str = r#"
<table>
<tr><td>Name</td><td>Age</td></tr>
<tr><td>John</td><td>20</td></tr>
</table>
"#;
const TABLE_TH_TH: &'static str = r#"
const TABLE_TH_TH: &str = r#"
<table>
<tr><th>Name</th><th>Age</th></tr>
<tr><th>John</th><th>20</th></tr>
</table>
"#;
const TABLE_COMPLEX: &'static str = r#"
const TABLE_COMPLEX: &str = r#"
<table>
<tr><th>Name</th><th>Age</th><th>Extra</th></tr>
<tr><td>John</td><td>20</td></tr>
@ -410,7 +407,7 @@ mod tests {
</table>
"#;
const TWO_TABLES_COMPLEX: &'static str = r#"
const TWO_TABLES_COMPLEX: &str = r#"
<!doctype HTML>
<html>
<head><title>foo</title></head>
@ -433,7 +430,7 @@ mod tests {
</html>
"#;
const HTML_NO_TABLE: &'static str = r#"
const HTML_NO_TABLE: &str = r#"
<!doctype HTML>
<html>
<head><title>foo</title></head>
@ -441,7 +438,7 @@ mod tests {
</html>
"#;
const HTML_TWO_TABLES: &'static str = r#"
const HTML_TWO_TABLES: &str = r#"
<!doctype HTML>
<html>
<head><title>foo</title></head>
@ -458,7 +455,7 @@ mod tests {
</html>
"#;
const HTML_TABLE_FRAGMENT: &'static str = r#"
const HTML_TABLE_FRAGMENT: &str = r#"
<table id="first">
<tr><th>Name</th><th>Age</th></tr>
<tr><td>John</td><td>20</td></tr>
@ -467,7 +464,7 @@ mod tests {
</html>
"#;
const HTML_TABLE_WIKIPEDIA_WITH_COLUMN_NAMES: &'static str = r#"
const HTML_TABLE_WIKIPEDIA_WITH_COLUMN_NAMES: &str = r#"
<table class="wikitable">
<caption>Excel 2007 formats
</caption>
@ -515,7 +512,7 @@ mod tests {
</td></tr></tbody></table>
"#;
const HTML_TABLE_WIKIPEDIA_COLUMNS_AS_ROWS: &'static str = r#"
const HTML_TABLE_WIKIPEDIA_COLUMNS_AS_ROWS: &str = r#"
<table class="infobox vevent">
<caption class="infobox-title summary">
Microsoft Excel

View File

@ -4,21 +4,21 @@ description = "A plugin to open files/URLs directly from Nushell"
edition = "2018"
license = "MIT"
name = "nu_plugin_start"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
glob = "0.3.0"
nu-errors = { path="../nu-errors", version = "0.38.0" }
nu-plugin = { path="../nu-plugin", version = "0.38.0" }
nu-protocol = { path="../nu-protocol", version = "0.38.0" }
nu-source = { path="../nu-source", version = "0.38.0" }
nu-errors = { path="../nu-errors", version = "0.39.0" }
nu-plugin = { path="../nu-plugin", version = "0.39.0" }
nu-protocol = { path="../nu-protocol", version = "0.39.0" }
nu-source = { path="../nu-source", version = "0.39.0" }
open = "1.4.0"
url = "2.2.0"
webbrowser = "0.5.5"
[build-dependencies]
nu-errors = { version = "0.38.0", path="../nu-errors" }
nu-source = { version = "0.38.0", path="../nu-source" }
nu-errors = { version = "0.39.0", path="../nu-errors" }
nu-source = { version = "0.39.0", path="../nu-source" }

View File

@ -4,17 +4,17 @@ description = "Text viewer plugin for Nushell"
edition = "2018"
license = "MIT"
name = "nu_plugin_textview"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
nu-data = { path="../nu-data", version = "0.38.0" }
nu-errors = { path="../nu-errors", version = "0.38.0" }
nu-plugin = { path="../nu-plugin", version = "0.38.0" }
nu-protocol = { path="../nu-protocol", version = "0.38.0" }
nu-source = { path="../nu-source", version = "0.38.0" }
nu-data = { path="../nu-data", version = "0.39.0" }
nu-errors = { path="../nu-errors", version = "0.39.0" }
nu-plugin = { path="../nu-plugin", version = "0.39.0" }
nu-protocol = { path="../nu-protocol", version = "0.39.0" }
nu-source = { path="../nu-source", version = "0.39.0" }
bat = { version="0.18", features=["regex-fancy", "paging", "git"] }
term_size = "0.3.2"

View File

@ -36,7 +36,7 @@ pub fn view_text_value(value: &Value) {
let config = nu_data::config::config(Tag::unknown())
.ok()
.and_then(|config| config.get("textview").map(Config::from))
.unwrap_or_else(Config::default);
.unwrap_or_default();
if let UntaggedValue::Primitive(Primitive::String(ref s)) = &value.value {
let mut printer = bat::PrettyPrinter::new();

View File

@ -4,17 +4,17 @@ description = "A converter plugin to the bson format for Nushell"
edition = "2018"
license = "MIT"
name = "nu_plugin_to_bson"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
bson = "0.14.1"
nu-errors = { path="../nu-errors", version = "0.38.0" }
nu-plugin = { path="../nu-plugin", version = "0.38.0" }
nu-protocol = { path="../nu-protocol", version = "0.38.0" }
nu-source = { path="../nu-source", version = "0.38.0" }
nu-errors = { path="../nu-errors", version = "0.39.0" }
nu-plugin = { path="../nu-plugin", version = "0.39.0" }
nu-protocol = { path="../nu-protocol", version = "0.39.0" }
nu-source = { path="../nu-source", version = "0.39.0" }
num-traits = "0.2.14"
[features]

View File

@ -4,17 +4,17 @@ description = "A converter plugin to the SQLite format for Nushell"
edition = "2018"
license = "MIT"
name = "nu_plugin_to_sqlite"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
hex = "0.4.2"
nu-errors = { path="../nu-errors", version = "0.38.0" }
nu-plugin = { path="../nu-plugin", version = "0.38.0" }
nu-protocol = { path="../nu-protocol", version = "0.38.0" }
nu-source = { path="../nu-source", version = "0.38.0" }
nu-errors = { path="../nu-errors", version = "0.39.0" }
nu-plugin = { path="../nu-plugin", version = "0.39.0" }
nu-protocol = { path="../nu-protocol", version = "0.39.0" }
nu-source = { path="../nu-source", version = "0.39.0" }
tempfile = "3.2.0"
[dependencies.rusqlite]

View File

@ -4,16 +4,16 @@ description = "Tree viewer plugin for Nushell"
edition = "2018"
license = "MIT"
name = "nu_plugin_tree"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
derive-new = "0.5.8"
nu-errors = { path="../nu-errors", version = "0.38.0" }
nu-plugin = { path="../nu-plugin", version = "0.38.0" }
nu-protocol = { path="../nu-protocol", version = "0.38.0" }
nu-errors = { path="../nu-errors", version = "0.39.0" }
nu-plugin = { path="../nu-plugin", version = "0.39.0" }
nu-protocol = { path="../nu-protocol", version = "0.39.0" }
ptree = { version = "0.3.1", default-features = false }

View File

@ -4,16 +4,16 @@ description = "Traverses xml"
edition = "2018"
license = "MIT"
name = "nu_plugin_xpath"
version = "0.38.0"
version = "0.39.0"
[lib]
doctest = false
[dependencies]
nu-errors = { version = "0.38.0", path="../nu-errors" }
nu-plugin = { path="../nu-plugin", version = "0.38.0" }
nu-protocol = { version = "0.38.0", path="../nu-protocol" }
nu-source = { version = "0.38.0", path="../nu-source" }
nu-errors = { version = "0.39.0", path="../nu-errors" }
nu-plugin = { path="../nu-plugin", version = "0.39.0" }
nu-protocol = { version = "0.39.0", path="../nu-protocol" }
nu-source = { version = "0.39.0", path="../nu-source" }
bigdecimal = { package = "bigdecimal-rs", version = "0.2.1", features = ["serde"] }
indexmap = { version="1.6.1", features=["serde-1"] }
@ -21,4 +21,4 @@ sxd-document = "0.3.2"
sxd-xpath = "0.4.2"
[dev-dependencies]
nu-test-support = { path="../nu-test-support", version = "0.38.0" }
nu-test-support = { path="../nu-test-support", version = "0.39.0" }

View File

@ -86,7 +86,7 @@ version = "0.4.6"
[dependencies.cursive]
default-features = false
features = ["pancurses-backend"]
version = "0.38.0"
version = "0.39.0"
[dependencies.futures-preview]
features = ["compat", "io-compat"]