lib/require_bench.rb in require_bench-1.0.0 vs lib/require_bench.rb in require_bench-1.0.1
- old
+ new
@@ -1,10 +1,12 @@
+# frozen_string_literal: true
+
# STD Libs
require 'benchmark'
# This Gem
-require "require_bench/version"
+require 'require_bench/version'
module RequireBench
TIMINGS = Hash.new { |h, k| h[k] = 0.0 }
if ENV['REQUIRE_BENCH'] == 'true'
@@ -32,12 +34,12 @@
if skips
skip_pattern = case skips
when Regexp then
skips
when Array then
- Regexp.new(skips.map{ |x| Regexp.escape(x) }.join('|'))
+ Regexp.new(skips.map { |x| Regexp.escape(x) }.join('|'))
when String then
- Regexp.new(skips.split(',').map{ |x| Regexp.escape(x) }.join('|'))
+ Regexp.new(skips.split(',').map { |x| Regexp.escape(x) }.join('|'))
end
puts "[RequireBench] Setting REQUIRE_BENCH_SKIP_PATTERN to #{skip_pattern}"
ENV['REQUIRE_BENCH_SKIP_PATTERN'] = skip_pattern
end
# A Kernel hack that adds require timing to find require problems in app.