Skip to content

Add Faker::Creature namespace#1424

Merged
vbrazo merged 7 commits intofaker-ruby:masterfrom
ChaoticBoredom:namespacing/move-animals-into-creature-namespace
Oct 21, 2018
Merged

Add Faker::Creature namespace#1424
vbrazo merged 7 commits intofaker-ruby:masterfrom
ChaoticBoredom:namespacing/move-animals-into-creature-namespace

Conversation

@ChaoticBoredom
Copy link
Copy Markdown
Contributor

As per the suggestion made by @SpyMaster356 in issue #1318, I've moved both Cat and Dog fakers into the Creature namespace.
I've deprecated the original methods, put tests in place for the deprecations, and moved the real classes and tests under the creature namespace.

Comment thread lib/faker/creature/dog.rb Outdated
end

def gender
fetch('creature.dog.gender')
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Found this a bit odd, would it make more sense to re-use Faker::Gender.binary_type here instead of having another set of identical data?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think that's a great suggestion and you can go ahead and implement :)

@vbrazo vbrazo changed the title Namspacing: Move Cat and Dog to the Creature namespace Add Faker::Creature namespace Oct 20, 2018
Comment thread doc/dog.md Outdated
# Random dog size
Faker::Dog.size #=> "small"
``` No newline at end of file
Faker::Creature::::Dog.size #=> "small"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It should be Faker::Creature::Dog

@vbrazo vbrazo merged commit 6527a94 into faker-ruby:master Oct 21, 2018
davidmorton0 pushed a commit to davidmorton0/faker that referenced this pull request Jul 12, 2021
* Migrate 'cat' to the 'creatures' namespace

* Migrate 'dog' into the 'creature' namespace

* Update references in README

* Fix Dog class misxup

* Fix extra '::' in documentation

* Update dog.rb

* Update dog.yml
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