tree_haver 5.0.0 → 5.0.2
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
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +77 -2
- data/README.md +161 -166
- data/lib/tree_haver/backend_api.rb +12 -12
- data/lib/tree_haver/backend_registry.rb +230 -7
- data/lib/tree_haver/grammar_finder.rb +7 -6
- data/lib/tree_haver/parser.rb +5 -3
- data/lib/tree_haver/rspec/dependency_tags.rb +148 -87
- data/lib/tree_haver/rspec/testable_node.rb +217 -0
- data/lib/tree_haver/rspec.rb +11 -1
- data/lib/tree_haver/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +5 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4a84c922fc46d5f2832bfba861dcf1927327de29546752189f6d6488f4286795
|
|
4
|
+
data.tar.gz: 526550b1327829aff144d052d3dcf217295f7d2e27f976735b78573350e3b047
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dce567d8e91b11b01618feab1f3757d4a3651c5282168eea8be88c4704228f2288ab6bf098b8a7bcc7940f3f16af6cf1e544e991e99ecc6de1ee6c1d15ef2d77
|
|
7
|
+
data.tar.gz: c36d6955f70893ec43f247baead4ab70c449508fc744959e0dd485f73316d490c5892c91151527e2e6a714c99b847daeda9b618daca62337b40be5b727a2362e
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
# Changelog
|
|
2
2
|
|
|
3
3
|
[![SemVer 2.0.0][📌semver-img]][📌semver] [![Keep-A-Changelog 1.0.0][📗keep-changelog-img]][📗keep-changelog]
|
|
4
4
|
|
|
@@ -30,6 +30,77 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
30
30
|
|
|
31
31
|
### Security
|
|
32
32
|
|
|
33
|
+
## [5.0.2] - 2026-01-13
|
|
34
|
+
|
|
35
|
+
- TAG: [v5.0.2][5.0.2t]
|
|
36
|
+
- COVERAGE: 90.79% -- 2308/2542 lines in 30 files
|
|
37
|
+
- BRANCH COVERAGE: 78.09% -- 930/1191 branches in 30 files
|
|
38
|
+
- 94.78% documented
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
- More documentation about the Merge Gem Family
|
|
43
|
+
- **`:json_parsing` and `:jsonc_parsing` RSpec dependency tags**: Added missing parsing capability tags
|
|
44
|
+
for JSON and JSONC (JSON with Comments) languages
|
|
45
|
+
- `any_json_backend_available?` - Checks if tree-sitter-json is available
|
|
46
|
+
- `any_jsonc_backend_available?` - Checks if tree-sitter-jsonc is available
|
|
47
|
+
- Tests tagged with `:jsonc_parsing` will now be properly skipped on TruffleRuby and other
|
|
48
|
+
platforms where tree-sitter backends are not available
|
|
49
|
+
- Fixes issue where jsonc-merge specs were running on TruffleRuby and failing because
|
|
50
|
+
the tag was undefined and therefore not excluded
|
|
51
|
+
|
|
52
|
+
### Changed
|
|
53
|
+
|
|
54
|
+
- Restored README.md (was accidentally corrupted during the last release)
|
|
55
|
+
|
|
56
|
+
## [5.0.1] - 2026-01-11
|
|
57
|
+
|
|
58
|
+
- TAG: [v5.0.1][5.0.1t]
|
|
59
|
+
- COVERAGE: 90.79% -- 2308/2542 lines in 30 files
|
|
60
|
+
- BRANCH COVERAGE: 78.09% -- 930/1191 branches in 30 files
|
|
61
|
+
- 94.76% documented
|
|
62
|
+
|
|
63
|
+
### Added
|
|
64
|
+
|
|
65
|
+
- `TreeHaver::RSpec::TestableNode` - A testable node class for creating mock TreeHaver::Node instances
|
|
66
|
+
in tests without requiring an actual parser backend. Available via `require "tree_haver/rspec/testable_node"`
|
|
67
|
+
or automatically when using `require "tree_haver/rspec"`.
|
|
68
|
+
- `TestableNode.create(type:, text:, ...)` - Create a single test node
|
|
69
|
+
- `TestableNode.create_list(...)` - Create multiple test nodes
|
|
70
|
+
- `MockInnerNode` - The underlying mock that simulates backend-specific nodes
|
|
71
|
+
- Top-level `TestableNode` constant for convenience in specs
|
|
72
|
+
- **Fully Dynamic Tag Registration** in `TreeHaver::BackendRegistry`:
|
|
73
|
+
- `register_tag(tag_name, category:, backend_name:, require_path:)` - Register a complete dependency tag
|
|
74
|
+
with lazy loading support. External gems can now get full RSpec tag support without any hardcoded
|
|
75
|
+
knowledge in tree_haver.
|
|
76
|
+
- `tag_available?(tag_name)` - Check if a tag's dependency is available, with automatic lazy loading
|
|
77
|
+
via the registered `require_path`
|
|
78
|
+
- `registered_tags` - Get all registered tag names
|
|
79
|
+
- `tags_by_category(category)` - Get tags filtered by category (:backend, :gem, :parsing, :grammar, :engine, :other)
|
|
80
|
+
- `tag_metadata(tag_name)` - Get full metadata for a registered tag
|
|
81
|
+
- `tag_summary` - Get availability status of all registered tags
|
|
82
|
+
|
|
83
|
+
### Changed
|
|
84
|
+
|
|
85
|
+
- **Fully Dynamic Backend Availability** in `BackendRegistry` and `DependencyTags`:
|
|
86
|
+
- `register_tag` now dynamically defines `*_available?` methods on `DependencyTags` at registration time
|
|
87
|
+
- External gems automatically get availability methods when they call `register_tag`
|
|
88
|
+
- No changes to tree_haver are needed for new external backend gems
|
|
89
|
+
- Built-in backends (prism, psych, citrus, parslet) retain explicit methods
|
|
90
|
+
- `summary` method dynamically includes registered backends from BackendRegistry
|
|
91
|
+
- `backend_availability_methods` and `backend_tags` hashes are built dynamically
|
|
92
|
+
- RSpec exclusion filters for backend tags are configured dynamically from BackendRegistry
|
|
93
|
+
|
|
94
|
+
### Fixed
|
|
95
|
+
|
|
96
|
+
- **`TreeHaver::Parser#unwrap_language` bug fix for MRI and Rust backends**
|
|
97
|
+
- `:mri` and `:rust` cases were not returning the unwrapped language value
|
|
98
|
+
- The code called `lang.to_language` / `lang.inner_language` / `lang.name` but didn't `return` the result
|
|
99
|
+
- Now properly returns the unwrapped language for all backend types
|
|
100
|
+
- `any_markdown_backend_available?` now uses `BackendRegistry.tag_available?` instead of calling
|
|
101
|
+
`markly_available?` and `commonmarker_available?` directly. This fixes `NoMethodError` when
|
|
102
|
+
the external markdown backend gems haven't registered their tags yet.
|
|
103
|
+
|
|
33
104
|
## [5.0.0] - 2026-01-11
|
|
34
105
|
|
|
35
106
|
- TAG: [v5.0.0][5.0.0t]
|
|
@@ -1211,7 +1282,11 @@ Despite the major version bump to 3.0.0 (following semver due to the breaking `L
|
|
|
1211
1282
|
|
|
1212
1283
|
- Initial release
|
|
1213
1284
|
|
|
1214
|
-
[Unreleased]: https://github.com/kettle-rb/tree_haver/compare/v5.0.
|
|
1285
|
+
[Unreleased]: https://github.com/kettle-rb/tree_haver/compare/v5.0.2...HEAD
|
|
1286
|
+
[5.0.2]: https://github.com/kettle-rb/tree_haver/compare/v5.0.1...v5.0.2
|
|
1287
|
+
[5.0.2t]: https://github.com/kettle-rb/tree_haver/releases/tag/v5.0.2
|
|
1288
|
+
[5.0.1]: https://github.com/kettle-rb/tree_haver/compare/v5.0.0...v5.0.1
|
|
1289
|
+
[5.0.1t]: https://github.com/kettle-rb/tree_haver/releases/tag/v5.0.1
|
|
1215
1290
|
[5.0.0]: https://github.com/kettle-rb/tree_haver/compare/v4.0.5...v5.0.0
|
|
1216
1291
|
[5.0.0t]: https://github.com/kettle-rb/tree_haver/releases/tag/v5.0.0
|
|
1217
1292
|
[4.0.5]: https://github.com/kettle-rb/tree_haver/compare/v4.0.4...v4.0.5
|