yerba 0.6.0-arm-linux-gnu → 0.6.1-arm-linux-gnu
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/exe/arm-linux-gnu/yerba +0 -0
- data/lib/yerba/3.2/yerba.so +0 -0
- data/lib/yerba/3.3/yerba.so +0 -0
- data/lib/yerba/3.4/yerba.so +0 -0
- data/lib/yerba/4.0/yerba.so +0 -0
- data/lib/yerba/version.rb +1 -1
- data/rust/Cargo.lock +1 -1
- data/rust/Cargo.toml +1 -1
- data/rust/src/document/style.rs +17 -0
- data/rust/src/yerbafile.rs +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 116d9d28b40616e8680a4f649b5ccece17e7a6b052fc257c5111aed8782e4003
|
|
4
|
+
data.tar.gz: b0e62b3fd1227373bdef5100ed6be3364be14757402c272122c61c783866794d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f6c959aa431438f6d06ee975e2dbc4fb1209e624d61db25b00875914d3607242c1c2bbada8d6ca72f47451432b3dda9fa9715e2d18684cde1a7bd7517188cc4a
|
|
7
|
+
data.tar.gz: 3bdab659cf3ebfc4fe0c21d6c7264eeee249c3362cff51feb4dd7a4b6917c0c12ea264d350572f7321c639ce2a0d56ef043793929b875539ff34b3c2661a3474
|
data/exe/arm-linux-gnu/yerba
CHANGED
|
Binary file
|
data/lib/yerba/3.2/yerba.so
CHANGED
|
Binary file
|
data/lib/yerba/3.3/yerba.so
CHANGED
|
Binary file
|
data/lib/yerba/3.4/yerba.so
CHANGED
|
Binary file
|
data/lib/yerba/4.0/yerba.so
CHANGED
|
Binary file
|
data/lib/yerba/version.rb
CHANGED
data/rust/Cargo.lock
CHANGED
data/rust/Cargo.toml
CHANGED
data/rust/src/document/style.rs
CHANGED
|
@@ -674,6 +674,23 @@ impl Document {
|
|
|
674
674
|
self.root.descendants_with_tokens().any(|element| element.kind() == SyntaxKind::DIRECTIVES_END)
|
|
675
675
|
}
|
|
676
676
|
|
|
677
|
+
pub fn directive_locations(&self) -> Vec<(usize, usize)> {
|
|
678
|
+
let source = self.root.text().to_string();
|
|
679
|
+
|
|
680
|
+
self
|
|
681
|
+
.root
|
|
682
|
+
.descendants_with_tokens()
|
|
683
|
+
.filter(|element| element.kind() == SyntaxKind::DIRECTIVES_END)
|
|
684
|
+
.map(|element| {
|
|
685
|
+
let offset: usize = element.text_range().start().into();
|
|
686
|
+
let line = source[..offset].matches('\n').count() + 1;
|
|
687
|
+
let column = offset - source[..offset].rfind('\n').map(|position| position + 1).unwrap_or(0) + 1;
|
|
688
|
+
|
|
689
|
+
(line, column)
|
|
690
|
+
})
|
|
691
|
+
.collect()
|
|
692
|
+
}
|
|
693
|
+
|
|
677
694
|
pub fn ensure_directives(&mut self) -> Result<(), YerbaError> {
|
|
678
695
|
if self.has_directives_marker() {
|
|
679
696
|
return Ok(());
|
data/rust/src/yerbafile.rs
CHANGED
|
@@ -66,6 +66,8 @@ pub struct DirectivesConfig {
|
|
|
66
66
|
pub ensure: bool,
|
|
67
67
|
#[serde(default)]
|
|
68
68
|
pub remove: bool,
|
|
69
|
+
#[serde(default)]
|
|
70
|
+
pub max: Option<usize>,
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
#[derive(Debug, Clone, Deserialize)]
|
|
@@ -675,6 +677,21 @@ fn execute_step(document: &mut Document, step: &PipelineStep, base_path: Option<
|
|
|
675
677
|
return Err(YerbaError::ParseError("directives: ensure and remove are mutually exclusive".to_string()));
|
|
676
678
|
}
|
|
677
679
|
|
|
680
|
+
if let Some(max) = config.max {
|
|
681
|
+
let locations = document.directive_locations();
|
|
682
|
+
|
|
683
|
+
if locations.len() > max {
|
|
684
|
+
let positions: Vec<String> = locations.iter().map(|(line, col)| format!("{}:{}", line, col)).collect();
|
|
685
|
+
|
|
686
|
+
return Err(YerbaError::ParseError(format!(
|
|
687
|
+
"found {} directive markers (---) at {}, expected at most {}",
|
|
688
|
+
locations.len(),
|
|
689
|
+
positions.join(", "),
|
|
690
|
+
max
|
|
691
|
+
)));
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
|
|
678
695
|
if config.ensure {
|
|
679
696
|
document.ensure_directives()
|
|
680
697
|
} else if config.remove {
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yerba
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.1
|
|
5
5
|
platform: arm-linux-gnu
|
|
6
6
|
authors:
|
|
7
7
|
- Marco Roth
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06-
|
|
11
|
+
date: 2026-06-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A CLI tool for editing YAML while preserving structure, comments, and
|
|
14
14
|
format.
|