<commit_before>require 'hirb'

module PT

  class DataTable

    extend ::Hirb::Console

    def initialize(dataset)
      @rows = dataset.map{ |row| DataRow.new(row, dataset) }
    end

    def print
      if @rows.empty?
        puts "\n         -- empty list --         \n"
      else
        self.class.table @rows, :fields => [:num] + self.class.fields, :unicode => true, :description => false
      end
    end

    def [](pos)
      pos = pos.to_i
      (pos < 1 || pos > @rows.length) ? nil : @rows[pos-1].record
    end

    def length
      @rows.length
    end

    def self.fields
      []
    end

  end


  class ProjectTable < DataTable

    def self.fields
      [:name]
    end

  end


  class TasksTable < DataTable

    def self.fields
      [:name, :current_state]<commit_msg>Add Tracker id to TasksTable<commit_after>require 'hirb'

module PT

  class DataTable

    extend ::Hirb::Console

    def initialize(dataset)
      @rows = dataset.map{ |row| DataRow.new(row, dataset) }
    end

    def print
      if @rows.empty?
        puts "\n         -- empty list --         \n"
      else
        self.class.table @rows, :fields => [:num] + self.class.fields, :unicode => true, :description => false
      end
    end

    def [](pos)
      pos = pos.to_i
      (pos < 1 || pos > @rows.length) ? nil : @rows[pos-1].record
    end

    def length
      @rows.length
    end

    def self.fields
      []
    end

  end


  class ProjectTable < DataTable

    def self.fields
      [:name]
    end

  end


  class TasksTable < DataTable

    def self.fields
      [:name, :current_state, :id]
{'fraction_non_alphanumeric': 0.11524163568773234, 'fraction_numerical': 0.0024783147459727386, 'mean_word_length': 1.8333333333333333, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5407723', 'n_tokens_mistral': 554, 'n_tokens_neox': 517, 'n_words': 146}