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

Comparison to github.com/Masterminds/semver #12

Open
1 of 6 tasks
mattfarina opened this issue Feb 29, 2016 · 2 comments
Open
1 of 6 tasks

Comparison to github.com/Masterminds/semver #12

mattfarina opened this issue Feb 29, 2016 · 2 comments

Comments

@mattfarina
Copy link
Contributor

mattfarina commented Feb 29, 2016

@mitchellh Here is the comparison to github.com/Masterminds/semver we spoke about.

  • On the Version type being able to access the Major, Minor, and Patch parts by name.
  • Constraints support the || operator. For example, >= 1.2.3, < 2 || >= 4.0.0. The or operator separates groups of and operators.
  • Support ~ for patch level equals in addition to ~> on constraints.
  • Support ^ for major version equality on constraints.
  • Support a range syntax like 1.2.3 - 1.3.4 on constraints.
  • A validator that provides reasons why a constraint failed (note, this is a PR for semver that should land soon).

I think this is a good start. These features, except the last, are all in use today. The last line was a feature request for a project outside of mine.

Please let me know what you think about these.

@mitchellh
Copy link
Contributor

I've started hacking on this.

For "major", "minor", "patch" by name, is there a reason Segments() doesn't work for you?

@mattfarina
Copy link
Contributor Author

@mitchellh sorry it took so long to respond. I'm a little behind on my GitHub issues.

Segments() returns a slice of int. To get the major, minor, or patch values is/was a 2 step process. Get the segments and then get the value from the slice. The method names were about developer experience to easily get the value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants