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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf42e332c712a66c4303193ff8e39cf91c499707246923168fb103ea46eecf52
4
- data.tar.gz: c0d76d0345ebbbf8f4f07b2182d83a12a131a2388d8c0c3606a3a6b35d778a27
3
+ metadata.gz: 116d9d28b40616e8680a4f649b5ccece17e7a6b052fc257c5111aed8782e4003
4
+ data.tar.gz: b0e62b3fd1227373bdef5100ed6be3364be14757402c272122c61c783866794d
5
5
  SHA512:
6
- metadata.gz: c8edf88e0de46be9b4781ec68b4133d0d8c8936f322724694fa8454c7fc3468f1864f2d5928c1bf0a601126b236871602a6780442369e5609cff5871548b8e1b
7
- data.tar.gz: 215d8c085524e5b868da7849d6df18be9e735cc46753dda3d663849dad763a6272253d2c013cb3e2cd0d2833e0cc3942d26e7e2f03211ba64ae4a010acfe6146
6
+ metadata.gz: f6c959aa431438f6d06ee975e2dbc4fb1209e624d61db25b00875914d3607242c1c2bbada8d6ca72f47451432b3dda9fa9715e2d18684cde1a7bd7517188cc4a
7
+ data.tar.gz: 3bdab659cf3ebfc4fe0c21d6c7264eeee249c3362cff51feb4dd7a4b6917c0c12ea264d350572f7321c639ce2a0d56ef043793929b875539ff34b3c2661a3474
Binary file
Binary file
Binary file
Binary file
Binary file
data/lib/yerba/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Yerba
4
- VERSION = "0.6.0"
4
+ VERSION = "0.6.1"
5
5
  end
data/rust/Cargo.lock CHANGED
@@ -1772,7 +1772,7 @@ dependencies = [
1772
1772
 
1773
1773
  [[package]]
1774
1774
  name = "yerba"
1775
- version = "0.6.0"
1775
+ version = "0.6.1"
1776
1776
  dependencies = [
1777
1777
  "cbindgen",
1778
1778
  "clap",
data/rust/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "yerba"
3
- version = "0.6.0"
3
+ version = "0.6.1"
4
4
  edition = "2021"
5
5
  authors = ["Marco Roth <marco.roth@intergga.ch>"]
6
6
  description = "YAML Editing and Refactoring with Better Accuracy"
@@ -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(());
@@ -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.0
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-17 00:00:00.000000000 Z
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.