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

Add Faker::File.dir #1361

Merged
merged 2 commits into from Jun 22, 2019
Merged

Add Faker::File.dir #1361

merged 2 commits into from Jun 22, 2019

Conversation

tylerhunt
Copy link
Contributor

Add Faker::File.dir for generating directory paths.

I'd like to take this further, but I think the ideal naming would break backwards compatibility. Anyways, here's what I have in mind:

  • Faker:File.dir — as implemented in this PR
  • Faker:File.file_name — returns just the name part of the path (breaking change since the existing .file_name also returns a path segment)
  • Faker:File.path — returns a .dir with a .file_name (basically like the current .file_name)

Let me know any thoughts on this and how we might be able to move forward.

Copy link
Member

@vbrazo vbrazo left a comment

Choose a reason for hiding this comment

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

I personally like what you did in this PR. I tested locally and it works fine.

Let's see what other people have to say about your changes.

Add Faker::File.dir for generating directory paths.

Fix an imprecise test on Faker::File.file_name and update it to use the
new Faker::File.dir method.
@vbrazo vbrazo merged commit f03d4ee into faker-ruby:master Jun 22, 2019
sanikkenway referenced this pull request in sanikkenway/faker Jun 24, 2019
 Add Faker::File.dir (stympy#1361)
michebble pushed a commit to michebble/faker that referenced this pull request Feb 16, 2020
* Add file dir

Add Faker::File.dir for generating directory paths.

Fix an imprecise test on Faker::File.file_name and update it to use the
new Faker::File.dir method.

* Update file.md
davidmorton0 pushed a commit to davidmorton0/faker that referenced this pull request Jul 12, 2021
* Add file dir

Add Faker::File.dir for generating directory paths.

Fix an imprecise test on Faker::File.file_name and update it to use the
new Faker::File.dir method.

* Update file.md
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.

None yet

2 participants