diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/hcl/commands.rb | 2 | ||||
| -rw-r--r-- | lib/hcl/day_entry.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/hcl/commands.rb b/lib/hcl/commands.rb index 9c7e913..fb5a04a 100644 --- a/lib/hcl/commands.rb +++ b/lib/hcl/commands.rb @@ -129,7 +129,7 @@ module HCl DayEntry.all(date).each do |day| running = day.running? ? '(running) ' : '' columns = HighLine::SystemExtensions.terminal_size[0] - result << "\t#{day.formatted_hours}\t#{running}#{day.project}: #{day.notes.lines.last}\n"[0..columns-1] + result << "\t#{day.formatted_hours}\t#{running}#{day.project}: #{day.notes.lines.to_a.last}\n"[0..columns-1] total_hours = total_hours + day.hours.to_f end result << ("\t" + '-' * 13) << "\n" diff --git a/lib/hcl/day_entry.rb b/lib/hcl/day_entry.rb index c3fe254..6ef1708 100644 --- a/lib/hcl/day_entry.rb +++ b/lib/hcl/day_entry.rb @@ -15,6 +15,10 @@ module HCl "#{client} - #{project} - #{task} (#{formatted_hours})" end + def task + @data[:task] + end + def self.from_xml xml doc = REXML::Document.new xml raise Failure, "No root node in XML document: #{xml}" if doc.root.nil? |
