-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Organise fakers into categories #1418
Conversation
Right now, these categories are somewhat minimal and could be expanded. For example, something like `Faker::Movies::HarryPotter` should arguably be in some `Books` module instead as the book series has greater influence than the movies. However, this adds some consistency overall that I felt necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting this PR 👍
I see that you're adding a few namespaces and that's pretty helpful. We started the discussion on this issue and we still have a lot of work to do.
I have a few considerations:
- You're adding namespaces for
Games
, but we already have a PR for the Games namespace that covers all the objects. So I'd suggest removing theGames
changes. If you want to collaborate, take a look at the PR, read the changes and let the contributor know your considerations. - I saw that you also created namespaces for
movies
,tv
,anime
,comics
. I'd prefer to have these namespaces in separate PRs. The title of the PRs should be something like:
Add Faker::Movies namespace
Add Faker::Tv namespace
Add Faker::Comics namespace
Add Faker::Anime namespace
- What's the difference between
tv
andmovies
?tv
is for TvShows? - If you're removing a method, you need to deprecate the old method. So I'd advice you not to delete the old object and deprecate its methods. Otherwise when we release the PR, users will start having crashes in their systems. You can find an example here.
Gotcha. I think I went a little bit ham on this one — the inconsistency on namespaces really stuck out to me, so it'd be good if PRs relating to this can be merged soon. I'll close this one, but I'll likely make a few others as you say to break things down more. I'll probably do With regards to deprecation, what's a good reference on how to handle that in this report? Is there another PR that's done it in a way you'd like to see as the standard? |
@boardfish sounds good. You can start with Check this PR #1264 out. In this example, we deprecated In version To deprecate a method, you just need to add Feel free to contribute by adding namespaces or new objects. We're always happy to see new PRs :) |
Right now, these categories are somewhat minimal and could be expanded. For example, something like
Faker::Movies::HarryPotter
should arguably be in someBooks
module instead as the book series has greater influence than the movies. However, this adds some consistency overall that I felt necessary.I'm aware that two tests are failing but I haven't been able to pinpoint why that is. If a maintainer is able to pull my fork and assist with this, I'd very much appreciate it.
I intend to follow up this PR at some point to fix some pre-existing spelling/grammar issues across the project, most noticeable with flaws such as
stranger_thing.rb
, but I figured they'd be outside the scope of this one.This PR is related to this issue #1318.