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

README.md~ (editor backup file of README.md) is parsed rather than README.md #777

Closed
fuminori-ido opened this issue May 29, 2014 · 3 comments

Comments

@fuminori-ido
Copy link

Hi, YARD is much better documentation tool, thank you.

When I generated a ruby project doc by YARD, old README.md was always used.
I used --no-cache option and/or remove .yardoc/ directories, but still old README.md was used.

Finally, I understood the reason. lib/yard/cli/yardoc.rb 277-th lines is as follows:

        readme = Dir.glob('README*').first

Unfortunately, README.md~ (backup file my editor is generated) is chosen for the readme file. That was the reason why generated README was old one.

I think tilde is used some major editors like Emacs so that this issue is not for only me.

Could you change like the following?:

  readme = Dir.glob('README*[A-Za-z0-9]')

or, explicitly document that backupfile like README.md~ should be delete before running YARD?

@lsegal
Copy link
Owner

lsegal commented Jun 3, 2014

Dir.glob('README*[A-Za-z0-9]') would fail if the file was just "README". We could do some tests to ensure that the last character is alphanum instead. If you submit a pull request, this functionality would be implemented much more quickly.

fuminori-ido pushed a commit to fuminori-ido/yard that referenced this issue Jul 11, 2014
backup file is like README~ or README.md~.
This file should not be chosen when generating docs by yard.

References lsegal#777
@fuminori-ido
Copy link
Author

Dir.glob('README*[A-Za-z0-9]') would fail if the file was just "README".

That's true! Thank you for your comment. So, I change my glob pattern as follows:

   readme = Dir.glob('README{,*[^~]}').first

and put "pull rquest" as above. Please consider it

@lsegal
Copy link
Owner

lsegal commented Jul 14, 2014

Resolved by #790. Thanks for putting together this patch @fuminori-ido!

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

No branches or pull requests

2 participants