lib/pt/data_table.rb in pt-0.7.1 vs lib/pt/data_table.rb in pt-0.7.2

- old
+ new

@@ -12,14 +12,20 @@ def print(config={}) if @rows.empty? puts "\n#{'-- empty list --'.center(36)}\n" else + + max_width = Hirb::Util.detect_terminal_size()[0] + if config[:max_width] && config[:max_width] < max_width + max_width = config[:max_width] + end + self.class.table @rows, :fields => [:num] + self.class.fields, :change_fields => %w{num pt_id}, :unicode => true, :description => false, - :max_width => config[:max_width] + :max_width => max_width end end def [](pos) pos = pos.to_i @@ -47,10 +53,18 @@ class TasksTable < DataTable def self.fields - [:name, :current_state, :id] + [:name, :state, :id] + end + + end + + class MultiUserTasksTable < DataTable + + def self.fields + [:owned_by, :name, :state, :id] end end class MembersTable < DataTable