-
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
Introduce a unified Tolkien Legendarium #2152
Conversation
Also, do not wrap lines at 81 chars (Pysch default)
# frozen_string_literal: true | ||
|
||
module Faker | ||
class TolkienLegendarium < Base |
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.
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
?
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.
I love it. It shall be done.
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.
@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?
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.
we can move some of the other fantasy stuff in other PRs. For now, this PR's quest is done
* 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
This reverts commit ac813b8.
This reverts commit ac813b8.
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 unifiedCosmere
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 inCONTRIBUTING.md
.