test-prof 1.0.0 → 1.0.5

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
  SHA256:
3
- metadata.gz: 97aebfdedf7ec34fcc2062c13766c1f80a3fa461819d8182164a7c7a77d7a772
4
- data.tar.gz: 82b988cae9745444567644481ebddf1876b730424b59a15581bf8ab37ba08033
3
+ metadata.gz: edd58f04fbf02f8bfa863b2c68e19f26fbdfb95c36bb361d012848f0a4f76790
4
+ data.tar.gz: 820c00eeaaea782bc89581005ac83cc147551550477519d7dd1a59a212f497c9
5
5
  SHA512:
6
- metadata.gz: c0276dc796e050fa5debed6e84d7b645c29e612d53498dd7ec1aa7506a38a9dfc1ced64ea7a6576d2b5984f6ef0d39350d3d0fcd9aa02c6974631017ea297dd6
7
- data.tar.gz: 9d5273502812d08edf39d9345b9854b97605499713e977bb0c39acf4879a8c7142ad7d04adab481e57c1913cf22afc39a448d170aea0cb3e4adfe0da5a66abb3
6
+ metadata.gz: f999f2073374210ef7c2afbedc977c21210f69e6e180fb54f6ce452741db1841b396b9358c9892e85ae972019d7204676d8a906d6a9f1f896c3669249027c935
7
+ data.tar.gz: 38c1f0d45d386acca3edbbd7c52b9d246f02f030cce0717f2480b2917b003c6f2b3542beb6caac45d8fe432bc69b6a7db1720768297eb4a1588f471727664409
data/CHANGELOG.md CHANGED
@@ -2,6 +2,46 @@
2
2
 
3
3
  ## master (unrealeased)
4
4
 
5
+ ## 1.0.5 (2021-05-13)
6
+
7
+ - Fix logging regression when no newline has been added. ([@palkan][])
8
+
9
+ ## 1.0.4 (2021-05-12)
10
+
11
+ - Add ability to use custom logger. ([@palkan][])
12
+
13
+ ```ruby
14
+ TestProf.configure do |config|
15
+ config.logger = Logger.new($stdout, level: Logger::WARN)
16
+ end
17
+ ```
18
+
19
+ - Add `nate_heckler` mode for FactoryProf. ([@palkan][])
20
+
21
+ Drop this into your `rails_helper.rb` or `test_helper.rb`:
22
+
23
+ ```ruby
24
+ require "test_prof/factory_prof/nate_heckler"
25
+ ```
26
+
27
+ And for every test run see the overall factories usage:
28
+
29
+ ```sh
30
+ [TEST PROF INFO] Time spent in factories: 04:31.222 (54% of total time)
31
+ ```
32
+
33
+ ## 1.0.3 (2021-04-30)
34
+
35
+ - Minor fixes.
36
+
37
+ ## 1.0.2 (2021-02-26)
38
+
39
+ - Make `before_all(setup_fixtures: true)` compatible with Rails 6.1. ([@palkan][])
40
+
41
+ ## 1.0.1 (2021-02-12)
42
+
43
+ - Fixed AnyFixture deprecation warning.
44
+
5
45
  ## 1.0.0 (2021-01-21)
6
46
 
7
47
  ## 1.0.0.rc2 (2021-01-06)
data/README.md CHANGED
@@ -32,7 +32,7 @@ TestProf toolbox aims to help you identify bottlenecks in your test suite. It co
32
32
  📑 [Documentation](https://test-prof.evilmartians.io)
33
33
 
34
34
  <p align="center">
35
- <a href="http://bit.ly/test-prof-map">
35
+ <a href="http://bit.ly/test-prof-map-v1">
36
36
  <img src="./docs/assets/images/coggle.png" alt="TestProf map" width="738">
37
37
  </a>
38
38
  </p>
data/lib/test_prof.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "fileutils"
4
+ require "logger"
5
+
4
6
  require "test_prof/version"
5
7
  require "test_prof/logging"
6
8
  require "test_prof/utils"
@@ -130,7 +132,7 @@ module TestProf
130
132
 
131
133
  # TestProf configuration
132
134
  class Configuration
133
- attr_accessor :output, # IO to write output messages.
135
+ attr_accessor :output, # IO to write logs
134
136
  :color, # Whether to colorize output or not
135
137
  :output_dir, # Directory to store artifacts
136
138
  :timestamps, # Whether to use timestamped names for artifacts,
@@ -145,12 +147,16 @@ module TestProf
145
147
  end
146
148
 
147
149
  def color?
148
- color == true
150
+ color == true && output.is_a?(IO) && output.tty?
149
151
  end
150
152
 
151
153
  def timestamps?
152
154
  timestamps == true
153
155
  end
156
+
157
+ def logger
158
+ @logger ||= Logger.new(output, formatter: Logging::Formatter.new)
159
+ end
154
160
  end
155
161
  end
156
162
 
@@ -161,5 +167,5 @@ require "test_prof/factory_doctor"
161
167
  require "test_prof/factory_prof"
162
168
  require "test_prof/rspec_stamp"
163
169
  require "test_prof/tag_prof"
164
- require "test_prof/rspec_dissect"
170
+ require "test_prof/rspec_dissect" if TestProf.rspec?
165
171
  require "test_prof/factory_all_stub"
@@ -6,7 +6,7 @@ require "test_prof/any_fixture/dump"
6
6
  module TestProf
7
7
  # Make DB fixtures from blocks.
8
8
  module AnyFixture
9
- INSERT_RXP = /^INSERT INTO ([\S]+)/.freeze
9
+ INSERT_RXP = /^INSERT INTO (\S+)/.freeze
10
10
 
11
11
  using FloatDuration
12
12
 
@@ -16,8 +16,8 @@ module TestProf
16
16
  :import_dump_via_cli, :dump_matching_queries, :force_matching_dumps
17
17
  attr_reader :default_dump_watch_paths
18
18
 
19
- alias reporting_enabled? reporting_enabled
20
- alias import_dump_via_cli? import_dump_via_cli
19
+ alias_method :reporting_enabled?, :reporting_enabled
20
+ alias_method :import_dump_via_cli?, :import_dump_via_cli
21
21
 
22
22
  def initialize
23
23
  @reporting_enabled = ENV["ANYFIXTURE_REPORT"] == "1"
@@ -42,7 +42,7 @@ module TestProf
42
42
  end
43
43
 
44
44
  def before_dump(&block)
45
- if block_given?
45
+ if block
46
46
  @before_dump << block
47
47
  else
48
48
  @before_dump
@@ -50,7 +50,7 @@ module TestProf
50
50
  end
51
51
 
52
52
  def after_dump(&block)
53
- if block_given?
53
+ if block
54
54
  @after_dump << block
55
55
  else
56
56
  @after_dump
@@ -112,7 +112,7 @@ module TestProf
112
112
  config.reporting_enabled
113
113
  end
114
114
 
115
- alias reporting_enabled? reporting_enabled
115
+ alias_method :reporting_enabled?, :reporting_enabled
116
116
 
117
117
  # Register a block of code as a fixture,
118
118
  # returns the result of the block execution
@@ -6,9 +6,9 @@ require "set"
6
6
 
7
7
  module TestProf
8
8
  module AnyFixture
9
- MODIFY_RXP = /^(INSERT INTO|UPDATE|DELETE FROM) ([\S]+)/i.freeze
10
- ANY_FIXTURE_RXP = /(\/\*|\-\-).*\bany_fixture:dump/.freeze
11
- ANY_FIXTURE_IGNORE_RXP = /(\/\*|\-\-).*\bany_fixture:ignore/.freeze
9
+ MODIFY_RXP = /^(INSERT INTO|UPDATE|DELETE FROM) (\S+)/i.freeze
10
+ ANY_FIXTURE_RXP = /(\/\*|--).*\bany_fixture:dump/.freeze
11
+ ANY_FIXTURE_IGNORE_RXP = /(\/\*|--).*\bany_fixture:ignore/.freeze
12
12
 
13
13
  using(Module.new do
14
14
  refine Object do
@@ -102,7 +102,7 @@ module TestProf
102
102
  def quoted(val)
103
103
  if val.is_a?(Array)
104
104
  val.map { |v| quoted(v) }
105
- elsif val.is_a?(ActiveRecord::Relation::QueryAttribute)
105
+ elsif val.is_a?(ActiveModel::Attribute)
106
106
  quoted(val.value_for_database)
107
107
  else
108
108
  ActiveRecord::Base.connection.quote(val)
@@ -111,7 +111,7 @@ module TestProf
111
111
  end
112
112
 
113
113
  attr_reader :name, :digest, :path, :subscriber, :success
114
- alias success? success
114
+ alias_method :success?, :success
115
115
 
116
116
  def initialize(name, watch: [], cache_key: nil)
117
117
  @name = name
@@ -79,7 +79,7 @@ module TestProf
79
79
  # config.before(:rollback) { ... }
80
80
  def before(type, &block)
81
81
  validate_hook_type!(type)
82
- hooks[type].before << block if block_given?
82
+ hooks[type].before << block if block
83
83
  end
84
84
 
85
85
  # Add `after` hook for `begin` or
@@ -88,7 +88,7 @@ module TestProf
88
88
  # config.after(:begin) { ... }
89
89
  def after(type, &block)
90
90
  validate_hook_type!(type)
91
- hooks[type].after << block if block_given?
91
+ hooks[type].after << block if block
92
92
  end
93
93
 
94
94
  def run_hooks(type) # :nodoc:
@@ -23,6 +23,7 @@ module TestProf
23
23
  test_object.instance_eval do
24
24
  @@already_loaded_fixtures ||= {}
25
25
  @fixture_cache ||= {}
26
+ config = ::ActiveRecord::Base
26
27
 
27
28
  if @@already_loaded_fixtures[self.class]
28
29
  @loaded_fixtures = @@already_loaded_fixtures[self.class]
@@ -6,7 +6,7 @@ module TestProf
6
6
  module CustomEvents
7
7
  class << self
8
8
  def register(event, &block)
9
- raise ArgumentError, "Block is required!" unless block_given?
9
+ raise ArgumentError, "Block is required!" unless block
10
10
  registrations[event] = block
11
11
  end
12
12
 
@@ -26,7 +26,7 @@ module TestProf::EventProf
26
26
 
27
27
  class << self
28
28
  def subscribe(event, &block)
29
- raise ArgumentError, "Block is required!" unless block_given?
29
+ raise ArgumentError, "Block is required!" unless block
30
30
 
31
31
  ::ActiveSupport::Notifications.subscribe(event, Subscriber.new(block))
32
32
  end
@@ -6,7 +6,7 @@ module TestProf
6
6
  attr_reader :event, :total_count, :total_time, :rank_by, :top_count, :per_example,
7
7
  :time, :count, :example_time, :example_count, :absolute_run_time
8
8
 
9
- alias per_example? per_example
9
+ alias_method :per_example?, :per_example
10
10
 
11
11
  def initialize(event:, instrumenter:, rank_by: :time, top_count: 5, per_example: false)
12
12
  @event = event
@@ -88,14 +88,13 @@ module TestProf
88
88
  end
89
89
 
90
90
  def results
91
- results = {
91
+ {
92
92
  groups: @groups.to_a
93
93
  }.tap do |data|
94
94
  next unless per_example?
95
95
 
96
96
  data[:examples] = @examples.to_a
97
97
  end
98
- results
99
98
  end
100
99
 
101
100
  def take_time(start_ts)
@@ -130,7 +129,7 @@ module TestProf
130
129
  end
131
130
 
132
131
  def each(&block)
133
- if block_given?
132
+ if block
134
133
  @profilers.each(&block)
135
134
  else
136
135
  @profilers.each
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "test_prof/factory_prof/printers/simple"
4
4
  require "test_prof/factory_prof/printers/flamegraph"
5
+ require "test_prof/factory_prof/printers/nate_heckler"
5
6
  require "test_prof/factory_prof/factory_builders/factory_bot"
6
7
  require "test_prof/factory_prof/factory_builders/fabrication"
7
8
 
@@ -10,14 +11,23 @@ module TestProf
10
11
  # flamegraphs or detect most popular factories
11
12
  module FactoryProf
12
13
  FACTORY_BUILDERS = [FactoryBuilders::FactoryBot,
13
- FactoryBuilders::Fabrication].freeze
14
+ FactoryBuilders::Fabrication].freeze
14
15
 
15
16
  # FactoryProf configuration
16
17
  class Configuration
17
- attr_accessor :mode
18
+ attr_accessor :mode, :printer
18
19
 
19
20
  def initialize
20
21
  @mode = ENV["FPROF"] == "flamegraph" ? :flamegraph : :simple
22
+ @printer =
23
+ case ENV["FPROF"]
24
+ when "flamegraph"
25
+ Printers::Flamegraph
26
+ when "nate_heckler"
27
+ Printers::NateHeckler
28
+ else
29
+ Printers::Simple
30
+ end
21
31
  end
22
32
 
23
33
  # Whether we want to generate flamegraphs
@@ -74,7 +84,15 @@ module TestProf
74
84
 
75
85
  log :info, "FactoryProf enabled (#{config.mode} mode)"
76
86
 
87
+ patch!
88
+ end
89
+
90
+ def patch!
91
+ return if @patched
92
+
77
93
  FACTORY_BUILDERS.each(&:patch)
94
+
95
+ @patched = true
78
96
  end
79
97
 
80
98
  # Inits FactoryProf and setups at exit hook,
@@ -82,9 +100,11 @@ module TestProf
82
100
  def run
83
101
  init
84
102
 
85
- printer = config.flamegraph? ? Printers::Flamegraph : Printers::Simple
103
+ printer = config.printer
104
+
105
+ started_at = TestProf.now
86
106
 
87
- at_exit { printer.dump(result) }
107
+ at_exit { printer.dump(result, start_time: started_at) }
88
108
 
89
109
  start
90
110
  end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "test_prof/factory_prof"
4
+
5
+ # A standalone Factory Prof printer which is meant to be always enabled
6
+
7
+ TestProf::FactoryProf.patch!
8
+
9
+ started_at = TestProf.now
10
+ at_exit do
11
+ TestProf::FactoryProf::Printers::NateHeckler.dump(
12
+ TestProf::FactoryProf.result, start_time: started_at
13
+ )
14
+ end
15
+
16
+ TestProf::FactoryProf.start
@@ -11,7 +11,7 @@ module TestProf::FactoryProf
11
11
  class << self
12
12
  include TestProf::Logging
13
13
 
14
- def dump(result)
14
+ def dump(result, **)
15
15
  return log(:info, "No factories detected") if result.raw_stats == {}
16
16
  report_data = {
17
17
  total_stacks: result.stacks.size,
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "test_prof/ext/float_duration"
4
+
5
+ module TestProf::FactoryProf
6
+ module Printers
7
+ # See https://twitter.com/nateberkopec/status/1389945187766456333
8
+ module NateHeckler # :nodoc: all
9
+ class << self
10
+ using TestProf::FloatDuration
11
+ include TestProf::Logging
12
+
13
+ def dump(result, start_time:)
14
+ return if result.raw_stats == {}
15
+
16
+ total_time = result.stats.sum { |stat| stat[:top_level_time] }
17
+ total_run_time = TestProf.now - start_time
18
+
19
+ percentage = ((total_time / total_run_time) * 100).round(2)
20
+
21
+ log :info, "Time spent in factories: #{total_time.duration} (#{percentage}% of total time)"
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -1,15 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "test_prof/ext/float_duration"
4
+
3
5
  module TestProf::FactoryProf
4
6
  module Printers
5
7
  module Simple # :nodoc: all
6
8
  class << self
9
+ using TestProf::FloatDuration
7
10
  include TestProf::Logging
8
11
 
9
- def dump(result)
12
+ def dump(result, start_time:)
10
13
  return log(:info, "No factories detected") if result.raw_stats == {}
11
14
  msgs = []
12
15
 
16
+ total_run_time = TestProf.now - start_time
13
17
  total_count = result.stats.sum { |stat| stat[:total_count] }
14
18
  total_top_level_count = result.stats.sum { |stat| stat[:top_level_count] }
15
19
  total_time = result.stats.sum { |stat| stat[:top_level_time] }
@@ -21,7 +25,7 @@ module TestProf::FactoryProf
21
25
 
22
26
  Total: #{total_count}
23
27
  Total top-level: #{total_top_level_count}
24
- Total time: #{format("%.4f", total_time)}s
28
+ Total time: #{total_time.duration} (out of #{total_run_time.duration})
25
29
  Total uniq factories: #{total_uniq_factories}
26
30
 
27
31
  total top-level total time time per call top-level time name
@@ -4,23 +4,29 @@ module TestProf
4
4
  # Helper for output printing
5
5
  module Logging
6
6
  COLORS = {
7
- info: "\e[34m", # blue
8
- warn: "\e[33m", # yellow
9
- error: "\e[31m" # red
7
+ INFO: "\e[34m", # blue
8
+ WARN: "\e[33m", # yellow
9
+ ERROR: "\e[31m" # red
10
10
  }.freeze
11
11
 
12
- def log(level, msg)
13
- TestProf.config.output.puts(build_log_msg(level, msg))
14
- end
12
+ class Formatter
13
+ def call(severity, _time, progname, msg)
14
+ colorize(severity.to_sym, "[#{progname} #{severity}] #{msg}\n")
15
+ end
15
16
 
16
- def build_log_msg(level, msg)
17
- colorize(level, "[TEST PROF #{level.to_s.upcase}] #{msg}")
18
- end
17
+ private
18
+
19
+ def colorize(level, msg)
20
+ return msg unless TestProf.config.color?
19
21
 
20
- def colorize(level, msg)
21
- return msg unless TestProf.config.color?
22
+ return msg unless COLORS.key?(level)
22
23
 
23
- "#{COLORS[level]}#{msg}\e[0m"
24
+ "#{COLORS[level]}#{msg}\e[0m"
25
+ end
26
+ end
27
+
28
+ def log(level, msg)
29
+ TestProf.config.logger.public_send(level, "TEST PROF") { msg }
24
30
  end
25
31
  end
26
32
  end
@@ -12,7 +12,7 @@ module TestProf
12
12
  def logger
13
13
  return @logger if instance_variable_defined?(:@logger)
14
14
 
15
- @logger = Logger.new(STDOUT)
15
+ @logger = Logger.new($stdout)
16
16
  end
17
17
 
18
18
  def ar_loggables
@@ -11,8 +11,8 @@ module TestProf
11
11
  attr_reader :active, :block, :captured_ivars, :teardown_block, :current_test_object,
12
12
  :setup_fixtures
13
13
 
14
- alias active? active
15
- alias setup_fixtures? setup_fixtures
14
+ alias_method :active?, :active
15
+ alias_method :setup_fixtures?, :setup_fixtures
16
16
 
17
17
  def initialize(setup_fixtures: false, &block)
18
18
  @setup_fixtures = setup_fixtures
@@ -15,7 +15,7 @@ RSpec.configure do |config|
15
15
  config.include_context "any_fixture:clean", with_clean_fixture: true
16
16
 
17
17
  config.after(:suite) do
18
- TestProf::AnyFixture.report_stats if TestProf::AnyFixture.reporting_enabled?
18
+ TestProf::AnyFixture.report_stats if TestProf::AnyFixture.config.reporting_enabled?
19
19
  TestProf::AnyFixture.reset
20
20
  end
21
21
  end
@@ -7,7 +7,7 @@ module TestProf
7
7
  # Helper to wrap the whole example group into a transaction
8
8
  module RSpec
9
9
  def before_all(setup_fixtures: BeforeAll.config.setup_fixtures, &block)
10
- raise ArgumentError, "Block is required!" unless block_given?
10
+ raise ArgumentError, "Block is required!" unless block
11
11
 
12
12
  if within_before_all?
13
13
  before(:all) do
@@ -55,9 +55,7 @@ module TestProf
55
55
  end
56
56
 
57
57
  def module_for(group)
58
- modules[group] ||= begin
59
- Module.new.tap { |mod| group.prepend(mod) }
60
- end
58
+ modules[group] ||= Module.new.tap { |mod| group.prepend(mod) }
61
59
  end
62
60
 
63
61
  private
@@ -91,8 +89,7 @@ module TestProf
91
89
  initializer = proc do
92
90
  instance_variable_set(:"#{TestProf::LetItBe::PREFIX}#{identifier}", instance_exec(&block))
93
91
  rescue FrozenError => e
94
- e.message << TestProf::LetItBe::FROZEN_ERROR_HINT
95
- raise
92
+ raise e.exception("#{e.message}#{TestProf::LetItBe::FROZEN_ERROR_HINT}")
96
93
  end
97
94
 
98
95
  default_options = LetItBe.config.default_modifiers.dup
@@ -243,7 +240,7 @@ end
243
240
  RSpec.configure do |config|
244
241
  config.after(:example) do |example|
245
242
  if example.exception&.is_a?(FrozenError)
246
- example.exception.message << TestProf::LetItBe::FROZEN_ERROR_HINT
243
+ example.exception.message << TestProf::LetItBe::FROZEN_ERROR_HINT unless example.exception.message.frozen?
247
244
  end
248
245
  end
249
246
  end
@@ -38,7 +38,7 @@ module TestProf
38
38
  attr_accessor :top_count, :let_stats_enabled,
39
39
  :let_top_count
40
40
 
41
- alias let_stats_enabled? let_stats_enabled
41
+ alias_method :let_stats_enabled?, :let_stats_enabled
42
42
 
43
43
  attr_reader :mode
44
44
 
@@ -139,7 +139,7 @@ end
139
139
 
140
140
  require "test_prof/rspec_dissect/collectors/let"
141
141
  require "test_prof/rspec_dissect/collectors/before"
142
- require "test_prof/rspec_dissect/rspec" if TestProf.rspec?
142
+ require "test_prof/rspec_dissect/rspec"
143
143
 
144
144
  TestProf.activate("RD_PROF") do
145
145
  TestProf::RSpecDissect.init
@@ -39,7 +39,7 @@ module TestProf
39
39
  acc << if v.nil?
40
40
  k.to_sym
41
41
  else
42
- Hash[k.to_sym, v.to_sym]
42
+ {k.to_sym => v.to_sym}
43
43
  end
44
44
  end
45
45
  end
@@ -239,16 +239,18 @@ module TestProf
239
239
  end
240
240
 
241
241
  def exclude_common_methods(profiler)
242
- profiler.exclude_methods!(
243
- TSort,
244
- :tsort_each
245
- )
242
+ if defined?(TSort)
243
+ profiler.exclude_methods!(
244
+ TSort,
245
+ :tsort_each
246
+ )
246
247
 
247
- profiler.exclude_methods!(
248
- TSort.singleton_class,
249
- :tsort_each, :each_strongly_connected_component,
250
- :each_strongly_connected_component_from
251
- )
248
+ profiler.exclude_methods!(
249
+ TSort.singleton_class,
250
+ :tsort_each, :each_strongly_connected_component,
251
+ :each_strongly_connected_component_from
252
+ )
253
+ end
252
254
 
253
255
  profiler.exclude_methods!(
254
256
  BasicObject,
@@ -12,7 +12,7 @@ module TestProf
12
12
 
13
13
  @data = Hash.new do |h, k|
14
14
  h[k] = {value: k, count: 0, time: 0.0}
15
- h[k].merge!(Hash[events.map { |event| [event, 0.0] }]) unless
15
+ h[k].merge!(events.map { |event| [event, 0.0] }.to_h) unless
16
16
  events.empty?
17
17
  h[k]
18
18
  end
@@ -53,11 +53,9 @@ module TestProf
53
53
  def fetch_events_data
54
54
  return {} unless @events_profiler
55
55
 
56
- Hash[
57
- @events_profiler.profilers.map do |profiler|
58
- [profiler.event, profiler.time]
59
- end
60
- ]
56
+ @events_profiler.profilers.map do |profiler|
57
+ [profiler.event, profiler.time]
58
+ end.to_h
61
59
  end
62
60
  end
63
61
  end
@@ -14,7 +14,7 @@ module TestProf
14
14
  def initialize(max_size, sort_by: nil, &block)
15
15
  @max_size = max_size
16
16
  @comparator =
17
- if block_given?
17
+ if block
18
18
  block
19
19
  elsif !sort_by.nil?
20
20
  ->(x, y) { x[sort_by] >= y[sort_by] }
@@ -42,7 +42,7 @@ module TestProf
42
42
  end
43
43
 
44
44
  def each(&block)
45
- if block_given?
45
+ if block
46
46
  data.each(&block)
47
47
  else
48
48
  data.each
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TestProf
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-prof
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-21 00:00:00.000000000 Z
11
+ date: 2021-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -174,7 +174,9 @@ files:
174
174
  - lib/test_prof/factory_prof/factory_bot_patch.rb
175
175
  - lib/test_prof/factory_prof/factory_builders/fabrication.rb
176
176
  - lib/test_prof/factory_prof/factory_builders/factory_bot.rb
177
+ - lib/test_prof/factory_prof/nate_heckler.rb
177
178
  - lib/test_prof/factory_prof/printers/flamegraph.rb
179
+ - lib/test_prof/factory_prof/printers/nate_heckler.rb
178
180
  - lib/test_prof/factory_prof/printers/simple.rb
179
181
  - lib/test_prof/logging.rb
180
182
  - lib/test_prof/recipes/logging.rb
@@ -214,12 +216,13 @@ homepage: http://github.com/test-prof/test-prof
214
216
  licenses:
215
217
  - MIT
216
218
  metadata:
217
- bug_tracker_uri: http://github.com/test-prof/test-prof/issues
219
+ bug_tracker_uri: https://github.com/test-prof/test-prof/issues
218
220
  changelog_uri: https://github.com/test-prof/test-prof/blob/master/CHANGELOG.md
219
221
  documentation_uri: https://test-prof.evilmartians.io/
220
222
  homepage_uri: https://test-prof.evilmartians.io/
221
- source_code_uri: http://github.com/test-prof/test-prof
222
- post_install_message:
223
+ source_code_uri: https://github.com/test-prof/test-prof
224
+ funding_uri: https://github.com/sponsors/test-prof
225
+ post_install_message:
223
226
  rdoc_options: []
224
227
  require_paths:
225
228
  - lib
@@ -234,8 +237,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
237
  - !ruby/object:Gem::Version
235
238
  version: '0'
236
239
  requirements: []
237
- rubygems_version: 3.0.6
238
- signing_key:
240
+ rubygems_version: 3.2.15
241
+ signing_key:
239
242
  specification_version: 4
240
243
  summary: Ruby applications tests profiling tools
241
244
  test_files: []