Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ElectronBuilder: Allow Date/Time deserialization #14205

Commits on Dec 6, 2022

  1. ElectronBuilder: Allow Date/Time deserialization

    The `ElectronBuilder` strategy uses `YAML#safe_load` to parse YAML
    content and this limits deserialization to appropriate classes. We
    recently encountered a `Tried to load unspecified class: Time` error
    when using the `ElectronBuilder` strategy on a `latest-mac.yml` file
    containing `releaseDate: 2022-12-01T02:02:46.419Z`.
    
    The electron-builder YAML files we usually encounter use single
    quotes around the `releaseDate` value to ensure it's treated as a
    string (e.g., `releaseDate: '2022-10-12T17:55:26.718Z'`) and this is
    what we do in `electron_builder_spec.rb`. The aforementioned YAML
    file doesn't use single quotes around the value, so it's treated as
    a timestamp and apparently this makes Psych use `Time` (which
    `#safe_load` doesn't allow by default).
    
    Seeing as we can't control the YAML content and there's a chance we
    may encounter other files like this in the future, this commit
    modifies the related `#safe_load` call to allow `Time` (and `Date`
    for good measure). This will resolve the aforementioned error and
    allow the `ElectronBuilder` strategy to work as expected in this
    scenario.
    samford committed Dec 6, 2022
    Configuration menu
    Copy the full SHA
    e56735a View commit details
    Browse the repository at this point in the history