tree_haver 3.2.1 → 3.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3da36f96aa78d0995c76a3cbd6451889066b65d219414938e098ef9949df317f
4
- data.tar.gz: 11e11da6c9f53e439d4226700c981466c3b47f0b9411d2e97a5211edade8d81d
3
+ metadata.gz: db807cd904d2fd3878705c02e63288b1c650853c3509431abf23d3ac4f9e83e2
4
+ data.tar.gz: d6e9e8299e6dc85a8d856f8a93ae592fe823d5da94cbc624cf1c0bcdafa9adcc
5
5
  SHA512:
6
- metadata.gz: 1dce9daf70fc5573d579d699724601756db9758170fdb0e7be759ea9572a3d02fa491766786c708172e0f66c2473ae9e0da97fb20bddf7b185d93e285cc8bd3e
7
- data.tar.gz: eaf3a3649233933b523a7f8e49831b7d5c7f00da268d805c7cbc043176424b5b4214da607bbe7e57e03dcd9072269dfedf3feba4383a828e6cb1abb89394b5c8
6
+ metadata.gz: f8b457ef8362cf164d91da763776bd273b9d04f96fca557f597a54b42b102b2b1b8ee5b0a7e98335a12bbe072945b0fd1205e351a4afa4e9e106542263450c70
7
+ data.tar.gz: afca005da881caf5cbfdc7e8317e0accf9fca803a2d1582a510daaf1da5f80e46c9987a4f71913366503eee5f30e1dba4dd7ad7d7eaec6821ef9c2f2edbccf11
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,21 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [3.2.2] - 2026-01-01
34
+
35
+ - TAG: [v3.2.2][3.2.2t]
36
+ - COVERAGE: 94.79% -- 2076/2190 lines in 22 files
37
+ - BRANCH COVERAGE: 81.35% -- 733/901 branches in 22 files
38
+ - 90.14% documented
39
+
40
+ ### Fixed
41
+
42
+ - RSpec dependency tags now respect `TREE_HAVER_BACKEND` environment variable
43
+ - When `TREE_HAVER_BACKEND=ffi` is set, MRI backend availability is not checked
44
+ - Prevents `BackendConflict` errors when loading gems that use tree-sitter grammars
45
+ - The `blocked_backends` set now includes backends that would conflict with the explicitly selected backend
46
+ - This allows `*-merge` gems to load correctly in test suites when a specific backend is selected
47
+
33
48
  ## [3.2.1] - 2025-12-31
34
49
 
35
50
  - TAG: [v3.2.1][3.2.1t]
@@ -659,7 +674,9 @@ Despite the major version bump to 3.0.0 (following semver due to the breaking `L
659
674
 
660
675
  - Initial release
661
676
 
662
- [Unreleased]: https://github.com/kettle-rb/tree_haver/compare/v3.2.1...HEAD
677
+ [Unreleased]: https://github.com/kettle-rb/tree_haver/compare/v3.2.2...HEAD
678
+ [3.2.2]: https://github.com/kettle-rb/tree_haver/compare/v3.2.1...v3.2.2
679
+ [3.2.2t]: https://github.com/kettle-rb/tree_haver/releases/tag/v3.2.2
663
680
  [3.2.1]: https://github.com/kettle-rb/tree_haver/compare/v3.2.0...v3.2.1
664
681
  [3.2.1t]: https://github.com/kettle-rb/tree_haver/releases/tag/v3.2.1
665
682
  [3.2.0]: https://github.com/kettle-rb/tree_haver/compare/v3.1.2...v3.2.0
@@ -775,9 +775,30 @@ RSpec.configure do |config|
775
775
  }
776
776
 
777
777
  # Determine which backends should NOT have availability checked
778
- # based on which *_backend_only tag is being run
778
+ # based on which *_backend_only tag is being run OR which backend is
779
+ # explicitly selected via TREE_HAVER_BACKEND environment variable.
779
780
  blocked_backends = Set.new
780
781
 
782
+ # Track whether we're in isolated test mode (running *_backend_only tags).
783
+ # This is different from just having TREE_HAVER_BACKEND set.
784
+ # In isolated mode, we skip ALL grammar checks because they might trigger
785
+ # backend loading via TreeHaver.parser_for's auto-detection.
786
+ # When just TREE_HAVER_BACKEND is set, grammar checks are fine because
787
+ # parser_for will use the selected backend, not auto-detect.
788
+ isolated_test_mode = false
789
+
790
+ # First, check if TREE_HAVER_BACKEND explicitly selects a backend.
791
+ # If so, block all backends that would conflict with it.
792
+ # This prevents loading MRI when TREE_HAVER_BACKEND=ffi, for example.
793
+ env_backend = ENV["TREE_HAVER_BACKEND"]
794
+ if env_backend && !env_backend.empty? && env_backend != "auto"
795
+ backend_sym = env_backend.to_sym
796
+ blockers = TreeHaver::Backends::BLOCKED_BY[backend_sym]
797
+ if blockers
798
+ blockers.each { |blocker| blocked_backends << blocker }
799
+ end
800
+ end
801
+
781
802
  # Check which *_backend_only tags are being run and block their conflicting backends
782
803
  # config.inclusion_filter contains tags passed via --tag on command line
783
804
  inclusion_rules = config.inclusion_filter.rules
@@ -806,6 +827,7 @@ RSpec.configure do |config|
806
827
  # Check if we're running this backend's isolated tests
807
828
  isolated_tag = :"#{backend}_backend_only"
808
829
  if inclusion_rules[isolated_tag]
830
+ isolated_test_mode = true
809
831
  # Add all backends that would block this one
810
832
  blockers.each { |blocker| blocked_backends << blocker }
811
833
  end
@@ -813,6 +835,7 @@ RSpec.configure do |config|
813
835
 
814
836
  # Store blocked_backends in a module variable so before(:suite) can access it
815
837
  TreeHaver::RSpec::DependencyTags.instance_variable_set(:@blocked_backends, blocked_backends)
838
+ TreeHaver::RSpec::DependencyTags.instance_variable_set(:@isolated_test_mode, isolated_test_mode)
816
839
 
817
840
  # Now configure exclusions, skipping availability checks for blocked backends
818
841
  backend_tags.each do |backend, tag|
@@ -847,9 +870,10 @@ RSpec.configure do |config|
847
870
  # loading blocked backends. The grammar checks use TreeHaver.parser_for which
848
871
  # would load the default backend (MRI) and block FFI.
849
872
 
850
- # Skip grammar availability checks if any backend is blocked
851
- # (i.e., we're running isolated backend tests)
852
- if blocked_backends.none?
873
+ # Skip grammar availability checks only when in isolated test mode.
874
+ # When TREE_HAVER_BACKEND is explicitly set (but not using *_backend_only tags),
875
+ # grammar checks are fine because TreeHaver.parser_for respects the env var.
876
+ unless isolated_test_mode
853
877
  config.filter_run_excluding(libtree_sitter: true) unless deps.libtree_sitter_available?
854
878
  config.filter_run_excluding(bash_grammar: true) unless deps.tree_sitter_bash_available?
855
879
  config.filter_run_excluding(toml_grammar: true) unless deps.tree_sitter_toml_available?
@@ -868,7 +892,7 @@ RSpec.configure do |config|
868
892
  # NOTE: any_toml_backend_available? calls tree_sitter_toml_available? which
869
893
  # triggers grammar_works? and loads MRI. Skip when running isolated tests.
870
894
 
871
- if blocked_backends.none?
895
+ unless isolated_test_mode
872
896
  config.filter_run_excluding(toml_parsing: true) unless deps.any_toml_backend_available?
873
897
  config.filter_run_excluding(markdown_parsing: true) unless deps.any_markdown_backend_available?
874
898
  config.filter_run_excluding(native_parsing: true) unless deps.any_native_grammar_available?
@@ -907,7 +931,7 @@ RSpec.configure do |config|
907
931
  config.filter_run_excluding(not_truffleruby_engine: true) if deps.truffleruby?
908
932
 
909
933
  # Tree-sitter grammars - skip when running isolated backend tests
910
- if blocked_backends.none?
934
+ unless isolated_test_mode
911
935
  config.filter_run_excluding(not_libtree_sitter: true) if deps.libtree_sitter_available?
912
936
  config.filter_run_excluding(not_bash_grammar: true) if deps.tree_sitter_bash_available?
913
937
  config.filter_run_excluding(not_toml_grammar: true) if deps.tree_sitter_toml_available?
@@ -10,7 +10,7 @@ module TreeHaver
10
10
  # Current version of the tree_haver gem
11
11
  #
12
12
  # @return [String] the version string (e.g., "3.0.0")
13
- VERSION = "3.2.1"
13
+ VERSION = "3.2.2"
14
14
  end
15
15
 
16
16
  # Traditional location for VERSION constant
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tree_haver
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -292,10 +292,10 @@ licenses:
292
292
  - MIT
293
293
  metadata:
294
294
  homepage_uri: https://tree-haver.galtzo.com/
295
- source_code_uri: https://github.com/kettle-rb/tree_haver/tree/v3.2.1
296
- changelog_uri: https://github.com/kettle-rb/tree_haver/blob/v3.2.1/CHANGELOG.md
295
+ source_code_uri: https://github.com/kettle-rb/tree_haver/tree/v3.2.2
296
+ changelog_uri: https://github.com/kettle-rb/tree_haver/blob/v3.2.2/CHANGELOG.md
297
297
  bug_tracker_uri: https://github.com/kettle-rb/tree_haver/issues
298
- documentation_uri: https://www.rubydoc.info/gems/tree_haver/3.2.1
298
+ documentation_uri: https://www.rubydoc.info/gems/tree_haver/3.2.2
299
299
  funding_uri: https://github.com/sponsors/pboling
300
300
  wiki_uri: https://github.com/kettle-rb/tree_haver/wiki
301
301
  news_uri: https://www.railsbling.com/tags/tree_haver
metadata.gz.sig CHANGED
Binary file