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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a8d4fbb91389beba704a5b36a71836104d226e4
4
- data.tar.gz: 703b5cedd981ed5cdacb60ae2d55e3253568e51e
3
+ metadata.gz: 44da8e438f0c884d15069fb45e3badb33c49bd0c
4
+ data.tar.gz: 3e2e93c81fc81c12cfe7bdd7d58c3b2b78b5cb81
5
5
  SHA512:
6
- metadata.gz: 5c032e7c36a7e5fbf6f3353fbf73136b08ff534f235cdb800041e1a812ff7747f6e8eb6769715e72fc619c5dc9f5a744ba8ae7c8578357e40a0ef3f727929877
7
- data.tar.gz: e19c40f410b79cc33410a1bfdb0a701d11a346e3d8a382569d67e3ff56843181e085d2d32e4d21b910343edbec57dfb1fdbbf9c310cb5185fdb1160b28cea78c
6
+ metadata.gz: ea3bb7b47d06a5f481375edec417f1ba134705bca27bbd042591bde176115a110de264302970d38a22e75debdaf1a1d56a1e93b4bb1dfbb4f9f6eed1fb591fae
7
+ data.tar.gz: 4eba4f93af011f524881793f76d75d80c38d744aa72d653f0cca3b1753ce51b5b44b1cd64fc8767188d544925f5b265c20f6d8eee0bcd14754fb2868e2c950a0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fakerbot (0.4.1)
4
+ fakerbot (0.4.2)
5
5
  faker
6
6
  pastel (~> 0.7.2)
7
7
  thor (~> 0.20.0)
data/Rakefile CHANGED
@@ -1,6 +1,8 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
3
5
 
4
6
  RSpec::Core::RakeTask.new(:spec)
5
7
 
6
- task :default => :spec
8
+ task default: :spec
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'bundler/setup'
4
5
  require 'fakerbot'
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  lib_path = File.expand_path('../lib', __dir__)
5
- $:.unshift(lib_path) if !$:.include?(lib_path)
5
+ $LOAD_PATH.unshift(lib_path) unless $LOAD_PATH.include?(lib_path)
6
6
  require 'fakerbot'
7
7
 
8
8
  Signal.trap('INT') do
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'fakerbot/cli'
@@ -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?(/#{query}/i) }
63
+ matching = methods.select { |m| m.match(/#{query}/i) }
64
64
  store(faker, matching)
65
65
  end
66
66
  end
@@ -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.to_s}") << crayon.dim.magenta.bold("#{message}")
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.to_s}") ? ' ( WILL BE DEPRECATED )' : ''
81
+ const.respond_to?(:"_deprecated_#{method}") ? ' ( WILL BE DEPRECATED )' : ''
81
82
  end
82
83
  end
83
84
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module FakerBot
2
- VERSION = '0.4.1'.freeze
4
+ VERSION = '0.4.2'
3
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.1
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-09-18 00:00:00.000000000 Z
11
+ date: 2018-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faker