-
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
Add CLI - Integrate fakerbot 🤖 #1507
Merged
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e34a04b
feat(cli): Pull in fakerbot gem logic
akabiru 552de6e
chore(cli): Extract module outside of `faker` dir
akabiru 2582f5d
feat(cli): Add `faker` excecutable
akabiru 38ec79c
feat(cli): Add renderer; reflector unit tests
akabiru c5e7224
feat(cli): Add commands tests
akabiru 5a65094
feat(cli): Add integration tests
akabiru deb31a4
feat(cli): Add documentation 📖
akabiru 96b2dd1
chore(cli): Extract constructor to base command
akabiru a4b2bc2
fix(cli): Amend faker version load path
akabiru 9285086
fix(cli): Skip default deprecation warning output in the CLI
akabiru 63a24f1
chore(cli): Amend var names
akabiru fd9d986
chore(reflectors): Distribute Reflector responsibilities
akabiru 203ef41
Merge master
akabiru 450dbaf
Merge branch 'master' into feature/pull-in-fakerbot
akabiru a800621
chore: Don't specify bunlder version
akabiru 7ca6e5d
chore: Address review comments
akabiru 491b63a
chore: Skip Gem::Deprecate warning output in CLI
akabiru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat(cli): Add documentation 📖
- Loading branch information
commit deb31a41de4e1cecae0d078e6072ba18885aa18b
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,6 +192,14 @@ Faker::Name.name #=> "Christophe Bartell" | |
Faker::Internet.email #=> "[email protected]" | ||
``` | ||
|
||
### CLI | ||
|
||
Usage Instructions [available here](https://github.com/stympy/faker/blob/master/lib/cli/README.md) | ||
|
||
```bash | ||
$ faker | ||
``` | ||
|
||
### Ensuring unique values | ||
|
||
Prefix your method call with `unique`. For example: | ||
|
@@ -256,15 +264,15 @@ en-au-ocker: | |
faker: | ||
name: | ||
# Existing faker field, new data | ||
first_name: | ||
first_name: | ||
- Charlotte | ||
- Ava | ||
- Chloe | ||
- Emily | ||
|
||
# New faker fields | ||
ocker_first_name: | ||
- Bazza | ||
ocker_first_name: | ||
- Bazza | ||
- Bluey | ||
- Davo | ||
- Johno | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# faker (cli) | ||
|
||
## Usage | ||
|
||
1.) Run a quick lookup | ||
|
||
```bash | ||
$ faker search name | ||
# Faker::SwordArtOnline | ||
# └── real_name | ||
# └── game_name | ||
# Faker::Superhero | ||
# └── name | ||
# .... | ||
``` | ||
|
||
2.) List methods | ||
|
||
```sh | ||
$ faker list | ||
# Faker::BackToTheFuture | ||
# ├── quote | ||
# ├── date | ||
# └── character | ||
# Faker::Finance | ||
# └── credit_card | ||
# .... | ||
``` | ||
|
||
`faker` also includes an option to display sample output via the `--verbose` or `-v` flag. :wink: | ||
|
||
3.) | ||
|
||
```sh | ||
$ faker list -v | ||
# Faker::Appliance | ||
# ├── brand=> Whirlpool | ||
# └── equipment=> Sump pump | ||
# Faker::UmphreysMcgee | ||
# └── song=> Headphones & Snowcones | ||
$ faker search name -v | ||
# Faker::App | ||
# └── name=> Subin | ||
# Faker::Address | ||
# └── street_name=> Percy Landing | ||
# .... | ||
``` | ||
|
||
## Features! :sunglasses: :dancers: | ||
|
||
- [x] List classes with methods E.g. Faker::FunnyName is displayed with `.name`,`.first_name` e.t.c. | ||
- [x] Expand search to Faker::Base sub classes | ||
- [x] Paginate results :book: | ||
|
||
![screenshot 2019-01-05 at 03 02 08](https://user-images.githubusercontent.com/17295175/50717135-59d85780-1096-11e9-8d0d-eca95646644d.jpg) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 change should go in our
unreleased_README.md
.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.
Good shout. 👍