Class: Dude::Interface

Inherits:
Object
  • Object
show all
Includes:
Settings
Defined in:
lib/dude/interface.rb

Constant Summary

Constants included from Settings

Settings::CONFIG_FILE

Instance Method Summary collapse

Methods included from Settings

#file, #read, #settings

Constructor Details

#initializeInterface

Returns a new instance of Interface.



8
9
# File 'lib/dude/interface.rb', line 8

def initialize
end

Instance Method Details

#issues_list(issues) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/dude/interface.rb', line 17

def issues_list(issues)
  [['To Do', :yellow], ['Doing', :green], ['To Verify', :blue]].each do |group, color|
    puts "#{group}:".colorize(color).bold
    grouped = issues.select {|i| i.last.include?(group)}
    if grouped.length.zero?
      puts 'Nothing'
    else
      grouped.each do |id, issue, labels|
        puts "#{id}:".colorize(color) + " #{issue} #{labels.compact.to_s.gsub('"', "")}"
      end
    end
    puts ''
  end
end

#report(worked_week, worked_today) ⇒ Object



11
12
13
14
15
# File 'lib/dude/interface.rb', line 11

def report(worked_week, worked_today)
  report_weekly(worked_week)
  puts ''
  report_daily(worked_today, worked_week)
end