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 Quotes namespace #1504

Merged
merged 11 commits into from
Jan 6, 2019
Merged

Add Quotes namespace #1504

merged 11 commits into from
Jan 6, 2019

Conversation

vbrazo
Copy link
Member

@vbrazo vbrazo commented Jan 1, 2019

Checklist

  • Add Quotes namespace
  • Deprecates Faker::Shakespeare => Faker::Quotes::Shakespeare
  • Deprecates Faker::FamousLastWords => Faker::Quote.famous_last_words
  • Deprecates Faker::Matz => Faker::Quote.matz
  • Deprecates Faker::MostInterestingManInTheWorld => Faker::Quote.most_interesting_man_in_the_world
  • Deprecates Faker::Robin => Faker::Quote.robin
  • Deprecates Faker::SingularSiegler => Faker::Quote.singular_siegler
  • Deprecates Faker::Yoda => Faker::Quote.yoda

This PR is related to #1318.

@vbrazo vbrazo self-assigned this Jan 1, 2019
@justinxreese
Copy link

I think GreekPhilosophers needs more thought because it includes the ability to generate a random philosopher too. FillMurray definitely doesn't fit because it does placeholder images.

And, although Shakespeare looks complicated, I think it does still fit the Quotes module because all it appears to do is pull quotes from different Shakespeare plays.

There also appears to be two deprecations in here that aren't really quotes related. Up to you and @stympy how clean that needs to be though.

@justinxreese
Copy link

The Shakespeare class, btw, is a good example of why it makes more sense to have a Quotes namespace than a single quotes class. Because all the methods are quote generators, but each is a bit more specific.

@vbrazo
Copy link
Member Author

vbrazo commented Jan 1, 2019

You're right. I just reverted ::FillMurray and ::GreekPhilosophers.

Available since version 1.9.0.

```ruby
Faker::Quotes::Yoda.quote #=> "Use your feelings, Obi-Wan, and find him you will."
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels a bit redundant to go Faker::Quotes::Yoda.quote.

Are we able to move this to Faker::Quotes.yoda while still being able to keep things like Faker::Quotes::Shakespeare?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that it feels redundant. I don't see a problem with having both Faker::Quotes.yoda and Faker::Quotes::Shakespeare, but I'm open to hearing any contrary opinions. :)

Copy link
Member Author

@vbrazo vbrazo Jan 5, 2019

Choose a reason for hiding this comment

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

I've just added Faker::Quote.yoda. I believe we should do the same for

Faker::Quotes::FamousLastWords.last_words
Faker::Quotes::Matz.quote
Faker::Quotes::MostInterestingManInTheWorld.quote
Faker::Quotes::Robin.quote
Faker::Quotes::SingularSiegler.quote

They should be

Faker::Quote.famous_last_words
Faker::Quote.matz
Faker::Quote.most_interesting_man_in_the_world
Faker::Quote.robin
Faker::Quote.singular_siegler

what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

sounds good to me

@vbrazo vbrazo merged commit 41b212d into faker-ruby:master Jan 6, 2019
@vbrazo vbrazo deleted the features/add-quotes-namespace branch January 6, 2019 03:26
davidmorton0 pushed a commit to davidmorton0/faker that referenced this pull request Jul 12, 2021
* Add Quotes namespace

* Deprecate ::Yoda

* Update unreleased_README.md

* Revert ::Fillmurray and ::GreekPhilosophers deprecations

* Deprecate ::Shakespeare

* Fix ::Yoda deprecation

* Minor changes after own review

* Update yoda.rb

* Add quotes methods to Faker::Quote
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.

4 participants