pry-auto_benching.rb 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/pry-auto_benching/version.rb +1 -1
- data/lib/pry-auto_benching.rb +1 -1
- 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: 5b240184c50fc0db87a2b924a88a36fea5567100cbed5b2eb3c851d5321afb9f
|
4
|
+
data.tar.gz: 35df0930279f3437748ce57d0f19189f0344e6051268c8d49d25076985ca5496
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5380fb68936080bacf6b846a9b2c1ea035bc8caca77091c1d7144f665a677f60ca5d18a066ff719d3d103366b7f1150eb06e660917543390c39193e0cb32bdd4
|
7
|
+
data.tar.gz: 9a96ad7491db7347ea855300725cef7b704bc99b8745e9f721553cd7a68b44a3ea1612b72e6cefd00b1c37b0ba5ee86aa243e6cc0cc3113961d663b99f0dd5cb
|
data/README.md
CHANGED
@@ -21,7 +21,7 @@ Pry.configure do |config|
|
|
21
21
|
|
22
22
|
# Configure where benchmark results should be displayed, either
|
23
23
|
# in the prompt or written to stdout. Default is :prompt.
|
24
|
-
config.auto_benching.target_display = ':prompt | :
|
24
|
+
config.auto_benching.target_display = ':prompt | :output'
|
25
25
|
|
26
26
|
# Benchmark results are printed depending on the return value
|
27
27
|
# of this lambda, by default results are printed if duration >= 0.1s
|
@@ -34,7 +34,7 @@ Pry.configure do |config|
|
|
34
34
|
config.auto_benching.prompt_color = :red
|
35
35
|
|
36
36
|
# A lambda for presenting the benchmark results when `target_display`
|
37
|
-
# is :
|
37
|
+
# is :output. Default is: "Benchmark: %.2fs".
|
38
38
|
config.auto_benching.speaker = ->(pry, duration) {
|
39
39
|
pry.pager.page sprintf("Elapsed time: %.2fs", duration)
|
40
40
|
}
|
@@ -74,8 +74,8 @@ easy to spot in a sea of output.
|
|
74
74
|
|
75
75
|
__4.__
|
76
76
|
|
77
|
-
A screenshot, using `:
|
78
|
-
To switch to using this display, run `_pry_.config.auto_benching.target_display = :
|
77
|
+
A screenshot, using `:output` as the target_display.
|
78
|
+
To switch to using this display, run `_pry_.config.auto_benching.target_display = :output`
|
79
79
|
inside the repl or set `Pry.config.auto_benching.target_display` from your .pryrc for a
|
80
80
|
permanent change.
|
81
81
|
|
data/lib/pry-auto_benching.rb
CHANGED
@@ -13,7 +13,7 @@ module Pry::AutoBenching
|
|
13
13
|
pry.config.prompt_name = Pry.lazy {
|
14
14
|
"#{Pry::Helpers::Text.send(prompt_color, duration.to_s + 's')} "
|
15
15
|
}
|
16
|
-
elsif target_display == :
|
16
|
+
elsif target_display == :output
|
17
17
|
pry.config.auto_benching.speaker.call(pry, duration)
|
18
18
|
else
|
19
19
|
raise Pry::CommandError, "_pry_.config.auto_benching.target_display has an invalid value (#{target_display})"
|