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

Adds domain option for Internet email and domain_name methods #1808

Merged

Conversation

tiagofsilva
Copy link
Contributor

@tiagofsilva tiagofsilva commented Oct 15, 2019

Issue #1624

Example:

Internet.email(name: 'jane doe', domain: 'customdomain')
#=> jane.doe@customdomain.co

Description:

This PR's main goal is to add another option to Internet.email method (fixes #1624), which is the domain param. Also makes possible to generate a domain_name with a custom domain and random subdomain.

@olleolleolle
Copy link
Contributor

@tiagofsilva One cool thing is that if you include the words Fixes #1624 in the Description box, GitHub will auto-close that Issue on merge of this PR.

The PR looks grand and solves my problem perfectly!

Copy link
Member

@vbrazo vbrazo left a comment

Choose a reason for hiding this comment

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

Looks good, however we're missing documentation in this PR. Please add them!

@olleolleolle
Copy link
Contributor

doc/default/internet.md:

About the email section: add domain

# Keyword arguments: name, separators, domain

Add an example:

Faker::Internet.email(domain: 'example.com') #=> alice@example.com"

And in the domain section, add notes about it, too:

# Keyword arguments: subdomain, domain
Faker::Internet.domain_name #=> "effertz.info"
Faker::Internet.domain_name(domain: "example.com") #=> "example.com"
Faker::Internet.domain_name(subdomain: true, domain: "example.com") #=> "horse.example.com"

@tiagofsilva
Copy link
Contributor Author

Thanks @olleolleolle and @vbrazo ! Here are the documentation's changes.

Copy link
Member

@vbrazo vbrazo left a comment

Choose a reason for hiding this comment

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

Sweet. Thanks 💥

@ngouy
Copy link
Contributor

ngouy commented Dec 5, 2019

just realized that "subdomain" isn't a valid param for "email"
image

michebble pushed a commit to michebble/faker that referenced this pull request Feb 16, 2020
…ruby#1808)

* Adds domain option for Internet.email and Internet.domain_name methods

* Renames variable to avoid violating rubocop

* Adds documentation to modified Internet.email and Internet.domain methods
davidmorton0 pushed a commit to davidmorton0/faker that referenced this pull request Jul 12, 2021
…ruby#1808)

* Adds domain option for Internet.email and Internet.domain_name methods

* Renames variable to avoid violating rubocop

* Adds documentation to modified Internet.email and Internet.domain methods
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.

Feature::Internet.email specify domain name
4 participants