Sha256: ebbeff22103dc7160841643588aac32bdd7fdfd04a67c823eb0a398160df549e

Contents?: true

Size: 673 Bytes

Versions: 11

Compression:

Stored size: 673 Bytes

Contents

module Steep
  module Drivers
    class TracePrinter
      attr_reader :io

      def initialize(io)
        @io = io
      end

      def print(trace, level: 0)
        trace.each.with_index do |t, i|
          prefix = "  " * (i + level)
          case t[0]
          when :type
            io.puts "#{prefix}#{t[1]} <: #{t[2]}"
          when :method
            io.puts "#{prefix}(#{t[3]}) #{t[1]} <: #{t[2]}"
          when :method_type
            io.puts "#{prefix}#{t[1]} <: #{t[2]}"
          when :interface
            # nop
          else
            Steep.logger.error { "Unexpected trace item: #{t[0]}" }
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
steep-0.47.1 lib/steep/drivers/trace_printer.rb
steep-0.47.0 lib/steep/drivers/trace_printer.rb
steep-0.46.0 lib/steep/drivers/trace_printer.rb
steep-0.45.0 lib/steep/drivers/trace_printer.rb
steep-0.44.1 lib/steep/drivers/trace_printer.rb
steep-0.44.0 lib/steep/drivers/trace_printer.rb
steep-0.43.1 lib/steep/drivers/trace_printer.rb
steep-0.43.0 lib/steep/drivers/trace_printer.rb
steep-0.42.0 lib/steep/drivers/trace_printer.rb
steep-0.41.0 lib/steep/drivers/trace_printer.rb
steep-0.40.0 lib/steep/drivers/trace_printer.rb