Skip to content

[DOC] Changes to examples #96

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

Merged
merged 4 commits into from
Jun 28, 2022
Merged

[DOC] Changes to examples #96

merged 4 commits into from
Jun 28, 2022

Conversation

BurdetteLamar
Copy link
Member

Uses tree in examples for FileUtils.cp_lr.
Retains File.exist? only when the result will be true; otherwise changes to File.file? or File.directory?, which is more precise.

lib/fileutils.rb Outdated
# |-- sub0
# | |-- src0.txt
# | `-- src1.txt
# `-- sub1
Copy link
Member

Choose a reason for hiding this comment

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

I think indentation is off by one on this line.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

lib/fileutils.rb Outdated
# "tmp1/tmp2/t1.txt",
# "tmp1/tmp3/t2.txt",
# "tmp1/tmp3/t3.txt"]
# tree src0
Copy link
Member

Choose a reason for hiding this comment

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

If you're calling the tree method, you need to make the arguments strings.

Suggested change
# tree src0
# tree('src0')

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed (five places).

@peterzhu2118
Copy link
Member

I’ve noticed that the output of the tree command in the code block makes it difficult to read the code because there’s no syntax highlighting. I think we should change it so that the output of the tree command is a comment. See the screenshot for the difference it makes.

Before:

Screen Shot 2022-06-27 at 1 46 57 PM

After:

Screen Shot 2022-06-27 at 1 47 04 PM

@BurdetteLamar
Copy link
Member Author

I've noticed ....

Fixed at cp_lr with slight difference from your suggested format. If ok, I'll fix the others.

@peterzhu2118
Copy link
Member

👍 I like this new format. Thank you.

@BurdetteLamar
Copy link
Member Author

👍 I like this new format. Thank you.

Much better! Thanks for the suggestion. All fixed now.

Copy link
Member

@peterzhu2118 peterzhu2118 left a comment

Choose a reason for hiding this comment

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

Looks good!

@BurdetteLamar BurdetteLamar merged commit 346a71b into ruby:master Jun 28, 2022
matzbot pushed a commit to ruby/ruby that referenced this pull request Jun 28, 2022
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.

2 participants