fakerbot 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -4
- data/README.md +36 -10
- data/lib/fakerbot/renderer.rb +16 -10
- data/lib/fakerbot/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a8d4fbb91389beba704a5b36a71836104d226e4
|
4
|
+
data.tar.gz: 703b5cedd981ed5cdacb60ae2d55e3253568e51e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c032e7c36a7e5fbf6f3353fbf73136b08ff534f235cdb800041e1a812ff7747f6e8eb6769715e72fc619c5dc9f5a744ba8ae7c8578357e40a0ef3f727929877
|
7
|
+
data.tar.gz: e19c40f410b79cc33410a1bfdb0a701d11a346e3d8a382569d67e3ff56843181e085d2d32e4d21b910343edbec57dfb1fdbbf9c310cb5185fdb1160b28cea78c
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fakerbot (0.4.
|
4
|
+
fakerbot (0.4.1)
|
5
5
|
faker
|
6
6
|
pastel (~> 0.7.2)
|
7
7
|
thor (~> 0.20.0)
|
@@ -67,9 +67,11 @@ GEM
|
|
67
67
|
json (>= 1.8, < 3)
|
68
68
|
simplecov-html (~> 0.10.0)
|
69
69
|
simplecov-html (0.10.2)
|
70
|
-
strings (0.1.
|
70
|
+
strings (0.1.4)
|
71
|
+
strings-ansi (~> 0.1.0)
|
71
72
|
unicode-display_width (~> 1.4.0)
|
72
73
|
unicode_utils (~> 1.4.0)
|
74
|
+
strings-ansi (0.1.0)
|
73
75
|
term-ansicolor (1.6.0)
|
74
76
|
tins (~> 1.0)
|
75
77
|
thor (0.20.0)
|
@@ -80,7 +82,7 @@ GEM
|
|
80
82
|
tty-screen (~> 0.6.4)
|
81
83
|
tty-which (~> 0.3.0)
|
82
84
|
tty-screen (0.6.5)
|
83
|
-
tty-tree (0.
|
85
|
+
tty-tree (0.2.0)
|
84
86
|
tty-which (0.3.0)
|
85
87
|
unf (0.1.4)
|
86
88
|
unf_ext
|
@@ -101,4 +103,4 @@ DEPENDENCIES
|
|
101
103
|
simplecov (~> 0.12)
|
102
104
|
|
103
105
|
BUNDLED WITH
|
104
|
-
1.16.
|
106
|
+
1.16.3
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# FakerBot
|
2
2
|
|
3
|
-
[](https://codebeat.co/projects/github-com-akabiru-fakerbot-master) [](http://inch-ci.org/github/akabiru/fakerbot) [](https://travis-ci.com/akabiru/fakerbot) [](https://coveralls.io/github/akabiru/fakerbot?branch=master) [](https://badge.fury.io/rb/fakerbot)
|
3
|
+
[](https://codebeat.co/projects/github-com-akabiru-fakerbot-master) [](http://inch-ci.org/github/akabiru/fakerbot) [](https://travis-ci.com/akabiru/fakerbot) [](https://coveralls.io/github/akabiru/fakerbot?branch=master) [](https://badge.fury.io/rb/fakerbot) [](https://www.codetriage.com/akabiru/fakerbot)
|
4
4
|
|
5
5
|
> Quickly look up [Faker](https://github.com/stympy/faker) methods without leaving your terminal!
|
6
6
|
|
@@ -18,7 +18,7 @@ $ gem install fakerbot
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
Run a quick lookup
|
21
|
+
1.) Run a quick lookup
|
22
22
|
|
23
23
|
```bash
|
24
24
|
$ fakerbot search name
|
@@ -27,13 +27,39 @@ $ fakerbot search name
|
|
27
27
|
# └── game_name
|
28
28
|
# Faker::Superhero
|
29
29
|
# └── name
|
30
|
-
#
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
30
|
+
# ....
|
31
|
+
```
|
32
|
+
|
33
|
+
2.) List methods
|
34
|
+
|
35
|
+
```sh
|
36
|
+
$ fakerbot list
|
37
|
+
# Faker::BackToTheFuture
|
38
|
+
# ├── quote
|
39
|
+
# ├── date
|
40
|
+
# └── character
|
41
|
+
# Faker::Finance
|
42
|
+
# └── credit_card
|
43
|
+
# ....
|
44
|
+
```
|
45
|
+
|
46
|
+
`fakerbot` also includes an option to display sample output via the `--verbose` or `-v` flag. :wink:
|
47
|
+
|
48
|
+
3.)
|
49
|
+
|
50
|
+
```sh
|
51
|
+
$ fakerbot list -v
|
52
|
+
# Faker::Appliance
|
53
|
+
# ├── brand=> Whirlpool
|
54
|
+
# └── equipment=> Sump pump
|
55
|
+
# Faker::UmphreysMcgee
|
56
|
+
# └── song=> Headphones & Snowcones
|
57
|
+
$ fakerbot search name -v
|
58
|
+
# Faker::App
|
59
|
+
# └── name=> Subin
|
60
|
+
# Faker::Address
|
61
|
+
# └── street_name=> Percy Landing
|
62
|
+
# ....
|
37
63
|
```
|
38
64
|
|
39
65
|
## New Features! :sunglasses: :dancers:
|
@@ -42,7 +68,7 @@ $ fakerbot search name
|
|
42
68
|
- [x] Expand search to Faker::Base sub classes
|
43
69
|
- [x] Paginate results :book:
|
44
70
|
|
45
|
-

|
46
72
|
|
47
73
|
## Development
|
48
74
|
|
data/lib/fakerbot/renderer.rb
CHANGED
@@ -54,16 +54,7 @@ module FakerBot
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def leaf_args(method, const)
|
57
|
-
[method.to_s].tap
|
58
|
-
if verbose?
|
59
|
-
fake = begin
|
60
|
-
const.public_send(method)
|
61
|
-
rescue ArgumentError
|
62
|
-
'N/A'
|
63
|
-
end
|
64
|
-
arr << crayon.dim.white("=> #{fake.to_s}")
|
65
|
-
end
|
66
|
-
end
|
57
|
+
[method.to_s].tap { |arr| verbose_output(method, const, arr) if verbose? }
|
67
58
|
end
|
68
59
|
|
69
60
|
def gt_screen_height?(data_tree)
|
@@ -73,5 +64,20 @@ module FakerBot
|
|
73
64
|
def verbose?
|
74
65
|
options[:verbose]
|
75
66
|
end
|
67
|
+
|
68
|
+
def verbose_output(method, const, arr)
|
69
|
+
fake, message = faker_method(method, const)
|
70
|
+
arr << crayon.dim.white("=> #{fake.to_s}") << crayon.dim.magenta.bold("#{message}")
|
71
|
+
end
|
72
|
+
|
73
|
+
def faker_method(method, const)
|
74
|
+
[const.public_send(method), ensure_method_is_supported(method, const)]
|
75
|
+
rescue ArgumentError
|
76
|
+
['N/A', '']
|
77
|
+
end
|
78
|
+
|
79
|
+
def ensure_method_is_supported(method, const)
|
80
|
+
const.respond_to?(:"_deprecated_#{method.to_s}") ? ' ( WILL BE DEPRECATED )' : ''
|
81
|
+
end
|
76
82
|
end
|
77
83
|
end
|
data/lib/fakerbot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fakerbot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Austin Kabiru
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faker
|