Sha256: aec230c1132deaa41013c0a70d8d567c83613903174f7c3ce083d6985a6891fa

Contents?: true

Size: 526 Bytes

Versions: 5

Compression:

Stored size: 526 Bytes

Contents

require "csv"

def read_topic_file(file)
  topics = {}
  CSV.foreach(file) do |row|
    row.each do |col|
      lib = nil
      row.each do |col|
        if !lib
          lib = col
          next
        end
        if !col || col.empty?
          next
        end
        topics[col] ||= []
        topics[col].push(lib) unless topics[col].include?(lib)
      end
    end
  end
  topics
end

def print_topics(topics)
  topics.sort.each do |topic, libs|
    puts "#{topic} (#{libs.count}): #{libs.sort.join(", ")}"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
inqlude-0.12.0 topics/list_topics.rb
inqlude-0.11.0 topics/list_topics.rb
inqlude-0.10.0 topics/list_topics.rb
inqlude-0.9.0 topics/list_topics.rb
inqlude-0.8.0 topics/list_topics.rb