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 numeric tag convention support #8

Merged
merged 2 commits into from
Apr 27, 2017
Merged

Conversation

HerveMARTIN
Copy link

Also add a better output when tags don't match supported naming convention

Also add a better output when tags don't match supported naming convention
lib/ra10ke.rb Outdated
version_tags = tags.select { |f| /^[vV]\d/.match(f) }
latest_ref = version_tags.keys.sort.last
elsif ref.match(/^\d[\.\d]*/)
Copy link
Contributor

Choose a reason for hiding this comment

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

this block is not really needed, just improve the regexp to make the [vV] part optional

Copy link
Author

Choose a reason for hiding this comment

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

It allows to filter tags according to the convention found if the Puppetfile ref.
If for some historical reason a repo has the both naming convention, this block prevent from getting weird sort result.
It's not necessary, tell me.

Copy link
Contributor

@tampakrap tampakrap Apr 27, 2017

Choose a reason for hiding this comment

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

What I mean is instead of having this elsif block, to make the regexp on line 58 to something like /^([vV)]?\d/, or even better to use your improvement and have /^([vV])?\d[\.\d]*/

@tampakrap tampakrap self-assigned this Apr 27, 2017
lib/ra10ke.rb Outdated
version_tags = tags.select { |f| /^[vV]\d/.match(f) }
latest_ref = version_tags.keys.sort.last
elsif ref.match(/^\d[\.\d]*/)
Copy link
Contributor

@tampakrap tampakrap Apr 27, 2017

Choose a reason for hiding this comment

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

What I mean is instead of having this elsif block, to make the regexp on line 58 to something like /^([vV)]?\d/, or even better to use your improvement and have /^([vV])?\d[\.\d]*/

@tampakrap tampakrap merged commit 3f6cecd into voxpupuli:master Apr 27, 2017
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