-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 SemanticVersion to API docs #7003
Conversation
Add additional method docs
Sorry, I was thinking about dash, like in the examples you've given. |
src/semantic_version.cr
Outdated
@@ -47,21 +71,31 @@ class SemanticVersion | |||
end | |||
end | |||
|
|||
# :nodoc: |
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.
Why :nodoc:
? The <=>
comparison operator should be documented so users know it can be used here.
# :nodoc: | |
# The comparison operator. | |
# | |
# ``` | |
# require "semantic_version" | |
# | |
# semver1 = SemanticVersion.new(1, 0, 0) | |
# semver2 = SemanticVersion.new(2, 0, 0) | |
# semver1 <=> semver2 # => -1 | |
# ``` |
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.
Was thinking since its required by the Comparable
that the user would look there.
But probably wouldn't hurt to add here as well.
src/semantic_version.cr
Outdated
def to_s(io : IO) | ||
identifiers.join(".", io) | ||
end | ||
|
||
# :nodoc: |
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.
src/semantic_version.cr
Outdated
@@ -23,6 +40,7 @@ class SemanticVersion | |||
end | |||
end | |||
|
|||
# Create a new `SemanticVersion` instance with the given major, minor, and patch versions |
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.
# Create a new `SemanticVersion` instance with the given major, minor, and patch versions | |
# Creates a new `SemanticVersion` instance with the given major, minor, and patch versions | |
# and optionally build and pre-release metadata | |
# | |
# Raises `ArgumentError` if *prerelease* is invalid pre-release metadata. |
src/semantic_version.cr
Outdated
getter identifiers : Array(String | Int32) | ||
|
||
# Create a new `Prerelease` instance with supplied array of identifiers |
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.
Use the third person: Creates
.
src/semantic_version.cr
Outdated
getter patch : Int32 | ||
|
||
# The build number of this semantic version |
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.
It's not always just a number.
# The build number of this semantic version | |
# The build metadata of this semantic version |
src/semantic_version.cr
Outdated
getter build : String? | ||
|
||
# The pre-release metadata of this semantic version |
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.
semver.org calls this the pre-release version
src/semantic_version.cr
Outdated
@@ -23,6 +43,10 @@ class SemanticVersion | |||
end | |||
end | |||
|
|||
# Creates a new `SemanticVersion` instance with the given major, minor, and patch versions | |||
# and optionally build and pre-release metadata |
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.
Here and below are still some pre-release metadata
instances.
Anything else need done on this? |
SemanticVersion
todocs_main.cr
to include it in doc generation.SemanticVersion
class.Resolves #6999