fakerbot 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44da8e438f0c884d15069fb45e3badb33c49bd0c
4
- data.tar.gz: 3e2e93c81fc81c12cfe7bdd7d58c3b2b78b5cb81
3
+ metadata.gz: 659d15a1df1e316903fc54196be47bb5f6887c04
4
+ data.tar.gz: e419ed063d518c06ff6fae09a1294f88929abf3a
5
5
  SHA512:
6
- metadata.gz: ea3bb7b47d06a5f481375edec417f1ba134705bca27bbd042591bde176115a110de264302970d38a22e75debdaf1a1d56a1e93b4bb1dfbb4f9f6eed1fb591fae
7
- data.tar.gz: 4eba4f93af011f524881793f76d75d80c38d744aa72d653f0cca3b1753ce51b5b44b1cd64fc8767188d544925f5b265c20f6d8eee0bcd14754fb2868e2c950a0
6
+ metadata.gz: 2ef6759c55b74e26c59b179045c99108d1bffb277647de15eb29a875a11b2874f220fab9e41f645f7d036e58536dd85d7d41b7022cea30244833637f5f01a28f
7
+ data.tar.gz: 1dce33ad7d335763fae4b920bb1cf5a6129af3595a23ed404bc738fb24ee066b3f80c2b6df7d25f17ced1c8ac407e8f626de8fd978d6719610c5365f5065f3a5
@@ -60,11 +60,16 @@ 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(/#{query}/i) }
63
+ matching = methods.select { |m| query_matches?(m.to_s) }
64
64
  store(faker, matching)
65
65
  end
66
66
  end
67
67
 
68
+ def query_matches?(method_name)
69
+ method_name_parts = method_name.split(/_/).reject(&:empty?)
70
+ query.match(/#{method_name_parts.join('|')}/)
71
+ end
72
+
68
73
  def store(descendant, methods)
69
74
  return if methods.empty?
70
75
  descendants_with_methods[descendant].concat(methods)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FakerBot
4
- VERSION = '0.4.2'
4
+ VERSION = '0.4.3'
5
5
  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.2
4
+ version: 0.4.3
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-10-05 00:00:00.000000000 Z
11
+ date: 2018-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faker