Skip to content

Fix Prism cross-version compat and spec portability#20

Merged
LeahArmstrong merged 1 commit intomainfrom
fix/prism-and-spec-fixes
Feb 28, 2026
Merged

Fix Prism cross-version compat and spec portability#20
LeahArmstrong merged 1 commit intomainfrom
fix/prism-and-spec-fixes

Conversation

@LeahArmstrong
Copy link
Owner

Summary

  • Add prism_else_clause() helper with respond_to? guards for Prism <1.0 / >=1.0 API differences (consequent vs else_clause vs subsequent)
  • Fix ConstantPathNode name access for Prism versions where .name was renamed to .child.name
  • Replace File.chmod(0o000) with File.read stub in view template spec (chmod has no effect under root/CI)
  • Add missing require 'pathname' in shared extractor context

Extracted from PRs #18 and #19 which both carried identical copies of these fixes. Merging this first eliminates the conflict.

Test plan

  • Full suite: 3151 examples, 0 failures
  • Rubocop: 0 offenses

Add prism_else_clause() helper using respond_to? for Prism <1.0 and
>=1.0 API differences (consequent vs else_clause vs subsequent).
Use respond_to?-guarded name access on ConstantPathNode for versions
where .name was renamed to .child.name.

Replace File.chmod(0o000) with File.read stub in view template spec
for root/CI environments where chmod has no effect. Add missing
require 'pathname' in shared extractor context.
@LeahArmstrong LeahArmstrong merged commit 71ec2d7 into main Feb 28, 2026
5 checks passed
@LeahArmstrong LeahArmstrong deleted the fix/prism-and-spec-fixes branch February 28, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant