Module: RSpecTelemetry::ConsoleReport::Helpers
- Included in:
- RSpecTelemetry::ConsoleReport
- Defined in:
- lib/rspec_telemetry/console_report.rb
Class Method Summary collapse
- .fmt(ms) ⇒ Object
- .objects(count) ⇒ Object
- .pct(ratio) ⇒ Object
- .section(title) ⇒ Object
- .truncate(str, len) ⇒ Object
Class Method Details
.fmt(ms) ⇒ Object
10 |
# File 'lib/rspec_telemetry/console_report.rb', line 10 def fmt(ms) = Formatting.duration(ms) |
.objects(count) ⇒ Object
16 17 18 |
# File 'lib/rspec_telemetry/console_report.rb', line 16 def objects(count) count >= 1_000_000 ? format("%.1fM", count / 1_000_000.0) : count.to_s end |
.pct(ratio) ⇒ Object
12 |
# File 'lib/rspec_telemetry/console_report.rb', line 12 def pct(ratio) = Formatting.percent(ratio * 100) |
.section(title) ⇒ Object
20 |
# File 'lib/rspec_telemetry/console_report.rb', line 20 def section(title) = ["", title, "-" * title.length] |
.truncate(str, len) ⇒ Object
14 |
# File 'lib/rspec_telemetry/console_report.rb', line 14 def truncate(str, len) = str.length > len ? "#{str[0, len - 1]}…" : str |