summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/hcl/commands.rb2
-rw-r--r--lib/hcl/day_entry.rb4
-rw-r--r--test/test_helper.rb2
3 files changed, 6 insertions, 2 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?
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 15741d4..0b8708d 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -13,7 +13,7 @@ require 'fileutils'
require 'fakeweb'
# override the default hcl dir
-ENV['HCL_DIR'] = __dir__+"/dot_hcl"
+ENV['HCL_DIR'] = File.dirname(__FILE__)+"/dot_hcl"
require 'hcl'