Skip to content

v0.10.0

Choose a tag to compare

@marcoroth marcoroth released this 14 Oct 08:50
· 4 commits to main since this release
ff2688d

Added

  • Document#nodes, which builds every node of a document in one pass and keeps it until the document is edited by @marcoroth in #83
  • A count on Sequence#first and Sequence#last, like Array#first(n) by @marcoroth in #84
  • A count on QueryResult#first and QueryResult#last by @marcoroth in #84
  • Sort keys separated by spaces, like by: ".date .start_time", in the Yerbafile, the CLI and Ruby by @marcoroth in #85
  • An Array of fields for by: on Document#sort, like by: [:date, :start_time] by @marcoroth in #85
  • An explicit order as a comma-separated String for order: on Document#sort, like order: "c,a,b" by @marcoroth in #85
  • order: on Sequence#sort by @marcoroth in #85
  • Negative indexes in selectors, like tags[-1] for the last item, in get, value_at, delete and chained Ruby access by @LunaMeerkats in #67
  • Negative indexes in Yerba::Selector, as negative Integers like ["tags", -1] by @LunaMeerkats in #67
  • A "flow" style for Yerba.quote_scalar, for strings inside flow collections by @marcoroth in #90
  • Location#start_character_column and Location#end_character_column, which count characters and match the columns Herb reports by @marcoroth in #91
  • ControlCharacter#character_column by @marcoroth in #91

Changed

  • Document#[], Document#value_at and the each, value_at and length methods of Map and Sequence read from Document#nodes instead of calling into the extension for every node and field by @marcoroth in #83
  • Yerba::Collection.get and other reads that return locations index the line starts of a document once, instead of rescanning the source for every node. They were quadratic in the size of the file by @nevinera in #79
  • Document#nodes and the located reads share one cached line index per document by @marcoroth in #79
  • SelectorSegment has a new IndexFromEnd variant, which is source-breaking for Rust code that matches on it exhaustively by @LunaMeerkats in #67
  • Bracket segments that are neither empty nor an index, like tags[abc], are kept as a key that matches nothing. Reads return nil and writes raise selector not found, where they used to select tags by @marcoroth in #86
  • The writers quote every string that Psych would load as another type: dates and timestamps, sexagesimal numbers like 12:30:00, case-insensitive booleans and nulls, symbols, and numbers written with _, ,, 0b or a leading 0 by @marcoroth in #90
  • Strings inside flow collections are quoted when they need it, so ["yes", "x, y"] no longer writes [yes, x, y] by @marcoroth in #90
  • Location columns follow Prism::Location: lines are 1-based and columns 0-based. directive_locations and ControlCharacter use 0-based columns too by @marcoroth in #91
  • Plain scalars are read the way Psych reads them, so 0755 is 493, 1:30 is 5400, 1,000 is 1000, and .inf and .nan are floats. Forms Psych keeps as strings, like 08 and 1e5, stay strings by @marcoroth in #93
  • selector: replaces path: in Yerbafile steps. path: still works and prints a deprecation warning by @marcoroth in #94
  • selector: replaces path: on Document#condition? and Document#quote_style. path: still works and prints a deprecation warning by @marcoroth in #94
  • In the Rust crate, SortField::path is SortField::selector, Selector::parent_path is Selector::parent_selector and Document::validate_path is Document::validate_selector by @marcoroth in #94

Fixed

  • insert_object with a condition, like after: ".id == a", raised Yerba::Error from Ruby by @marcoroth in #85
  • A String order: on Document#sort was ignored without an error by @marcoroth in #85
  • sequence[-1] returned the sequence itself instead of its last item by @LunaMeerkats in #67
  • Sequence#concat wrapped every scalar in a value: hash by @marcoroth in #86
  • Assigning a collection to the first key of a map moved the key to the end by @marcoroth in #86
  • set --if-missing and Document#set(..., if_missing: true) always failed, and now insert the value when the selector doesn't exist by @marcoroth in #86
  • collection_style= split entries at a colon inside a quoted key like "a:b" by @marcoroth in #86
  • Scalar#value returned the old value after the document was edited by @marcoroth in #87
  • set on a key without a value, like nickname:, raised selector not found by @marcoroth in #90
  • Assigning a collection to the only key of a map raised at the root and wrote YAML that no longer parsed when nested by @marcoroth in #90
  • A where result returned items that no longer matched after the sequence was edited by @marcoroth in #92
  • 0x1F read as 0 through a node but as "0x1F" through Document#values by @marcoroth in #93
  • Document#values raised ArgumentError with json 3 by @marcoroth in #96

New Contributors

Commits

Full Changelog: v0.9.2...v0.10.0