lib/TokiCLI/view.rb in TokiCLI-0.0.3 vs lib/TokiCLI/view.rb in TokiCLI-0.0.4
- old
+ new
@@ -2,31 +2,30 @@
module TokiCLI
class View
def total_table(list)
table = init_table
table.title = "Your apps monitored by Toki"
- table_2(list, table)
+ puts table_2(list, table)
+ puts "\n"
end
def day_table(day, list)
table = init_table
table.title = "Your apps monitored by Toki on #{day}"
- table_2(list, table)
+ puts table_2(list, table)
+ puts "\n"
end
def range_table(day1, day2, list)
table = init_table
table.title = "Your apps monitored by Toki between #{day1} and #{day2}"
- table_2(list, table)
+ puts table_2(list, table)
+ puts "\n"
end
- def hours_table(hour1, hour2, list)
- table = init_table
- table.title = "Your apps monitored by Toki between #{hour1} and #{hour2}"
- table_2(list, table)
- end
def hits_table(list)
table = init_table
table.title = "Your top apps monitored by Toki"
- table2_index(list, table)
+ puts table2_index(list, table)
+ puts "\n"
end
def app_table(asked, app_data)
table = init_table
table.style = { :width => 100 }
table.title = "Toki time tracking for '#{asked}' => #{app_data.first[1][:name]}"
@@ -42,10 +41,11 @@
table << ["#{log[:from]}", "#{log[:to]}", "#{log[:duration]}", "#{id}"]
table << :separator unless @index == @length
end
table << :separator
table << [{ :value => "Total: #{@total['total']}", :colspan => 4, :alignment => :center }]
- table
+ puts table
+ puts "\n"
end
private
def init_table