fakerbot 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/Rakefile +5 -3
- data/bin/console +1 -0
- data/bin/fakerbot +1 -1
- data/lib/fakerbot.rb +2 -0
- data/lib/fakerbot/reflector.rb +1 -1
- data/lib/fakerbot/renderer.rb +5 -4
- data/lib/fakerbot/version.rb +3 -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: 44da8e438f0c884d15069fb45e3badb33c49bd0c
|
4
|
+
data.tar.gz: 3e2e93c81fc81c12cfe7bdd7d58c3b2b78b5cb81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea3bb7b47d06a5f481375edec417f1ba134705bca27bbd042591bde176115a110de264302970d38a22e75debdaf1a1d56a1e93b4bb1dfbb4f9f6eed1fb591fae
|
7
|
+
data.tar.gz: 4eba4f93af011f524881793f76d75d80c38d744aa72d653f0cca3b1753ce51b5b44b1cd64fc8767188d544925f5b265c20f6d8eee0bcd14754fb2868e2c950a0
|
data/Gemfile.lock
CHANGED
data/Rakefile
CHANGED
data/bin/console
CHANGED
data/bin/fakerbot
CHANGED
data/lib/fakerbot.rb
CHANGED
data/lib/fakerbot/reflector.rb
CHANGED
@@ -60,7 +60,7 @@ module FakerBot
|
|
60
60
|
def search_descendants_matching_query
|
61
61
|
faker_descendants.each do |faker|
|
62
62
|
methods = faker.my_singleton_methods
|
63
|
-
matching = methods.select { |m| m.match
|
63
|
+
matching = methods.select { |m| m.match(/#{query}/i) }
|
64
64
|
store(faker, matching)
|
65
65
|
end
|
66
66
|
end
|
data/lib/fakerbot/renderer.rb
CHANGED
@@ -36,9 +36,10 @@ module FakerBot
|
|
36
36
|
attr_reader :crayon, :hash, :options, :output, :pager, :screen, :tree
|
37
37
|
|
38
38
|
def build_tree
|
39
|
-
hash.reduce({}) do |h, (faker, methods)|
|
40
|
-
h.merge! node(faker, methods)
|
39
|
+
data_tree = hash.reduce({}) do |h, (faker, methods)|
|
40
|
+
h.merge! node(faker, methods&.sort)
|
41
41
|
end
|
42
|
+
data_tree.sort_by(&:to_s).to_h
|
42
43
|
end
|
43
44
|
|
44
45
|
def node(const, methods)
|
@@ -67,7 +68,7 @@ module FakerBot
|
|
67
68
|
|
68
69
|
def verbose_output(method, const, arr)
|
69
70
|
fake, message = faker_method(method, const)
|
70
|
-
arr << crayon.dim.white("=> #{fake
|
71
|
+
arr << crayon.dim.white("=> #{fake}") << crayon.dim.magenta.bold(message.to_s)
|
71
72
|
end
|
72
73
|
|
73
74
|
def faker_method(method, const)
|
@@ -77,7 +78,7 @@ module FakerBot
|
|
77
78
|
end
|
78
79
|
|
79
80
|
def ensure_method_is_supported(method, const)
|
80
|
-
const.respond_to?(:"_deprecated_#{method
|
81
|
+
const.respond_to?(:"_deprecated_#{method}") ? ' ( WILL BE DEPRECATED )' : ''
|
81
82
|
end
|
82
83
|
end
|
83
84
|
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.2
|
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-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faker
|