Skip to content

Conversation

@epistrephein
Copy link
Contributor

@epistrephein epistrephein commented Dec 4, 2023

In _data/releases.yml, 18 of the total 197 dates under the date: key are represented with quotes instead of without.

This has the side effect that when the file is YAML-parsed, these dates are parsed as Strings instead of Dates, creating an unwanted inconsistency of classes.

yaml = YAML.unsafe_load_file('_data/releases.yml')

yaml.find { |y| y['version'] == '3.2.0' }['date']
# => #<Date: 2022-12-25 ((2459939j,0s,0n),+0s,-Infj)>

yaml.find { |y| y['version'] == '3.2.2' }['date']
# => "2023-03-30"

This PR normalizes the 18 dates removing the quotes so that they're all parsed as Date class.

yaml = YAML.unsafe_load_file('_data/releases.yml')

# master
yaml.reject { |item| item['date'].is_a?(Date) }.count
# => 18

# this branch
yaml.reject { |item| item['date'].is_a?(Date) }.count
# => 0

@epistrephein epistrephein force-pushed the releases-date-normalize branch from 5af2e3f to 97c5d0e Compare February 1, 2024 10:49
@epistrephein
Copy link
Contributor Author

Looks like v3.2.3 was also pushed with the release date as String instead of Date (ae9c2b0), I've pushed a fix for it as well.

Any chance to get this merged? @nurse @nagachika

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.

2 participants