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 SemanticVersion to API docs #7003

Merged
merged 5 commits into from
Nov 24, 2018

Conversation

Blacksmoke16
Copy link
Member

@Blacksmoke16 Blacksmoke16 commented Oct 28, 2018

  • Adds SemanticVersion to docs_main.cr to include it in doc generation.
  • Adds additional docs on the SemanticVersion class.

Resolves #6999

@Sija
Copy link
Contributor

Sija commented Oct 29, 2018

Sorry, I was thinking about dash, like in the examples you've given.

src/semantic_version.cr Show resolved Hide resolved
@@ -47,21 +71,31 @@ class SemanticVersion
end
end

# :nodoc:
Copy link
Contributor

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.

Suggested change
# :nodoc:
# The comparison operator.
#
# ```
# require "semantic_version"
#
# semver1 = SemanticVersion.new(1, 0, 0)
# semver2 = SemanticVersion.new(2, 0, 0)
# semver1 <=> semver2 # => -1
# ```

Copy link
Member Author

@Blacksmoke16 Blacksmoke16 Oct 29, 2018

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.

def to_s(io : IO)
identifiers.join(".", io)
end

# :nodoc:
Copy link
Contributor

@wooster0 wooster0 Oct 29, 2018

Choose a reason for hiding this comment

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

@@ -23,6 +40,7 @@ class SemanticVersion
end
end

# Create a new `SemanticVersion` instance with the given major, minor, and patch versions
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# 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.

getter identifiers : Array(String | Int32)

# Create a new `Prerelease` instance with supplied array of identifiers
Copy link
Contributor

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 Show resolved Hide resolved
getter patch : Int32

# The build number of this semantic version
Copy link
Contributor

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.

Suggested change
# The build number of this semantic version
# The build metadata of this semantic version

src/semantic_version.cr Show resolved Hide resolved
getter build : String?

# The pre-release metadata of this semantic version
Copy link
Contributor

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

@@ -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
Copy link
Contributor

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.

@Blacksmoke16
Copy link
Member Author

Anything else need done on this?

@RX14 RX14 merged commit cc1dcdc into crystal-lang:master Nov 24, 2018
@RX14 RX14 added this to the 0.27.1 milestone Nov 24, 2018
@Blacksmoke16 Blacksmoke16 deleted the semantic-version-docs branch November 24, 2018 14:23
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.

6 participants