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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8085df33e12f4bd878c9189e56be6366d52d3fca
4
- data.tar.gz: 034b971fc30137bd814f21bb07e059dc7b3ab251
3
+ metadata.gz: 5a8d4fbb91389beba704a5b36a71836104d226e4
4
+ data.tar.gz: 703b5cedd981ed5cdacb60ae2d55e3253568e51e
5
5
  SHA512:
6
- metadata.gz: 946ccac66e20b766d9e66a4da666107d122992cdb248596bdc017d366dec36b99db1c142cd8a5cd422c1fd6c510b951187a9fb70e815cab80200ce9237683d0b
7
- data.tar.gz: 23fca28de4270f36471c746ad630b976a5d35efdf0c4508b2207bb8f79b4ec28fb217e1681ead0ab5714d6e5d811905f9b81eb3ea8a9d78d30d8e2c325355ae4
6
+ metadata.gz: 5c032e7c36a7e5fbf6f3353fbf73136b08ff534f235cdb800041e1a812ff7747f6e8eb6769715e72fc619c5dc9f5a744ba8ae7c8578357e40a0ef3f727929877
7
+ data.tar.gz: e19c40f410b79cc33410a1bfdb0a701d11a346e3d8a382569d67e3ff56843181e085d2d32e4d21b910343edbec57dfb1fdbbf9c310cb5185fdb1160b28cea78c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fakerbot (0.4.0)
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.2)
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.1.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.1
106
+ 1.16.3
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # FakerBot
2
2
 
3
- [![codebeat badge](https://codebeat.co/badges/ef4839f2-3946-4435-8c0e-7025de5fac22)](https://codebeat.co/projects/github-com-akabiru-fakerbot-master) [![Inline docs](http://inch-ci.org/github/akabiru/fakerbot.svg?branch=master)](http://inch-ci.org/github/akabiru/fakerbot) [![Build Status](https://travis-ci.com/akabiru/fakerbot.svg?branch=master)](https://travis-ci.com/akabiru/fakerbot) [![Coverage Status](https://coveralls.io/repos/github/akabiru/fakerbot/badge.svg?branch=master)](https://coveralls.io/github/akabiru/fakerbot?branch=master) [![Gem Version](https://badge.fury.io/rb/fakerbot.svg)](https://badge.fury.io/rb/fakerbot)
3
+ [![codebeat badge](https://codebeat.co/badges/ef4839f2-3946-4435-8c0e-7025de5fac22)](https://codebeat.co/projects/github-com-akabiru-fakerbot-master) [![Inline docs](http://inch-ci.org/github/akabiru/fakerbot.svg?branch=master)](http://inch-ci.org/github/akabiru/fakerbot) [![Build Status](https://travis-ci.com/akabiru/fakerbot.svg?branch=master)](https://travis-ci.com/akabiru/fakerbot) [![Coverage Status](https://coveralls.io/repos/github/akabiru/fakerbot/badge.svg?branch=master)](https://coveralls.io/github/akabiru/fakerbot?branch=master) [![Gem Version](https://badge.fury.io/rb/fakerbot.svg)](https://badge.fury.io/rb/fakerbot) [![Open Source Helpers](https://www.codetriage.com/akabiru/fakerbot/badges/users.svg)](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
- # Faker::ProgrammingLanguage
31
- # └── name
32
- # Faker::Cat
33
- # └── name
34
- # Faker::Pokemon
35
- # └── name
36
- # e.t.c
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
- ![screen shot 2018-08-09 at 20 21 06](https://user-images.githubusercontent.com/17295175/43914887-c9a99d84-9c11-11e8-9686-85f584412b27.jpg)
71
+ ![screen shot 2018-08-13 at 23 33 51](https://user-images.githubusercontent.com/17295175/44056603-6343f9f2-9f51-11e8-933d-55367e25be35.jpg)
46
72
 
47
73
  ## Development
48
74
 
@@ -54,16 +54,7 @@ module FakerBot
54
54
  end
55
55
 
56
56
  def leaf_args(method, const)
57
- [method.to_s].tap do |arr|
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
@@ -1,3 +1,3 @@
1
1
  module FakerBot
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.4.1'.freeze
3
3
  end
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.0
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-08-13 00:00:00.000000000 Z
11
+ date: 2018-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faker