-
Notifications
You must be signed in to change notification settings - Fork 71
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
rework forge API handling #527
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably good to add it to Gemfile
.
bin/get_all_the_diffs
Outdated
while not mods.next_url.nil? | ||
mods = mods.next | ||
puts "we discovered another #{mods.count} modules on the forge" if DEBUG | ||
forge_releases.concat(mods.map{|mod| mod.slug }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can also be written as mods.map(&:slug)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also suggests the Github API needs proper pagination.
bin/get_all_the_diffs
Outdated
|
||
vp = PuppetForge::User.find('puppet') | ||
mods = vp.modules | ||
forge_releases = mods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/puppetlabs/forge-ruby#paginated-collections suggests you can also iterate automatically:
forge_releases = vp.modules.unpaginated.map(&:slug)
No description provided.