require_bench 1.0.4.pre.alpha.4 → 1.0.4.pre.alpha.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/require_bench/color_printer.rb +4 -4
- data/lib/require_bench/printer.rb +3 -4
- data/lib/require_bench/version.rb +1 -1
- data/lib/require_bench.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19377882af9bd069ef96a78e718e948231ca159dbd5c6b1592d256fa2cfc2526
|
4
|
+
data.tar.gz: 5354d7d662c5ed4cfd0a447ada65e0e124adad2cef568aad0e3990bcb14ccd13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d216841c7a42449a4d5d0e64e80c534b1a61e3027ffc889d2dc8de7b7cb8bec7ce8351b1547f3ac35891ab8db8966a87411723d3f53fb04924557e55960b24d2
|
7
|
+
data.tar.gz: a742cfbd360de6bebc5dd34f90a51c0328a11073ca48739912557bcae17e42ce6fc0543a680d89a31d4620287dc62ec73b54b3aa91d00bb5f7be1c16261045ae
|
@@ -18,20 +18,20 @@ class Printer
|
|
18
18
|
end
|
19
19
|
|
20
20
|
# Log statement when a file starts loading
|
21
|
-
def
|
21
|
+
def out_start(file, type)
|
22
22
|
printf "🚥 #{ColorizedString["[RequireBench-#{type}]"].colorize(first)} 📖 %s 🚥\n", file
|
23
|
-
rotate!
|
24
23
|
end
|
25
24
|
|
26
25
|
# Log statement when a file completed loading
|
27
|
-
def
|
26
|
+
def out_consume(seconds, file, type)
|
28
27
|
printf "🚥 #{ColorizedString["[RequireBench-#{type}]"].colorize(first)} ☑️ %10f %s 🚥\n", seconds, file
|
29
28
|
rotate!
|
30
29
|
end
|
31
30
|
|
32
31
|
# Log statement when a file raises an error while loading
|
33
|
-
def
|
32
|
+
def out_err(error, file, type)
|
34
33
|
printf "🚥 #{ColorizedString["[RequireBench-#{type}]"].colorize(first)} ❌ '#{error.class}: #{error.message}' loading %s 🚥\n#{error.backtrace.join("\n")}",
|
35
34
|
file
|
35
|
+
rotate!
|
36
36
|
end
|
37
37
|
end
|
@@ -2,18 +2,17 @@
|
|
2
2
|
|
3
3
|
class Printer
|
4
4
|
# Log statement when a file starts loading
|
5
|
-
def
|
5
|
+
def out_start(file, type)
|
6
6
|
printf "🚥 [RequireBench-#{type}] 📖 %s 🚥\n", file
|
7
|
-
rotate!
|
8
7
|
end
|
9
8
|
|
10
9
|
# Log statement when a file completed loading
|
11
|
-
def
|
10
|
+
def out_consume(seconds, file, type)
|
12
11
|
printf "🚥 [RequireBench-#{type}] ☑️ %10f %s 🚥\n", seconds, file
|
13
12
|
end
|
14
13
|
|
15
14
|
# Log statement when a file raises an error while loading
|
16
|
-
def
|
15
|
+
def out_err(error, file, type)
|
17
16
|
printf "🚥 [RequireBench-#{type}] ❌ '#{error.class}: #{error.message}' loading %s 🚥\n#{error.backtrace.join("\n")}",
|
18
17
|
file
|
19
18
|
end
|
data/lib/require_bench.rb
CHANGED
@@ -108,7 +108,7 @@ module RequireBench
|
|
108
108
|
end
|
109
109
|
end
|
110
110
|
end
|
111
|
-
PRINTER.
|
111
|
+
PRINTER.out_consume(seconds, file, short_type)
|
112
112
|
if prefix.nil? && (NO_GROUP_PATTERN.nil? || !NO_GROUP_PATTERN.match?(file))
|
113
113
|
# This results in grouping all files with the same leading path part (e.g. "models", or "lib")
|
114
114
|
# into the same timing bucket.
|
@@ -157,12 +157,12 @@ if REQUIRE_BENCH_ENABLED
|
|
157
157
|
short_type = type[0]
|
158
158
|
measure = RequireBench::INCLUDE_PATTERN && file_path.match?(RequireBench::INCLUDE_PATTERN)
|
159
159
|
skippy = RequireBench::SKIP_PATTERN && file_path.match?(RequireBench::SKIP_PATTERN)
|
160
|
-
RequireBench::PRINTER.
|
160
|
+
RequireBench::PRINTER.out_start(file, short_type) if RequireBench::LOG_START
|
161
161
|
if RequireBench::RESCUED_CLASSES.any?
|
162
162
|
begin
|
163
163
|
_require_bench_file(type, measure, skippy, file_path)
|
164
164
|
rescue *RequireBench::RESCUED_CLASSES => e
|
165
|
-
RequireBench::PRINTER.
|
165
|
+
RequireBench::PRINTER.out_error(e, file, short_type)
|
166
166
|
end
|
167
167
|
else
|
168
168
|
_require_bench_file(type, measure, skippy, file_path)
|