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

Add CLI - Integrate fakerbot 🤖 #1507

Merged
merged 17 commits into from
Mar 3, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(cli): Add documentation 📖
  • Loading branch information
akabiru committed Jan 5, 2019
commit deb31a41de4e1cecae0d078e6072ba18885aa18b
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ Faker::Name.name #=> "Christophe Bartell"
Faker::Internet.email #=> "[email protected]"
```

### CLI
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good shout. 👍


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:
Expand Down Expand Up @@ -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
Expand Down
55 changes: 55 additions & 0 deletions lib/cli/README.md
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)