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

Add function stdlib::sort_by #1384

Merged
merged 1 commit into from
Feb 28, 2024
Merged

Add function stdlib::sort_by #1384

merged 1 commit into from
Feb 28, 2024

Conversation

XMol
Copy link
Contributor

@XMol XMol commented Jul 20, 2023

Summary

Add new Ruby function stdlib::sort_by(), emulating native Ruby's Enumerable.sort_by() for Puppet.

Additional Context

stdlib::sort_by() supports sorting Strings, Arrays and Hashes

  • Arrays, since that is the most prominent use-case
  • Strings, because it is a subset of Iterable, even though I cannot imagine any sensible proc besides clone/copy, which would be identical to basic String::sort()
  • Hashes, because that was found to be missing in Add Ruby function stdlib::cmp_hash #1376, even though there likely is little demand for it

Related Issues

#1376

Checklist

  • 🟢 Spec tests included
  • ⚪Acceptance tests are not changed, some of them fail even on the master branch, so unrelated to my additions
  • Manually verified with puppet apply version 7.24.0 on RHEL-7.9

@CLAassistant
Copy link

CLAassistant commented Jul 20, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@smortex smortex left a comment

Choose a reason for hiding this comment

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

This looks good, I am curious what other people think about it.

@XMol
Copy link
Contributor Author

XMol commented Jul 24, 2023

Regarding the pending signature of the CLA agreement, I'm still waiting for a reply from our legal department... No estimated timeline, of course.

@XMol
Copy link
Contributor Author

XMol commented Aug 22, 2023

Since our legal department has not replied to me in 3 months, I sign the CLA at my own risk. Stalling this MR for an unknown amount of time just because I'm trying to follow the rules is ridiculous.

@XMol
Copy link
Contributor Author

XMol commented Feb 28, 2024

Hi project maintainers,

is anything else missing to merge this PR? I've signed the CLA months ago and at least one reviewer gave his approval (thanks for the support, @smortex).

Kind regards,
Xavier.

@bastelfreak
Copy link
Collaborator

@XMol can you please rebase against the main branch?

@XMol
Copy link
Contributor Author

XMol commented Feb 28, 2024

@XMol can you please rebase against the main branch?

Will do...

@bastelfreak
Copy link
Collaborator

As I wrote, please do a rebase, not a merge.

@XMol
Copy link
Contributor Author

XMol commented Feb 28, 2024

As I wrote, please do a rebase, not a merge.

Sorry, I understood that, but I wasn't sure what GitHub would do when I press "sync fork". 🙂

@bastelfreak
Copy link
Collaborator

yeah the button is shit :(

@XMol
Copy link
Contributor Author

XMol commented Feb 28, 2024

Guess we now need to wait for the two pipelines to eventually fail in about 4 hours? The Acceptance tests on Ubuntu-ARM seem to be broken...

@bastelfreak bastelfreak merged commit ed474d2 into puppetlabs:main Feb 28, 2024
46 of 48 checks passed
@XMol
Copy link
Contributor Author

XMol commented Feb 28, 2024

Thanks for the prompt reaction, @bastelfreak.

@XMol XMol deleted the add_sort_by_func branch February 28, 2024 10:24
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.

5 participants