Skip to content

stdlib: Add missing Psych methods and exception classes#2850

Open
marcoroth wants to merge 1 commit intoruby:masterfrom
marcoroth:psych-load-unsafe-file
Open

stdlib: Add missing Psych methods and exception classes#2850
marcoroth wants to merge 1 commit intoruby:masterfrom
marcoroth:psych-load-unsafe-file

Conversation

@marcoroth
Copy link

This pull request adds missing type declarations for Psych:

Methods

  • Psych.safe_load_file - Safely loads YAML from a file
  • Psych.unsafe_load_file - Loads YAML from a file (unsafe)

Exception Classes

  • Psych::SyntaxError - Raised on YAML syntax errors
  • Psych::Exception - Base exception class
  • Psych::BadAlias - Raised for alias errors
  • Psych::DisallowedClass - Raised when loading disallowed classes

Motivation

These methods and classes are commonly used but were missing from the stdlib declarations, causing type errors in projects using YAML.safe_load_file or rescuing Psych::SyntaxError.

@marcoroth marcoroth changed the title Add missing Psych methods and exception classes stdlib: Add missing Psych methods and exception classes Feb 14, 2026
@marcoroth marcoroth force-pushed the psych-load-unsafe-file branch from 3c68128 to 6ed90f1 Compare February 14, 2026 23:25
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