summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Scharf2009-11-05 09:34:58 -0500
committerbricooke2010-09-21 12:33:32 -0600
commitc3176bfacd2d08c556708cb955b5d456acb93a6f (patch)
treef65badc45f1569d1f2971d51a4af46d91b40d8df /lib
parent685539a2a2bd5c6cb9b60c3885befd1b94040f36 (diff)
downloadhcl-c3176bfacd2d08c556708cb955b5d456acb93a6f.tar.bz2
include client name in tasks list
Diffstat (limited to 'lib')
-rw-r--r--lib/hcl/day_entry.rb2
-rw-r--r--lib/hcl/task.rb10
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/hcl/day_entry.rb b/lib/hcl/day_entry.rb
index 3405108..b77d597 100644
--- a/lib/hcl/day_entry.rb
+++ b/lib/hcl/day_entry.rb
@@ -11,7 +11,7 @@ module HCl
end
def to_s
- "#{client} #{project} #{task} (#{formatted_hours})"
+ "#{client} - #{project} - #{task} (#{formatted_hours})"
end
def self.from_xml xml
diff --git a/lib/hcl/task.rb b/lib/hcl/task.rb
index abd62a7..c2d2ff3 100644
--- a/lib/hcl/task.rb
+++ b/lib/hcl/task.rb
@@ -9,14 +9,18 @@ module HCl
end)
end
unless tasks.empty?
- File.open(File.join(ENV['HOME'],'.hcl_tasks'), 'w') do |f|
+ File.open(cache_file, 'w') do |f|
f.write tasks.uniq.to_yaml
end
end
end
+
+ def self.cache_file
+ File.join(ENV['HOME'],'.hcl_tasks')
+ end
def self.all
- YAML.load File.read(File.join(ENV['HOME'],'.hcl_tasks'))
+ File.exists?(cache_file) ? YAML.load(File.read(cache_file)) : []
end
def self.find project_id, id
@@ -26,7 +30,7 @@ module HCl
end
def to_s
- "#{project.name} #{name}"
+ "#{project.client} - #{project.name} - #{name}"
end
def add opts