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

FIX internet custom domain with suffix #1846

Merged

Conversation

ngouy
Copy link
Contributor

@ngouy ngouy commented Dec 2, 2019

Issue#

#1845

Description:

Allow custom "full domain" (domains with suffixes and / or subdomain) to be preserved as is

There are many ways to do it (for exemple this works too) :

given_domain_word = domain&.split('.')&.first || domain_word
given_suffix_word = domain&.include?('.') ? domain.split('.').last : domain_suffix
domain_elements = [Char.prepare(given_domain_word), Char.prepare(given_suffix_word)]
domain_elements.unshift(Char.prepare(given_domain_word)) if subdomain

But the one in PR seems more preservative (and clear, but not sure about this one)

@ngouy ngouy marked this pull request as ready for review December 2, 2019 17:32
@vbrazo
Copy link
Member

vbrazo commented Dec 2, 2019

@tiagofsilva @olleolleolle

Copy link
Contributor

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

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

Oh, this matches what I've expected from the API, and I'm excited about this change.

@vbrazo vbrazo merged commit 9ad0a59 into faker-ruby:master Dec 3, 2019
@tiagofsilva
Copy link
Contributor

Frankly, I think the fix was a bit convoluted. I'll make a refactor suggestion PR later today.

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.

4 participants