yerba 0.1.2 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +492 -15
- data/exe/x86_64-linux/yerba +0 -0
- data/ext/yerba/extconf.rb +87 -30
- data/ext/yerba/include/yerba.h +168 -0
- data/ext/yerba/yerba.c +752 -0
- data/lib/yerba/collection.rb +31 -0
- data/lib/yerba/document.rb +59 -0
- data/lib/yerba/formatting.rb +18 -0
- data/lib/yerba/location.rb +5 -0
- data/lib/yerba/map.rb +166 -0
- data/lib/yerba/scalar.rb +85 -0
- data/lib/yerba/sequence.rb +182 -0
- data/lib/yerba/version.rb +1 -1
- data/lib/yerba.rb +32 -4
- data/rust/Cargo.lock +378 -2
- data/rust/Cargo.toml +5 -1
- data/rust/build.rs +11 -0
- data/rust/cbindgen.toml +27 -0
- data/rust/src/commands/apply.rs +5 -0
- data/rust/src/commands/blank_lines.rs +58 -0
- data/rust/src/commands/check.rs +5 -0
- data/rust/src/commands/delete.rs +35 -0
- data/rust/src/commands/get.rs +194 -0
- data/rust/src/commands/init.rs +89 -0
- data/rust/src/commands/insert.rs +106 -0
- data/rust/src/commands/mate.rs +55 -0
- data/rust/src/commands/mod.rs +349 -0
- data/rust/src/commands/move_item.rs +54 -0
- data/rust/src/commands/move_key.rs +87 -0
- data/rust/src/commands/quote_style.rs +62 -0
- data/rust/src/commands/remove.rs +35 -0
- data/rust/src/commands/rename.rs +37 -0
- data/rust/src/commands/set.rs +59 -0
- data/rust/src/commands/sort.rs +52 -0
- data/rust/src/commands/sort_keys.rs +62 -0
- data/rust/src/commands/version.rs +8 -0
- data/rust/src/document.rs +764 -333
- data/rust/src/error.rs +0 -5
- data/rust/src/ffi.rs +991 -0
- data/rust/src/json.rs +49 -90
- data/rust/src/lib.rs +9 -2
- data/rust/src/main.rs +55 -843
- data/rust/src/selector.rs +241 -0
- data/rust/src/syntax.rs +97 -21
- data/rust/src/yaml_writer.rs +89 -0
- data/rust/src/yerbafile.rs +11 -126
- data/yerba.gemspec +5 -0
- metadata +34 -1
data/rust/src/error.rs
CHANGED
|
@@ -6,7 +6,6 @@ pub enum YerbaError {
|
|
|
6
6
|
NotASequence(String),
|
|
7
7
|
IndexOutOfBounds(usize, usize),
|
|
8
8
|
UnknownKeys(Vec<String>),
|
|
9
|
-
ReferenceNotFound(String),
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
impl std::fmt::Display for YerbaError {
|
|
@@ -21,10 +20,6 @@ impl std::fmt::Display for YerbaError {
|
|
|
21
20
|
write!(f, "index {} out of bounds (length {})", index, length)
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
YerbaError::ReferenceNotFound(reference) => {
|
|
25
|
-
write!(f, "template reference not found: ${{{}}}", reference)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
23
|
YerbaError::UnknownKeys(keys) => {
|
|
29
24
|
let suggestion = keys
|
|
30
25
|
.iter()
|