Skip to content

Conversation

rykov
Copy link
Contributor

@rykov rykov commented Jan 15, 2025

What was the end-user or developer problem that led to this PR?

Unmarshalling a specification incorrectly returns spec.license as an array (["MIT"]) and spec.licenses as a double array ([["MIT"]]). The former should return a string, and the latter should return and array of strings. The issue was introduced in PR #7975. Related issues: #7978

What is your fix for the problem, implemented in this PR?

Fixed unmarshalling to remove the wrapping array. Based on the implementation history of specification.rb, the value of @licenses has been marshaled as an array since it was added (exactly 🤯) 16 years ago, so we do not need to coerce it to an array: 5fd4904

Make sure the following tasks are checked

@welcome
Copy link

welcome bot commented Jan 15, 2025

Thanks for opening a pull request and helping make RubyGems and Bundler better! Someone from the RubyGems team will take a look at your pull request shortly and leave any feedback. Please make sure that your pull request has tests for any changes or added functionality.

We use GitHub Actions to test and make sure your change works functionally and uses acceptable conventions, you can review the current progress of GitHub Actions in the PR status window below.

If you have any questions or concerns that you wish to ask, feel free to leave a comment in this PR or join our #rubygems or #bundler channel on Slack.

For more information about contributing to the RubyGems project feel free to review our CONTRIBUTING guide

Copy link
Contributor

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes total sense, thanks for fixing this!

@deivid-rodriguez deivid-rodriguez changed the title fix @licenses array unmarshalling Fix @licenses array unmarshalling Jan 16, 2025
@deivid-rodriguez deivid-rodriguez merged commit 08a279c into ruby:master Jan 16, 2025
83 checks passed
deivid-rodriguez added a commit that referenced this pull request Jan 16, 2025
fix `@licenses` array unmarshalling

(cherry picked from commit 08a279c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants