Class: Spoom::Coverage::SnapshotPrinter

Inherits:
Printer
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/spoom/coverage/snapshot.rb

Instance Attribute Summary

Attributes inherited from Printer

#out

Instance Method Summary collapse

Methods inherited from Printer

#colorize, #dedent, #indent, #initialize, #print, #print_colored, #printl, #printn, #printt

Methods included from Spoom::Colorize

#set_color

Constructor Details

This class inherits a constructor from Spoom::Printer

Instance Method Details



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/spoom/coverage/snapshot.rb', line 80

def print_snapshot(snapshot)
  methods = snapshot.methods_with_sig + snapshot.methods_without_sig
  calls = snapshot.calls_typed + snapshot.calls_untyped

  if snapshot.version_static || snapshot.version_runtime
    printl("Sorbet static: #{snapshot.version_static}") if snapshot.version_static
    printl("Sorbet runtime: #{snapshot.version_runtime}") if snapshot.version_runtime
    printn
  end
  printl("Content:")
  indent
  printl("files: #{snapshot.files} (including #{snapshot.rbi_files} RBIs)")
  printl("modules: #{snapshot.modules}")
  printl("classes: #{snapshot.classes - snapshot.singleton_classes}")
  printl("methods: #{methods}")
  dedent
  printn
  printl("Sigils:")
  print_map(snapshot.sigils, snapshot.files)
  printn
  printl("Methods:")
  methods_map = {
    "with signature" => snapshot.methods_with_sig,
    "without signature" => snapshot.methods_without_sig,
  }
  print_map(methods_map, methods)
  printn
  printl("Calls:")
  calls_map = {
    "typed" => snapshot.calls_typed,
    "untyped" => snapshot.calls_untyped,
  }
  print_map(calls_map, calls)
end