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

Rename Faker::Show to Faker::Theater #2857

Closed
wants to merge 4 commits into from
Closed

Conversation

jdcalvin
Copy link

Motivation / Background

This Pull Request has been created because of naming issues identified here: #2787

This PR replaces the usage of Faker::Show to be Faker::Theater for the following reasons:

  1. The file was created under faker/music/show.rb but the class definition is Faker::Show At the very least the class should be name-spaced correctly as Faker::Music::Show

  2. Faker::Show is ambiguous for its current usage. Faker::Music::Show would also be ambiguous. The class supports three methods: adult_musical kids_musical play that generate names for musicals and plays which all can be categorized under Theater.

Additional information

Related: #2787

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug, refactor something, or add a feature.
  • Tests and Rubocop are passing before submitting your proposed changes.

If you're proposing a new generator:

  • Open an issue first for discussion before you write any code.
  • Double-check the existing generators documentation to make sure the new generator you want to add doesn't already exist.
  • You've reviewed and followed the Documentation guidelines.

The Faker::Show class was namespaced under faker/music/show.rb, and conventionally should be subclassed to Faker::Music::Show.
However, the intent of the faker is to provide names for musicals and plays, so opted to call the class `Theater` instead.
Copy link
Contributor

@stefannibrasil stefannibrasil left a comment

Choose a reason for hiding this comment

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

Looking good! Left some comments ⭐

@@ -0,0 +1,7 @@
# Faker::Theater
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really know what's the reason behind this unreleased folder but we can skip that and place it in the default folder with the others 👍

# frozen_string_literal: true

module Faker
class Theater < Base
Copy link
Contributor

Choose a reason for hiding this comment

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

Have you tried naming this file to lib/faker/theater.rb? No need to be nested, unless that's necessary.

Copy link
Author

Choose a reason for hiding this comment

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

You're right. Will fix that!

@stefannibrasil
Copy link
Contributor

Hi @jdcalvin we merged this Deprecator that can be used for this one as well: #2858

@stefannibrasil
Copy link
Contributor

This one hasn't been updated in a while. It's currently being fixed here #2921

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

3 participants