Sha256: 933ad97384bc67801730a483e4b49b37d8854cd53ef1ef72412d201eb4401fff

Contents?: true

Size: 443 Bytes

Versions: 14

Compression:

Stored size: 443 Bytes

Contents

module DeepCover
  module Tools::Format
    CONVERT = Hash.new('  ')
    CONVERT[0] = 'x '
    CONVERT[nil] = '- '

    def format(*results, filename: nil, source: nil)
      source ||= File.read(filename)
      results.map!{|counts| counts.map{|c| CONVERT[c]}}
      [*results, source.lines].transpose.map do |parts|
        *line_results, line = parts
        Term::ANSIColor.white(line_results.join) + line.to_s
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
deep-cover-0.1.14 lib/deep_cover/tools/format.rb
deep-cover-0.1.13 lib/deep_cover/tools/format.rb
deep-cover-0.1.12 lib/deep_cover/tools/format.rb
deep-cover-0.1.11 lib/deep_cover/tools/format.rb
deep-cover-0.1.10 lib/deep_cover/tools/format.rb
deep-cover-0.1.9 lib/deep_cover/tools/format.rb
deep-cover-0.1.8 lib/deep_cover/tools/format.rb
deep-cover-0.1.7 lib/deep_cover/tools/format.rb
deep-cover-0.1.6 lib/deep_cover/tools/format.rb
deep-cover-0.1.5 lib/deep_cover/tools/format.rb
deep-cover-0.1.4 lib/deep_cover/tools/format.rb
deep-cover-0.1.3 lib/deep_cover/tools/format.rb
deep-cover-0.1.2 lib/deep_cover/tools/format.rb
deep-cover-0.1.1 lib/deep_cover/tools/format.rb