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

Ruby Docs: Autogenerated docs incorrectly list class methods as instance method #1885

Open
fallwith opened this issue Mar 14, 2023 · 1 comment
Labels
documentation hacktoberfest jul-sep qtr Represents proposed work item for the Jul-Sep quarter technical debt

Comments

@fallwith
Copy link
Contributor

Owing to the fact that our NewRelic::Agent class (lib/new_relic/agent.rb) utilizes the extend self pragma to define class methods without using def self.*, our autogenerated RDoc content incorrectly ends up referring to class methods as instance methods.

For example, for NewRelic::Agent.set_transaction_name...

Incorrect
This page: https://rubydoc.info/github/newrelic/newrelic-ruby-agent/NewRelic/Agent#set_transaction_name-instance_method

  • Incorrectly has "instance_method" in the URL
  • Incorrectly refers to the method as an instance method (uses #) instead of a class method (uses .).

Correct
This page: https://docs.newrelic.com/docs/apm/agents/ruby-agent/api-guides/ruby-custom-instrumentation/#naming-transactions

  • Is manually generated
  • Correctly refers to the method as a class method

In order to get the autogenerated docs to correctly recognize methods as class methods, we'll likely need to do one or more of the following:

  • Refactor our Ruby code to be more compatible
  • Update the annotated source code comments syntax that we use for each public method if there's a way to specify that a method is a class method
  • Update the autogeneration process
  • Manually put the autogenerated content through a filter that updates the content

Acceptance criteria: All autogenerated RDoc content matches the already-correct manually created documentation.

@workato-integration
Copy link

workato-integration bot commented Mar 14, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation hacktoberfest jul-sep qtr Represents proposed work item for the Jul-Sep quarter technical debt
Projects
None yet
Development

No branches or pull requests

4 participants