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

Introduce a unified Tolkien Legendarium #2152

Merged
merged 13 commits into from
Oct 10, 2020

Conversation

mathisto
Copy link
Contributor

@mathisto mathisto commented Oct 9, 2020

Issue#

No-Story

Description:

The existing generators for "The Lord of the Rings" and "The Hobbit" are namespaced under the guise of Movies, but a quick glance at the quotes sections reveals that at least some of the content is from the books. Instead of making a separate instance of book and movie content, I have combined them into a single "Legendarium". This is in keeping with the pattern present in the unified Cosmere class.

In order to prevent breaking existing implementations, the "Movie" generators will remain in place, but their .yml entries have been made as nested objects in the new unified legendarium data.

Additionally, I have introduced, what I believe to be, a complete list of ALL Tolkien characters, races, poems, and locations from the legendarium. Most data was scraped from the Tolkien Gateway Wiki. I have deduplicated, removed parentheticals, and normalized all the entries.

BONUS
I made a change to reformat_yaml.rake to make its formatting match the examples in CONTRIBUTING.md.

# frozen_string_literal: true

module Faker
class TolkienLegendarium < Base
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be moved to a name space as we'd like to reduce the number of generators in the default namespace.

Perhaps this could be moved to Faker::Fantasy::Tolkien?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I love it. It shall be done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Zeragamba Great call on the namespace. Much cleaner. I'm tempted to do some additional cleanup. If we wanted to move additional "Fantasy" generators to this new namespace, would we follow a similar pattern that I used here to allow for a deprecation/sunsetting window for the old namespaces?
Its done

Copy link
Contributor

Choose a reason for hiding this comment

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

we can move some of the other fantasy stuff in other PRs. For now, this PR's quest is done

tasks/reformat_yaml.rake Show resolved Hide resolved
@mathisto mathisto requested a review from Zeragamba October 10, 2020 02:54
@Zeragamba Zeragamba merged commit 80180ec into faker-ruby:master Oct 10, 2020
droznyk pushed a commit to droznyk/faker that referenced this pull request Oct 23, 2020
* Combine lotr and hobbit into tolkien .yml

* Add tolkien characters

* Restore hobbit and lotr movie yamls

* Fix generator to use new legendarium class

* Combine hobbit and lotr yml into legendarium yml

* Add indentation to yaml array list items

Also, do not wrap lines at 81 chars (Pysch default)

* Point tolkien movies to default lengendarium yml

* Remove silly comment

* Use consistent quotations. Unbreak lines.

* Alias 'movie' classes. Point to new yaml file name

* Add tests

* Fix formatting and documentation

* Re-namespace to fantasy/tolkien
droznyk added a commit to droznyk/faker that referenced this pull request Oct 23, 2020
droznyk added a commit to droznyk/faker that referenced this pull request Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants