Sha256: de7f1660843a62e6ed08a1a833f53c4a2b00f965d97e265d9f6aa51d33d67257

Contents?: true

Size: 399 Bytes

Versions: 5

Compression:

Stored size: 399 Bytes

Contents

class FormatCode2Doc
  def call(code)
    out = ""
    title = "#{code.filename} (#{code.type})"
    out << ("-" * title.size + "\n")
    out << "#{title}\n"
    if code.features.size.positive?
      out << "* features: #{code.features.join(", ")}"
    end
    out << "\n"
    code.lines.each_with_index do |line, index|
      out << "#{index} | #{line}\n"
    end
    out << "\n"
    out
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
asker-tool-2.9.4 lib/asker/exporter/doc/format_code2doc.rb
asker-tool-2.9.3 lib/asker/exporter/doc/format_code2doc.rb
asker-tool-2.9.2 lib/asker/exporter/doc/format_code2doc.rb
asker-tool-2.9.1 lib/asker/exporter/doc/format_code2doc.rb
asker-tool-2.9.0 lib/asker/exporter/doc/format_code2doc.rb