From da6cc3fdcf96bcecadb4be37f5c7d3b49ee5299b Mon Sep 17 00:00:00 2001 From: Zack Hobson Date: Sat, 30 Nov 2013 09:05:05 -0800 Subject: fixes for 1.9.3 --- lib/hcl/commands.rb | 2 +- lib/hcl/day_entry.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') 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? -- cgit v1.2.3