Skip to content

Conversation

@BurdetteLamar
Copy link
Member

@BurdetteLamar BurdetteLamar commented Jun 14, 2022

I have not provided an example for cp_r with multiple dirpaths in +src+ b/c it would be huge. Should I add one?

If +src+ is an array of paths and +dest+ is a directory,
recursively copies from each path in +src+ to +dest+;
the paths in +src+ may point to files and/or directories.

lib/fileutils.rb Outdated
# |-- dir0
# | |-- src0.txt
# | `-- src1.txt
# `-- dir1
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 this line's indentation is off by one.

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
# Recursively copies files from +src+ (a single path or an array of paths)
# to +dest+ (a single path).
#
# Arguments +src+ and +dest+
Copy link
Member

Choose a reason for hiding this comment

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

For consistency, I think we should specify here that src is a single or an array of paths and dest is a single path.

Copy link
Member Author

@BurdetteLamar BurdetteLamar Jun 14, 2022

Choose a reason for hiding this comment

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

Isn't that what it says?

Recursively copies files from +src+ (a single path or an array of paths)
to +dest+ (a single path).

Maybe 820-824 should be rolled together?

Copy link
Member

Choose a reason for hiding this comment

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

The docs for this method says:

Recursively copies files from +src+ (a single path or an array of paths)
to +dest+ (a single path).

Arguments +src+ and +dest+
should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].

Whereas, for example, the docs for ln_s says:

Creates {symbolic links}[https://en.wikipedia.org/wiki/Symbolic_link].

Arguments +src+ (a single path or an array of paths)
and +dest+ (a single path)
should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].

So yeah, perhaps we can remove duplication in the docs.

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.

@BurdetteLamar
Copy link
Member Author

@peterzhu2118, I have not provided an example for cp_r with multiple dirpaths in +src+ b/c it would be huge. Should I add one?

@peterzhu2118
Copy link
Member

I agree. I don't think it's necessary to have an example for that.

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