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

Update README section on how to use a Rake task (NameErrors) #1244

Merged
merged 1 commit into from
Jun 28, 2019

Conversation

skalee
Copy link
Contributor

@skalee skalee commented May 24, 2019

Currently, README is incorrect about how to setup YARD's Rake task. And Rake task itself is also broken.

Description

There is an example in README which explains how to add a Rake task. However, following it results with a NameError due to uninitialized constant YARD. This is not surprising, because Rake task definition should be loaded first, which is missing in that example. Unfortunately, adding require 'yard/rake/yardoc_task' does not help much — another NameError is raised, because the Rake task was unable to load YARD.

Changes included in this pull request:

  1. Ensure that YARD is loaded when a Rake task is invoked.
  2. Update README with a corrected example.

Completed Tasks

  • I have read the Contributing Guide.
  • The pull request is complete (implemented / written).
  • Git commits have been cleaned up (squash WIP / revert commits).
  • I wrote tests and ran bundle exec rake locally (if code is attached to PR).

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 93.659% when pulling 3b021f7 on skalee:fix-rake-task into 12f56cf on lsegal:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 93.659% when pulling 3b021f7 on skalee:fix-rake-task into 12f56cf on lsegal:master.

@coveralls
Copy link

coveralls commented May 24, 2019

Coverage Status

Coverage remained the same at 93.758% when pulling f51c604 on skalee:fix-rake-task into 46871b0 on lsegal:master.

@skalee
Copy link
Contributor Author

skalee commented May 24, 2019

Test failures for Ruby 2.6.3 are unrelated to this pull request, but caused by #1243.

@lsegal
Copy link
Owner

lsegal commented Jun 28, 2019

You should not require the yardoc_task directly, instead documentation should be updated to suggest requiring 'yard'.

Add a missing #require to the presented example.

Updated after discussion:
lsegal#1244 (comment)
@skalee
Copy link
Contributor Author

skalee commented Jun 28, 2019

I am okay with either solution. Updated, please merge.

@skalee skalee changed the title Fix Rake task and its documentation (NameErrors) Update README section on how to use a Rake task (NameErrors) Jun 28, 2019
@lsegal lsegal merged commit 29144e3 into lsegal:master Jun 28, 2019
@lsegal
Copy link
Owner

lsegal commented Jun 28, 2019

Thanks!

@skalee skalee deleted the fix-rake-task branch June 29, 2019 05:12
lsegal added a commit that referenced this pull request Dec 31, 2019
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.

3 participants