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 !-variants of request methods and improve yardocs #119

Closed
wants to merge 3 commits into from

Conversation

kke
Copy link
Contributor

@kke kke commented May 10, 2019

Fixes #109

Also includes a bunch of fixes and improvements to yardocs all over, such as automatic documentation of the struct attributes.

@@ -10,6 +10,9 @@ module API
module MetaV1
# @see https://godoc.org/k8s.io/apimachinery/pkg/apis/meta/v1#TypeMeta
class Resource < Struct
# @!macro [attach] attribute
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This makes all of the api struct docs get documentation for their attributes.

Before:

image

After:

image

@@ -21,7 +21,8 @@

module K8s
# @param server [String] http/s URL
# @param options [Hash] @see Transport.new
# @param options [Hash]
# @param (see Transport#initialize)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This syntax copies the params from the referenced method to this one. The link didn't work anyway.

@@ -133,7 +133,7 @@ def self.from_kubeconfig_env(kubeconfig = nil)
#
# @param server [String] kubernetes server address
# @param ca [String] server certificate authority data (base64 encoded)
# @param token [String] access token
# @param auth_token [String] access token
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wrong attribute name, yardoc warns about these when generating, we could add rubocop-like test step for yardoc validity.

module ExceptionlessBangMethod
private

# @!macro [attach] exceptionless_bang_method
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This documents the dynamically generated bang! methods, but I couldn't find any way to replicate the param list / return value, so the bang-variants just show (*args, **options) => Object in the final doc.

spec/k8s/transport_spec.rb Outdated Show resolved Hide resolved
@kke kke requested review from jakolehm and jnummelin May 14, 2019 10:39
@kke kke added this to the 1.0.0 milestone Aug 7, 2019
@kke
Copy link
Contributor Author

kke commented Aug 20, 2019

Too complicated implementation

@kke kke closed this Aug 20, 2019
@kke kke deleted the feature/bang_methods_and_yardoc_improvements branch August 20, 2019 06:53
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.

Get without exception
1 participant